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

            *ptr = new cef_task_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Beispiel #3
0
 private int release(cef_task_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
Beispiel #4
0
 private int add_ref(cef_task_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
Beispiel #5
0
 private void CheckSelf(cef_task_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Beispiel #6
0
 private int get_refct(cef_task_t* self)
 {
     return _refct;
 }
Beispiel #7
0
        private void execute(cef_task_t* self)
        {
            CheckSelf(self);

            Execute();
        }
Beispiel #8
0
 public static extern int post_delayed_task(CefThreadId threadId, cef_task_t* task, long delay_ms);
Beispiel #9
0
 public static extern int post_task(CefThreadId threadId, cef_task_t* task);
 public static int post_delayed_task(cef_task_runner_t* self, cef_task_t* task, long delay_ms)
 {
     post_delayed_task_delegate d;
     var p = self->_post_delayed_task;
     if (p == _p7) { d = _d7; }
     else
     {
         d = (post_delayed_task_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(post_delayed_task_delegate));
         if (_p7 == IntPtr.Zero) { _d7 = d; _p7 = p; }
     }
     return d(self, task, delay_ms);
 }
 public static int post_task(cef_task_runner_t* self, cef_task_t* task)
 {
     post_task_delegate d;
     var p = self->_post_task;
     if (p == _p6) { d = _d6; }
     else
     {
         d = (post_task_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(post_task_delegate));
         if (_p6 == IntPtr.Zero) { _d6 = d; _p6 = p; }
     }
     return d(self, task);
 }
 internal static void Free(cef_task_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }