/// <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 bool SetCookie(string url, CefCookie cookie, CefSetCookieCallback callback)
 {
     if (string.IsNullOrEmpty(url))
     {
         throw new ArgumentNullException("url");
     }
     if (cookie == null)
         throw new ArgumentNullException("cookie"); }
        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);
        }
        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);
        }
 /// <summary>
 /// Return true if the specified cookie returned with the response can be set
 /// or false otherwise.
 /// </summary>
 protected abstract bool CanSetCookie(CefCookie cookie);
 /// <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>
 protected abstract bool Visit(CefCookie cookie, int count, int total, out bool delete);