Beispiel #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>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_task_capi.h">cef/include/capi/cef_task_capi.h</see>.
        /// </remarks>
        public bool PostDelayedTask(CfrTask task, long delayMs)
        {
            var call = new CfxTaskRunnerPostDelayedTaskRemoteCall();

            call.@this   = RemotePtr.ptr;
            call.task    = CfrObject.Unwrap(task).ptr;
            call.delayMs = delayMs;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
        /// <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>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_task_capi.h">cef/include/capi/cef_task_capi.h</see>.
        /// </remarks>
        public bool PostDelayedTask(CfrTask task, long delayMs)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxTaskRunnerPostDelayedTaskRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(task, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "task");
            }
            call.task    = CfrObject.Unwrap(task).ptr;
            call.delayMs = delayMs;
            call.RequestExecution(connection);
            return(call.__retval);
        }