Esempio n. 1
0
        protected override void ExecuteInTargetProcess(RemoteConnection connection)
        {
            var sender = CfrTask.Wrap(this.sender);
            var e      = new CfrEventArgs(eventArgsId);

            sender.raise_Execute(sender, e);
        }
        /// <summary>
        /// Post a task for execution on the thread associated with this task runner.
        /// Execution will occur asynchronously.
        /// </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 PostTask(CfrTask task)
        {
            var call = new CfxTaskRunnerPostTaskRenderProcessCall();

            call.@this = proxyId;
            call.task  = CfrObject.Unwrap(task);
            call.RequestExecution(this);
            return(call.__retval);
        }
Esempio n. 3
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 CfxRuntimePostTaskRenderProcessCall();

            call.threadId = (int)threadId;
            call.task     = CfrObject.Unwrap(task);
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(call.__retval);
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        /// <summary>
        /// Post a task for execution on the thread associated with this task runner.
        /// Execution will occur asynchronously.
        /// </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 PostTask(CfrTask task)
        {
            var call = new CfxTaskRunnerPostTaskRemoteCall();

            call.@this = RemotePtr.ptr;
            call.task  = CfrObject.Unwrap(task).ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
Esempio n. 6
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 CfxTaskRunnerPostDelayedTaskRenderProcessCall();

            call.self    = CfrObject.Unwrap(this);
            call.task    = CfrObject.Unwrap(task);
            call.delayMs = delayMs;
            call.RequestExecution(this);
            return(call.__retval);
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
        /// <summary>
        /// Post a task for execution on the thread associated with this task runner.
        /// Execution will occur asynchronously.
        /// </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 PostTask(CfrTask task)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxTaskRunnerPostTaskRemoteCall();

            call.@this = RemotePtr.ptr;
            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);
        }
Esempio n. 9
0
        internal static CfrTask Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrTask)weakCache.Get(remotePtr.ptr);
                if (cfrObj == null)
                {
                    cfrObj = new CfrTask(remotePtr);
                    weakCache.Add(remotePtr.ptr, cfrObj);
                }
                return(cfrObj);
            }
        }
Esempio n. 10
0
        internal static CfrTask Wrap(IntPtr proxyId)
        {
            if (proxyId == IntPtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrTask)weakCache.Get(proxyId);
                if (cfrObj == null)
                {
                    cfrObj = new CfrTask(proxyId);
                    weakCache.Add(proxyId, cfrObj);
                }
                return(cfrObj);
            }
        }