Exemplo n.º 1
0
        /// <summary>
        /// Post a task for execution on the specified thread. Equivalent to using
        /// CfrTaskRunner.GetForThread(threadId).PostTask(task).
        /// </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 PostTask(CfxThreadId threadId, CfrTask task)
        {
            var call = new CfxRuntimePostTaskRemoteCall();

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

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