Esempio n. 1
0
 internal static cef_cookie_visitor_t* Alloc()
 {
     var ptr = (cef_cookie_visitor_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_cookie_visitor_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
        internal static cef_cookie_visitor_t *Alloc()
        {
            var ptr = (cef_cookie_visitor_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_cookie_visitor_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Esempio n. 3
0
 private void add_ref(cef_cookie_visitor_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Esempio n. 4
0
        private int visit(cef_cookie_visitor_t* self, cef_cookie_t* cookie, int count, int total, int* deleteCookie)
        {
            CheckSelf(self);

            var mCookie = CefCookie.FromNative(cookie);
            bool mDelete;

            var result = Visit(mCookie, count, total, out mDelete);

            *deleteCookie = mDelete ? 1 : 0;
            return result ? 1 : 0;
        }
Esempio n. 5
0
 private int release(cef_cookie_visitor_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return 1;
         }
         return 0;
     }
 }
Esempio n. 6
0
 internal static void Free(cef_cookie_visitor_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Esempio n. 7
0
 public static int visit_url_cookies(cef_cookie_manager_t* self, cef_string_t* url, int includeHttpOnly, cef_cookie_visitor_t* visitor)
 {
     visit_url_cookies_delegate d;
     var p = self->_visit_url_cookies;
     if (p == _p5) { d = _d5; }
     else
     {
         d = (visit_url_cookies_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(visit_url_cookies_delegate));
         if (_p5 == IntPtr.Zero) { _d5 = d; _p5 = p; }
     }
     return d(self, url, includeHttpOnly, visitor);
 }
Esempio n. 8
0
 public static int visit_all_cookies(cef_cookie_manager_t* self, cef_cookie_visitor_t* visitor)
 {
     visit_all_cookies_delegate d;
     var p = self->_visit_all_cookies;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (visit_all_cookies_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(visit_all_cookies_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self, visitor);
 }
Esempio n. 9
0
 private void CheckSelf(cef_cookie_visitor_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Esempio n. 10
0
 private int has_one_ref(cef_cookie_visitor_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }
Esempio n. 11
0
 private int get_refct(cef_cookie_visitor_t* self)
 {
     return _refct;
 }