示例#1
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;
 }
示例#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);
        }
示例#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;
     }
 }
示例#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;
     }
 }
示例#5
0
 private void CheckSelf(cef_task_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
示例#6
0
 private int get_refct(cef_task_t* self)
 {
     return _refct;
 }
示例#7
0
        private void execute(cef_task_t* self)
        {
            CheckSelf(self);

            Execute();
        }
示例#8
0
 public static extern int post_delayed_task(CefThreadId threadId, cef_task_t* task, long delay_ms);
示例#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);
 }
示例#12
0
 internal static void Free(cef_task_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }