public unsafe int PostTask(cef_task_t *task) { fixed(cef_task_runner_t *self = &this) { return(((delegate * unmanaged[Stdcall] < cef_task_runner_t *, cef_task_t *, int >)post_task)(self, task)); } }
private void CheckSelf(cef_task_t *self) { if (_self != self) { throw ExceptionBuilder.InvalidSelfReference(); } }
public unsafe int PostDelayedTask(cef_task_t *task, long delay_ms) { fixed(cef_task_runner_t *self = &this) { return(((delegate * unmanaged[Stdcall] < cef_task_runner_t *, cef_task_t *, long, int >)post_delayed_task)(self, task, delay_ms)); } }
/// <summary> /// Method that will be executed. /// |threadId| is the thread executing the call. /// </summary> private void execute(cef_task_t *self, cef_thread_id_t threadId) { #if DIAGNOSTICS Cef.Logger.Trace(LogTarget.CefTask, self, "Execute: ThreadId=[{0}]", threadId); #endif this.Execute((CefThreadId)threadId); }
protected virtual void Dispose(bool disposing) { if (_self != null) { cef_task_t.Free(_self); _self = null; } }
// void (*)(_cef_task_t* self)* private static unsafe void ExecuteImpl(cef_task_t *self) { var instance = GetInstance((IntPtr)self) as CefTask; if (instance == null) { return; } instance.Execute(); }
public CefTask() { cef_task_t *self = this.NativeInstance; #if NET_LESS_5_0 self->execute = (void *)Marshal.GetFunctionPointerForDelegate(fnExecute); #else self->execute = (delegate * unmanaged[Stdcall] < cef_task_t *, void >) & ExecuteImpl; #endif }
private void add_ref(cef_task_t *self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
private int release(cef_task_t *self) { lock (SyncRoot) { var result = --_refct; if (result == 0) { lock (_roots) { _roots.Remove((IntPtr)_self); } } return(result); } }
protected CefTask() { _self = cef_task_t.Alloc(); _ds0 = new cef_task_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_task_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_task_t.has_one_ref_delegate(has_one_ref); _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_task_t.execute_delegate(execute); _self->_execute = Marshal.GetFunctionPointerForDelegate(_ds3); }
protected CefTask() { _self = cef_task_t.Alloc(); _ds0 = new cef_task_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_task_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_task_t.get_refct_delegate(get_refct); _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_task_t.execute_delegate(execute); _self->_execute = Marshal.GetFunctionPointerForDelegate(_ds3); }
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)); }
public unsafe extern int PostTask(cef_task_t *task);
private int has_one_ref(cef_task_t *self) { lock (SyncRoot) { return(_refct == 1 ? 1 : 0); } }
/// <summary> /// Post a task for delayed execution on the thread associated with this task /// runner. Execution will occur asynchronously. Delayed tasks are not /// supported on V8 WebWorker threads and will be executed without the /// specified delay. /// </summary> public int PostDelayedTask(cef_task_t *task, long delay_ms) { throw new NotImplementedException(); // TODO: CefTaskRunner.PostDelayedTask }
public CefTask() { cef_task_t *self = this.NativeInstance; self->execute = (void *)Marshal.GetFunctionPointerForDelegate(fnExecute); }
private int has_at_least_one_ref(cef_task_t *self) { lock (SyncRoot) { return(_refct != 0 ? 1 : 0); } }
private void execute(cef_task_t *self) { CheckSelf(self); Execute(); }
public CefTask(cef_task_t *instance) : base((cef_base_ref_counted_t *)instance) { }
internal static void Free(cef_task_t *ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
private void execute(cef_task_t *self) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefTask.Execute }
public static extern int post_task(CefThreadId threadId, cef_task_t *task);
/// <summary> /// Post a task for execution on the thread associated with this task runner. /// Execution will occur asynchronously. /// </summary> public int PostTask(cef_task_t *task) { throw new NotImplementedException(); // TODO: CefTaskRunner.PostTask }
private int get_refct(cef_task_t *self) { return(_refct); }
public static extern int post_delayed_task(CefThreadId threadId, cef_task_t *task, long delay_ms);
public unsafe extern int PostDelayedTask(cef_task_t *task, long delay_ms);