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

            sender.raise_Get(sender, e);
        }
Beispiel #2
0
        /// <summary>
        /// Create a new CfrV8Value object of type object with optional accessor. This
        /// function should only be called from within the scope of a
        /// CfrRenderProcessHandler, CfrV8Handler or CfrV8Accessor callback,
        /// or in combination with calling enter() and exit() on a stored CfrV8Context
        /// reference.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public static CfrV8Value CreateObject(CfrV8Accessor accessor)
        {
            var call = new CfxV8ValueCreateObjectRenderProcessCall();

            call.accessor = CfrObject.Unwrap(accessor);
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrV8Value.Wrap(call.__retval));
        }
Beispiel #3
0
        /// <summary>
        /// Create a new CfrV8Value object of type object with optional accessor
        /// and/or interceptor. This function should only be called from within the scope
        /// of a CfrRenderProcessHandler, CfrV8Handler or CfrV8Accessor
        /// callback, or in combination with calling enter() and exit() on a stored
        /// CfrV8Context reference.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public static CfrV8Value CreateObject(CfrV8Accessor accessor, CfrV8Interceptor interceptor)
        {
            var call = new CfxV8ValueCreateObjectRemoteCall();

            call.accessor    = CfrObject.Unwrap(accessor).ptr;
            call.interceptor = CfrObject.Unwrap(interceptor).ptr;
            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Beispiel #4
0
        internal static CfrV8Accessor Wrap(IntPtr proxyId)
        {
            if (proxyId == IntPtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

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

            lock (weakCache) {
                var cfrObj = (CfrV8Accessor)weakCache.Get(remotePtr.ptr);
                if (cfrObj == null)
                {
                    cfrObj = new CfrV8Accessor(remotePtr);
                    weakCache.Add(remotePtr.ptr, cfrObj);
                }
                return(cfrObj);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Create a new CfrV8Value object of type object with optional accessor
        /// and/or interceptor. This function should only be called from within the scope
        /// of a CfrRenderProcessHandler, CfrV8Handler or CfrV8Accessor
        /// callback, or in combination with calling enter() and exit() on a stored
        /// CfrV8Context reference.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public static CfrV8Value CreateObject(CfrV8Accessor accessor, CfrV8Interceptor interceptor)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxV8ValueCreateObjectRemoteCall();

            if (!CfrObject.CheckConnection(accessor, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "accessor");
            }
            call.accessor = CfrObject.Unwrap(accessor).ptr;
            if (!CfrObject.CheckConnection(interceptor, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "interceptor");
            }
            call.interceptor = CfrObject.Unwrap(interceptor).ptr;
            call.RequestExecution(connection);
            return(CfrV8Value.Wrap(new RemotePtr(connection, call.__retval)));
        }
Beispiel #7
0
 /// <summary>
 /// Create a new CfrV8Value object of type object with accessor.
 /// This function should only be called from within the scope
 /// of a CfrRenderProcessHandler, CfrV8Handler or CfrV8Accessor
 /// callback, or in combination with calling enter() and exit() on a stored
 /// CfrV8Context reference.
 /// </summary>
 public static CfrV8Value CreateObject(CfrV8Accessor accessor)
 {
     return(CreateObject(accessor, null));
 }