示例#1
0
 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);
 }
示例#2
0
        public static cef_cookie_t *Alloc()
        {
            var ptr = (cef_cookie_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_cookie_t();
            return(ptr);
        }
        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;
        }
示例#4
0
 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,
         };
 }
        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
 internal static void Free(cef_cookie_t* ptr)
 {
     cef_cookie_t.Clear((cef_cookie_t*)ptr);
     cef_cookie_t.Free((cef_cookie_t*)ptr);
 }
 public static int set_cookie(cef_cookie_manager_t* self, cef_string_t* url, cef_cookie_t* cookie)
 {
     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);
 }
示例#8
0
 public static void Free(cef_cookie_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
示例#9
0
 public static cef_cookie_t* Alloc()
 {
     var ptr = (cef_cookie_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_cookie_t();
     return ptr;
 }