Ejemplo n.º 1
0
 private void CheckSelf(cef_set_cookie_callback_t *self)
 {
     if (_self != self)
     {
         throw ExceptionBuilder.InvalidSelfReference();
     }
 }
Ejemplo n.º 2
0
 protected virtual void Dispose(bool disposing)
 {
     if (_self != null)
     {
         cef_set_cookie_callback_t.Free(_self);
         _self = null;
     }
 }
Ejemplo n.º 3
0
        private static unsafe void OnCompleteImpl(cef_set_cookie_callback_t *self, int success)
        {
            var instance = GetInstance((IntPtr)self) as CefSetCookieCallback;

            if (instance == null || ((ICefSetCookieCallbackPrivate)instance).AvoidOnComplete())
            {
                return;
            }
            instance.OnComplete(success != 0);
        }
Ejemplo n.º 4
0
        public CefSetCookieCallback()
        {
            cef_set_cookie_callback_t *self = this.NativeInstance;

                        #if NET_LESS_5_0
            self->on_complete = (void *)Marshal.GetFunctionPointerForDelegate(fnOnComplete);
                        #else
            self->on_complete = (delegate * unmanaged[Stdcall] < cef_set_cookie_callback_t *, int, void >) & OnCompleteImpl;
                        #endif
        }
Ejemplo n.º 5
0
 private void add_ref(cef_set_cookie_callback_t *self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Ejemplo n.º 6
0
 private int release(cef_set_cookie_callback_t *self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return(1);
         }
         return(0);
     }
 }
Ejemplo n.º 7
0
        protected CefSetCookieCallback()
        {
            _self = cef_set_cookie_callback_t.Alloc();

            _ds0 = new cef_set_cookie_callback_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_set_cookie_callback_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_set_cookie_callback_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_set_cookie_callback_t.on_complete_delegate(on_complete);
            _self->_on_complete = Marshal.GetFunctionPointerForDelegate(_ds3);
        }
Ejemplo n.º 8
0
 public CefSetCookieCallback(cef_set_cookie_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
 internal static void Free(cef_set_cookie_callback_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Ejemplo n.º 10
0
 public unsafe int SetCookie([Immutable] cef_string_t *url, [Immutable] cef_cookie_t *cookie, cef_set_cookie_callback_t *callback)
 {
     fixed(cef_cookie_manager_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_cookie_manager_t *, cef_string_t *, cef_cookie_t *, cef_set_cookie_callback_t *, int >)set_cookie)(self, url, cookie, callback));
     }
 }
Ejemplo n.º 11
0
 private int has_at_least_one_ref(cef_set_cookie_callback_t *self)
 {
     lock (SyncRoot) { return(_refct != 0 ? 1 : 0); }
 }
 private void on_complete(cef_set_cookie_callback_t *self, int success)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefSetCookieCallback.OnComplete
 }
Ejemplo n.º 13
0
        public CefSetCookieCallback()
        {
            cef_set_cookie_callback_t *self = this.NativeInstance;

            self->on_complete = (void *)Marshal.GetFunctionPointerForDelegate(fnOnComplete);
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Sets a cookie given a valid URL and explicit user-provided cookie
 /// attributes. This function expects each attribute to be well-formed. It will
 /// check for disallowed characters (e.g. the ';' character is disallowed
 /// within the cookie value attribute) and fail without setting the cookie if
 /// such characters are found. If |callback| is non-NULL it will be executed
 /// asnychronously on the IO thread after the cookie has been set. Returns
 /// false if an invalid URL is specified or if cookies cannot be accessed.
 /// </summary>
 public int SetCookie(cef_string_t *url, cef_cookie_t *cookie, cef_set_cookie_callback_t *callback)
 {
     throw new NotImplementedException(); // TODO: CefCookieManager.SetCookie
 }
 private void on_complete(cef_set_cookie_callback_t *self, int success)
 {
     CheckSelf(self);
     OnComplete(success != 0);
 }
Ejemplo n.º 16
0
 private int has_one_ref(cef_set_cookie_callback_t *self)
 {
     lock (SyncRoot) { return(_refct == 1 ? 1 : 0); }
 }
        public static int set_cookie(cef_cookie_manager_t *self, cef_string_t *url, cef_cookie_t *cookie, cef_set_cookie_callback_t *callback)
        {
            set_cookie_delegate d;
            var p = self->_set_cookie;

            if (p == _p6)
            {
                d = _d6;
            }
            else
            {
                d = (set_cookie_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_cookie_delegate));
                if (_p6 == IntPtr.Zero)
                {
                    _d6 = d; _p6 = p;
                }
            }
            return(d(self, url, cookie, callback));
        }
Ejemplo n.º 18
0
 public unsafe extern int SetCookie([Immutable] cef_string_t *url, [Immutable] cef_cookie_t *cookie, cef_set_cookie_callback_t *callback);