protected override void ExecuteInTargetProcess(RemoteConnection connection)
        {
            var sender = CfrDomVisitor.Wrap(this.sender);
            var e      = new CfrDomVisitorVisitEventArgs(eventArgsId);

            sender.raise_Visit(sender, e);
        }
Exemple #2
0
        /// <summary>
        /// Visit the DOM document. This function can only be called from the render
        /// process.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public void VisitDom(CfrDomVisitor visitor)
        {
            var call = new CfxFrameVisitDomRenderProcessCall();

            call.self    = CfrObject.Unwrap(this);
            call.visitor = CfrObject.Unwrap(visitor);
            call.RequestExecution(this);
        }
Exemple #3
0
        /// <summary>
        /// Visit the DOM document. This function can only be called from the render
        /// process.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public void VisitDom(CfrDomVisitor visitor)
        {
            var call = new CfxFrameVisitDomRemoteCall();

            call.@this   = RemotePtr.ptr;
            call.visitor = CfrObject.Unwrap(visitor).ptr;
            call.RequestExecution(RemotePtr.connection);
        }
Exemple #4
0
        /// <summary>
        /// Visit the DOM document. This function can only be called from the render
        /// process.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public void VisitDom(CfrDomVisitor visitor)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxFrameVisitDomRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(visitor, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "visitor");
            }
            call.visitor = CfrObject.Unwrap(visitor).ptr;
            call.RequestExecution(connection);
        }
Exemple #5
0
        internal static CfrDomVisitor Wrap(IntPtr proxyId)
        {
            if (proxyId == IntPtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrDomVisitor)weakCache.Get(proxyId);
                if (cfrObj == null)
                {
                    cfrObj = new CfrDomVisitor(proxyId);
                    weakCache.Add(proxyId, cfrObj);
                }
                return(cfrObj);
            }
        }
        internal static CfrDomVisitor Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrDomVisitor)weakCache.Get(remotePtr.ptr);
                if (cfrObj == null)
                {
                    cfrObj = new CfrDomVisitor(remotePtr);
                    weakCache.Add(remotePtr.ptr, cfrObj);
                }
                return(cfrObj);
            }
        }