/// <summary>
        /// Create a new CfrProcessMessage object with the specified name.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_process_message_capi.h">cef/include/capi/cef_process_message_capi.h</see>.
        /// </remarks>
        public static CfrProcessMessage Create(string name)
        {
            var call = new CfxProcessMessageCreateRenderProcessCall();

            call.name = name;
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrProcessMessage.Wrap(call.__retval));
        }
예제 #2
0
        /// <summary>
        /// Create a new CfrProcessMessage object with the specified name.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_process_message_capi.h">cef/include/capi/cef_process_message_capi.h</see>.
        /// </remarks>
        public static CfrProcessMessage Create(string name)
        {
            var call = new CfxProcessMessageCreateRemoteCall();

            call.name = name;
            call.RequestExecution();
            return(CfrProcessMessage.Wrap(new RemotePtr(call.__retval)));
        }
예제 #3
0
        /// <summary>
        /// Returns a writable copy of this object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_process_message_capi.h">cef/include/capi/cef_process_message_capi.h</see>.
        /// </remarks>
        public CfrProcessMessage Copy()
        {
            var call = new CfxProcessMessageCopyRemoteCall();

            call.@this = RemotePtr.ptr;
            call.RequestExecution(RemotePtr.connection);
            return(CfrProcessMessage.Wrap(new RemotePtr(call.__retval)));
        }
        /// <summary>
        /// Returns a writable copy of this object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_process_message_capi.h">cef/include/capi/cef_process_message_capi.h</see>.
        /// </remarks>
        public CfrProcessMessage Copy()
        {
            var call = new CfxProcessMessageCopyRenderProcessCall();

            call.@this = proxyId;
            call.RequestExecution(this);
            return(CfrProcessMessage.Wrap(call.__retval));
        }
예제 #5
0
        /// <summary>
        /// Returns a writable copy of this object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_process_message_capi.h">cef/include/capi/cef_process_message_capi.h</see>.
        /// </remarks>
        public CfrProcessMessage Copy()
        {
            var call = new CfxProcessMessageCopyRenderProcessCall();

            call.self = CfrObject.Unwrap(this);
            call.RequestExecution(this);
            return(CfrProcessMessage.Wrap(call.__retval));
        }
예제 #6
0
        /// <summary>
        /// Send a message to the specified |targetProcess|. Returns true (1) if the
        /// message was sent successfully.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>.
        /// </remarks>
        public bool SendProcessMessage(CfxProcessId targetProcess, CfrProcessMessage message)
        {
            var call = new CfxBrowserSendProcessMessageRenderProcessCall();

            call.@this         = proxyId;
            call.targetProcess = (int)targetProcess;
            call.message       = CfrObject.Unwrap(message);
            call.RequestExecution(this);
            return(call.__retval);
        }
예제 #7
0
        /// <summary>
        /// Send a message to the specified |targetProcess|. Returns true (1) if the
        /// message was sent successfully.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_browser_capi.h">cef/include/capi/cef_browser_capi.h</see>.
        /// </remarks>
        public bool SendProcessMessage(CfxProcessId targetProcess, CfrProcessMessage message)
        {
            var call = new CfxBrowserSendProcessMessageRemoteCall();

            call.@this         = RemotePtr.ptr;
            call.targetProcess = (int)targetProcess;
            call.message       = CfrObject.Unwrap(message).ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
예제 #8
0
        /// <summary>
        /// Send a message to the specified |targetProcess|. Message delivery is not
        /// guaranteed in all cases (for example, if the browser is closing,
        /// navigating, or if the target process crashes). Send an ACK message back
        /// from the target process if confirmation is required.
        /// </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 SendProcessMessage(CfxProcessId targetProcess, CfrProcessMessage message)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxFrameSendProcessMessageRemoteCall();

            call.@this         = RemotePtr.ptr;
            call.targetProcess = (int)targetProcess;
            if (!CfrObject.CheckConnection(message, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "message");
            }
            call.message = CfrObject.Unwrap(message).ptr;
            call.RequestExecution(connection);
        }
예제 #9
0
        internal static CfrProcessMessage Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

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

            lock (weakCache) {
                var cfrObj = (CfrProcessMessage)weakCache.Get(proxyId);
                if (cfrObj == null)
                {
                    cfrObj = new CfrProcessMessage(proxyId);
                    weakCache.Add(proxyId, cfrObj);
                }
                return(cfrObj);
            }
        }
예제 #11
0
 internal static CfrProcessMessage Wrap(IntPtr proxyId)
 {
     if(proxyId == IntPtr.Zero) return null;
     var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;
     lock(weakCache) {
         var cfrObj = (CfrProcessMessage)weakCache.Get(proxyId);
         if(cfrObj == null) {
             cfrObj = new CfrProcessMessage(proxyId);
             weakCache.Add(proxyId, cfrObj);
         }
         return cfrObj;
     }
 }