Exemple #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;
 }
Exemple #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);
        }
Exemple #3
0
 private void add_ref(cef_task_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Exemple #4
0
 private int release(cef_task_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return 1;
         }
         return 0;
     }
 }
Exemple #5
0
 public static extern int post_delayed_task(CefThreadId threadId, cef_task_t* task, long delay_ms);
Exemple #6
0
 public static extern int post_task(CefThreadId threadId, cef_task_t* task);
Exemple #7
0
        private void execute(cef_task_t* self)
        {
            CheckSelf(self);

            Execute();
        }
Exemple #8
0
 internal static void Free(cef_task_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Exemple #9
0
 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);
 }
Exemple #10
0
 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);
 }
Exemple #11
0
 private int get_refct(cef_task_t* self)
 {
     return _refct;
 }
Exemple #12
0
 private void CheckSelf(cef_task_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Exemple #13
0
 private int has_one_ref(cef_task_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }