internal static cef_request_context_handler_t* Alloc()
 {
     var ptr = (cef_request_context_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_request_context_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
Exemple #2
0
        internal static cef_request_context_handler_t *Alloc()
        {
            var ptr = (cef_request_context_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_request_context_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
        private cef_cookie_manager_t* get_cookie_manager(cef_request_context_handler_t* self)
        {
            CheckSelf(self);

            var result = GetCookieManager();

            return result != null ? result.ToNative() : null;
        }
 internal static CefRequestContextHandler FromNativeOrNull(cef_request_context_handler_t* ptr)
 {
     CefRequestContextHandler value = null;
     bool found;
     lock (_roots)
     {
         found = _roots.TryGetValue((IntPtr)ptr, out value);
     }
     return found ? value : null;
 }
 private void add_ref(cef_request_context_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
 private int release(cef_request_context_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return 1;
         }
         return 0;
     }
 }
 internal static CefRequestContextHandler FromNative(cef_request_context_handler_t* ptr)
 {
     var value = FromNativeOrNull(ptr);
     if (value == null) throw ExceptionBuilder.ObjectNotFound();
     return value;
 }
 private int get_refct(cef_request_context_handler_t* self)
 {
     return _refct;
 }
 private void CheckSelf(cef_request_context_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
 internal static void Free(cef_request_context_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
 public static extern cef_request_context_t* create_context(cef_request_context_handler_t* handler);
 private int has_one_ref(cef_request_context_handler_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }