Example #1
0
        /// <summary>
        /// Create a new CfxProcessMessage 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 CfxProcessMessage Create(string name)
        {
            var name_pinned = new PinnedString(name);
            var __retval    = CfxApi.ProcessMessage.cfx_process_message_create(name_pinned.Obj.PinnedPtr, name_pinned.Length);

            name_pinned.Obj.Free();
            return(CfxProcessMessage.Wrap(__retval));
        }
Example #2
0
 internal static CfxProcessMessage Wrap(IntPtr nativePtr)
 {
     if (nativePtr == IntPtr.Zero)
     {
         return(null);
     }
     lock (weakCache) {
         var wrapper = (CfxProcessMessage)weakCache.Get(nativePtr);
         if (wrapper == null)
         {
             wrapper = new CfxProcessMessage(nativePtr);
             weakCache.Add(wrapper);
         }
         else
         {
             CfxApi.cfx_release(nativePtr);
         }
         return(wrapper);
     }
 }
 /// <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, CfxProcessMessage message)
 {
     return(0 != CfxApi.Browser.cfx_browser_send_process_message(NativePtr, (int)targetProcess, CfxProcessMessage.Unwrap(message)));
 }
Example #4
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 CfxProcessMessage Copy()
 {
     return(CfxProcessMessage.Wrap(CfxApi.ProcessMessage.cfx_process_message_copy(NativePtr)));
 }
Example #5
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, CfxProcessMessage message)
 {
     CfxApi.Frame.cfx_frame_send_process_message(NativePtr, (int)targetProcess, CfxProcessMessage.Unwrap(message));
 }