コード例 #1
0
ファイル: cef_cookie_manager_t.cs プロジェクト: vmas/CefNet
 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));
     }
 }
 internal static void Clear(cef_cookie_t *ptr)
 {
     libcef.string_clear(&ptr->name);
     libcef.string_clear(&ptr->value);
     libcef.string_clear(&ptr->domain);
     libcef.string_clear(&ptr->path);
 }
コード例 #3
0
 public static void Clear(cef_cookie_t *self)
 {
     cef_string_t.Clear(&self->name);
     cef_string_t.Clear(&self->value);
     cef_string_t.Clear(&self->domain);
     cef_string_t.Clear(&self->path);
 }
コード例 #4
0
 public unsafe int Visit([Immutable] cef_cookie_t *cookie, int count, int total, int *deleteCookie)
 {
     fixed(cef_cookie_visitor_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_cookie_visitor_t *, cef_cookie_t *, int, int, int *, int >)visit)(self, cookie, count, total, deleteCookie));
     }
 }
コード例 #5
0
        private int can_get_cookie(cef_resource_handler_t *self, cef_cookie_t *cookie)
        {
            CheckSelf(self);

            var m_cookie = CefCookie.FromNative(cookie);

            return(CanGetCookie(m_cookie) ? 1 : 0);
        }
コード例 #6
0
ファイル: CefCookie.cs プロジェクト: PlumpMath/cefglue-5
 public void Dispose()
 {
     if (this.ptr != null && this.owner)
     {
         cef_cookie_t.Free(this.ptr);
     }
     this.ptr = null;
     GC.SuppressFinalize(this);
 }
コード例 #7
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);
        }
コード例 #8
0
ファイル: CefCookie.cs プロジェクト: gaojinbo010/Cef3Demo
 internal static CefCookie FromNative(cef_cookie_t *ptr)
 {
     return(new CefCookie
     {
         Name = cef_string_t.ToString(&ptr->name),
         Value = cef_string_t.ToString(&ptr->value),
         Domain = cef_string_t.ToString(&ptr->domain),
         Path = cef_string_t.ToString(&ptr->path),
         Secure = ptr->secure,
         HttpOnly = ptr->httponly,
         Creation = cef_time_t.ToDateTime(&ptr->creation),
         LastAccess = cef_time_t.ToDateTime(&ptr->last_access),
         Expires = ptr->has_expires ? (DateTime?)cef_time_t.ToDateTime(&ptr->expires) : null,
     });
 }
コード例 #9
0
        /// <summary>
        /// Method that will be called once for each cookie. |count| is the
        /// 0-based index for the current cookie. |total| is the total number of
        /// cookies. Set |deleteCookie| to true to delete the cookie currently
        /// being visited. Return false to stop visiting cookies. This method may
        /// never be called if no cookies are found.
        /// </summary>
        private int visit(cef_cookie_visitor_t *self, /*const*/ cef_cookie_t *cookie, int count, int total, int *deleteCookie)
        {
            ThrowIfObjectDisposed();

            var  m_cookie = CefCookie.From(cookie);
            bool m_deleteCookie;

            var handled = this.Visit(m_cookie, count, total, out m_deleteCookie);

            m_cookie.Dispose();

            *deleteCookie = m_deleteCookie ? 1 : 0;

            return(handled ? 1 : 0);
        }
コード例 #10
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));
        }
コード例 #11
0
 public unsafe extern int CanSaveCookie(cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_response_t *response, [Immutable] cef_cookie_t *cookie);
コード例 #12
0
ファイル: CefCookie.cs プロジェクト: gaojinbo010/Cef3Demo
 internal static void Free(cef_cookie_t *ptr)
 {
     cef_cookie_t.Clear((cef_cookie_t *)ptr);
     cef_cookie_t.Free((cef_cookie_t *)ptr);
 }
コード例 #13
0
ファイル: CefCookie.cs プロジェクト: yasoonOfficial/cefglue
 public CefCookie()
 {
     this.ptr = cef_cookie_t.Alloc();
     this.owner = true;
 }
コード例 #14
0
 public unsafe extern int Visit([Immutable] cef_cookie_t *cookie, int count, int total, int *deleteCookie);
コード例 #15
0
        private int can_set_cookie(cef_request_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_cookie_t *cookie)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame   = CefFrame.FromNative(frame);
            var mRequest = CefRequest.FromNative(request);
            var mCookie  = CefCookie.FromNative(cookie);

            var mResult = CanSetCookie(mBrowser, mFrame, mRequest, mCookie);

            return(mResult ? 1 : 0);
        }
コード例 #16
0
        private int can_save_cookie(cef_cookie_access_filter_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_response_t *response, cef_cookie_t *cookie)
        {
            CheckSelf(self);

            var m_browser  = CefBrowser.FromNativeOrNull(browser);
            var m_frame    = CefFrame.FromNativeOrNull(frame);
            var m_request  = CefRequest.FromNative(request);
            var m_response = CefResponse.FromNative(response);
            var m_cookie   = CefCookie.FromNative(cookie);

            var m_result = CanSaveCookie(m_browser, m_frame, m_request, m_response, m_cookie);

            return(m_result ? 1 : 0);
        }
 public static void Free(cef_cookie_t *ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
コード例 #18
0
 public unsafe int CanSaveCookie(cef_browser_t *browser, cef_frame_t *frame, cef_request_t *request, cef_response_t *response, [Immutable] cef_cookie_t *cookie)
 {
     fixed(cef_cookie_access_filter_t *self = &this)
     {
         return(((delegate * unmanaged[Stdcall] < cef_cookie_access_filter_t *, cef_browser_t *, cef_frame_t *, cef_request_t *, cef_response_t *, cef_cookie_t *, int >)can_save_cookie)(self, browser, frame, request, response, cookie));
     }
 }
        /// <summary>
        /// Return true if the specified cookie can be sent with the request or false
        /// otherwise. If false is returned for any cookie then no cookies will be sent
        /// with the request.
        /// </summary>
        // protected abstract int CanGetCookie(cef_cookie_t* cookie);

        private int can_set_cookie(cef_resource_handler_t *self, cef_cookie_t *cookie)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefResourceHandler.CanSetCookie
        }
コード例 #20
0
ファイル: CefCookie.cs プロジェクト: yasoonOfficial/cefglue
 private CefCookie(cef_cookie_t* ptr)
 {
     this.ptr = ptr;
     this.owner = false;
 }
コード例 #21
0
ファイル: CefCookie.cs プロジェクト: PlumpMath/cefglue-5
 private CefCookie(cef_cookie_t *ptr)
 {
     this.ptr   = ptr;
     this.owner = false;
 }
コード例 #22
0
 public unsafe extern int SetCookie([Immutable] cef_string_t *url, [Immutable] cef_cookie_t *cookie, cef_set_cookie_callback_t *callback);
コード例 #23
0
ファイル: CefCookie.cs プロジェクト: PlumpMath/cefglue-5
        // TODO: cookie can be writable

        internal static CefCookie From(cef_cookie_t *ptr)
        {
            return(new CefCookie(ptr));
        }
コード例 #24
0
 private int visit(cef_cookie_visitor_t *self, cef_cookie_t *cookie, int count, int total, int *deleteCookie)
 {
     CheckSelf(self);
     throw new NotImplementedException(); // TODO: CefCookieVisitor.Visit
 }
コード例 #25
0
ファイル: CefCookie.cs プロジェクト: yasoonOfficial/cefglue
 public void Dispose()
 {
     if (this.ptr != null && this.owner)
     {
         cef_cookie_t.Free(this.ptr);
     }
     this.ptr = null;
     GC.SuppressFinalize(this);
 }
コード例 #26
0
ファイル: CefCookie.cs プロジェクト: PlumpMath/cefglue-5
 public CefCookie()
 {
     this.ptr   = cef_cookie_t.Alloc();
     this.owner = true;
 }
コード例 #27
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
 }