Ejemplo n.º 1
0
        /// <summary>
        /// Post a task for delayed execution on the specified thread. Equivalent to
        /// using CfrTaskRunner.GetForThread(threadId).PostDelayedTask(task,
        /// delay_ms).
        /// </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 static bool PostDelayedTask(CfxThreadId threadId, CfrTask task, long delayMs)
        {
            var call = new CfxRuntimePostDelayedTaskRemoteCall();

            call.threadId = (int)threadId;
            call.task     = CfrObject.Unwrap(task).ptr;
            call.delayMs  = delayMs;
            call.RequestExecution();
            return(call.__retval);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Post a task for delayed execution on the specified thread. Equivalent to
        /// using CfrTaskRunner.GetForThread(threadId).PostDelayedTask(task,
        /// delay_ms).
        /// </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 static bool PostDelayedTask(CfxThreadId threadId, CfrTask task, long delayMs)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxRuntimePostDelayedTaskRemoteCall();

            call.threadId = (int)threadId;
            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);
        }