Esempio n. 1
0
        /// <summary>
        /// Execute the function using the specified V8 context. |object| is the
        /// receiver ('this' object) of the function. If |object| is NULL the specified
        /// context's global object will be used. |arguments| is the list of arguments
        /// that will be passed to the function. Returns the function return value on
        /// success. Returns NULL if this function is called incorrectly or an
        /// exception is thrown.
        /// </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 CfrV8Value ExecuteFunctionWithContext(CfrV8Context context, CfrV8Value @object, CfrV8Value[] arguments)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxV8ValueExecuteFunctionWithContextRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(context, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "context");
            }
            call.context = CfrObject.Unwrap(context).ptr;
            if (!CfrObject.CheckConnection(@object, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "object");
            }
            call.@object = CfrObject.Unwrap(@object).ptr;
            if (arguments != null)
            {
                call.arguments = new IntPtr[arguments.Length];
                for (int i = 0; i < arguments.Length; ++i)
                {
                    if (!CheckConnection(arguments[i], connection))
                    {
                        throw new ArgumentException("Render process connection mismatch.", "arguments[" + i + "]");
                    }
                    call.arguments[i] = CfrObject.Unwrap(arguments[i]).ptr;
                }
            }
            call.RequestExecution(connection);
            return(CfrV8Value.Wrap(new RemotePtr(connection, call.__retval)));
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new CfrV8Value object of type null.
        /// </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 CreateNull()
        {
            var call = new CfxV8ValueCreateNullRemoteCall();

            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new CfrV8Value object of type null.
        /// </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 CreateNull()
        {
            var call = new CfxV8ValueCreateNullRenderProcessCall();

            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrV8Value.Wrap(call.__retval));
        }
Esempio n. 4
0
        /// <summary>
        /// Create a new CfrV8Value object of type null.
        /// </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 CreateNull()
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxV8ValueCreateNullRemoteCall();

            call.RequestExecution(connection);
            return(CfrV8Value.Wrap(new RemotePtr(connection, call.__retval)));
        }
Esempio n. 5
0
        /// <summary>
        /// Create a new CfrV8Value object of type Date. 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 CreateDate(CfrTime date)
        {
            var call = new CfxV8ValueCreateDateRenderProcessCall();

            call.date = CfrObject.Unwrap(date);
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrV8Value.Wrap(call.__retval));
        }
Esempio n. 6
0
        /// <summary>
        /// Create a new CfrV8Value object of type Date. 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 CreateDate(CfrTime date)
        {
            var call = new CfxV8ValueCreateDateRemoteCall();

            call.date = CfrObject.Unwrap(date).ptr;
            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 7
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));
        }
Esempio n. 8
0
        /// <summary>
        /// Create a new CfrV8Value object of type string.
        /// </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 CreateString(string value)
        {
            var call = new CfxV8ValueCreateStringRemoteCall();

            call.value = value;
            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 9
0
        /// <summary>
        /// Create a new CfrV8Value object of type array with the specified |length|.
        /// If |length| is negative the returned array will have length 0. 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 CreateArray(int length)
        {
            var call = new CfxV8ValueCreateArrayRemoteCall();

            call.length = length;
            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
        /// <summary>
        /// Returns the value with the specified identifier on success. Returns NULL if
        /// this function is called incorrectly or an exception is thrown.
        /// </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 CfrV8Value GetValue(int index)
        {
            var call = new CfxV8ValueGetValueByIndexRenderProcessCall();

            call.@this = proxyId;
            call.index = index;
            call.RequestExecution(this);
            return(CfrV8Value.Wrap(call.__retval));
        }
Esempio n. 11
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)));
        }
Esempio n. 12
0
        /// <summary>
        /// Returns the value with the specified identifier on success. Returns NULL if
        /// this function is called incorrectly or an exception is thrown.
        /// </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 CfrV8Value GetValue(int index)
        {
            var call = new CfxV8ValueGetValueByIndexRemoteCall();

            call.@this = RemotePtr.ptr;
            call.index = index;
            call.RequestExecution(RemotePtr.connection);
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 13
0
        /// <summary>
        /// Returns the value with the specified identifier on success. Returns NULL if
        /// this function is called incorrectly or an exception is thrown.
        /// </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 CfrV8Value GetValue(int index)
        {
            var call = new CfxV8ValueGetValueByIndexRenderProcessCall();

            call.self  = CfrObject.Unwrap(this);
            call.index = index;
            call.RequestExecution(this);
            return(CfrV8Value.Wrap(call.__retval));
        }
Esempio n. 14
0
        /// <summary>
        /// Returns the value with the specified identifier on success. Returns NULL if
        /// this function is called incorrectly or an exception is thrown.
        /// </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 CfrV8Value GetValue(string key)
        {
            var call = new CfxV8ValueGetValueByKeyRenderProcessCall();

            call.self = CfrObject.Unwrap(this);
            call.key  = key;
            call.RequestExecution(this);
            return(CfrV8Value.Wrap(call.__retval));
        }
Esempio n. 15
0
        /// <summary>
        /// Returns true (1) if this object is pointing to the same handle as |that|
        /// object.
        /// </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 bool IsSame(CfrV8Value that)
        {
            var call = new CfxV8ValueIsSameRenderProcessCall();

            call.self = CfrObject.Unwrap(this);
            call.that = CfrObject.Unwrap(that);
            call.RequestExecution(this);
            return(call.__retval);
        }
Esempio n. 16
0
        /// <summary>
        /// Create a new CfrV8Value object of type function. 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 CreateFunction(string name, CfrV8Handler handler)
        {
            var call = new CfxV8ValueCreateFunctionRenderProcessCall();

            call.name    = name;
            call.handler = CfrObject.Unwrap(handler);
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrV8Value.Wrap(call.__retval));
        }
Esempio n. 17
0
        /// <summary>
        /// Create a new CfrV8Value object of type function. 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 CreateFunction(string name, CfrV8Handler handler)
        {
            var call = new CfxV8ValueCreateFunctionRemoteCall();

            call.name    = name;
            call.handler = CfrObject.Unwrap(handler).ptr;
            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 18
0
        /// <summary>
        /// Returns the value with the specified identifier on success. Returns NULL if
        /// this function is called incorrectly or an exception is thrown.
        /// </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 CfrV8Value GetValue(string key)
        {
            var call = new CfxV8ValueGetValueByKeyRemoteCall();

            call.@this = RemotePtr.ptr;
            call.key   = key;
            call.RequestExecution(RemotePtr.connection);
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 19
0
        /// <summary>
        /// Returns true (1) if this object is pointing to the same handle as |that|
        /// object.
        /// </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 bool IsSame(CfrV8Value that)
        {
            var call = new CfxV8ValueIsSameRemoteCall();

            call.@this = RemotePtr.ptr;
            call.that  = CfrObject.Unwrap(that).ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
Esempio n. 20
0
        /// <summary>
        /// Associates a value with the specified identifier and returns true (1) on
        /// success. Returns false (0) if this function is called incorrectly or an
        /// exception is thrown. For read-only values this function will return true
        /// (1) even though assignment failed.
        /// </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 bool SetValue(int index, CfrV8Value value)
        {
            var call = new CfxV8ValueSetValueByIndexRenderProcessCall();

            call.self  = CfrObject.Unwrap(this);
            call.index = index;
            call.value = CfrObject.Unwrap(value);
            call.RequestExecution(this);
            return(call.__retval);
        }
Esempio n. 21
0
        /// <summary>
        /// Associates a value with the specified identifier and returns true (1) on
        /// success. Returns false (0) if this function is called incorrectly or an
        /// exception is thrown. For read-only values this function will return true
        /// (1) even though assignment failed.
        /// </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 bool SetValue(int index, CfrV8Value value)
        {
            var call = new CfxV8ValueSetValueByIndexRemoteCall();

            call.@this = RemotePtr.ptr;
            call.index = index;
            call.value = CfrObject.Unwrap(value).ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
Esempio n. 22
0
        /// <summary>
        /// Evaluates the specified JavaScript code using this context's global object.
        /// On success |retval| will be set to the return value, if any, and the
        /// function will return true (1). On failure |exception| will be set to the
        /// exception, if any, and the function will return false (0).
        /// </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 bool Eval(string code, out CfrV8Value retval, out CfrV8Exception exception)
        {
            var call = new CfxV8ContextEvalRenderProcessCall();

            call.self = CfrObject.Unwrap(this);
            call.code = code;
            call.RequestExecution(this);
            retval    = CfrV8Value.Wrap(call.retval);
            exception = CfrV8Exception.Wrap(call.exception);
            return(call.__retval);
        }
Esempio n. 23
0
        /// <summary>
        /// Associates a value with the specified identifier and returns true (1) on
        /// success. Returns false (0) if this function is called incorrectly or an
        /// exception is thrown. For read-only values this function will return true
        /// (1) even though assignment failed.
        /// </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 bool SetValue(string key, CfrV8Value value, CfxV8PropertyAttribute attribute)
        {
            var call = new CfxV8ValueSetValueByKeyRenderProcessCall();

            call.self      = CfrObject.Unwrap(this);
            call.key       = key;
            call.value     = CfrObject.Unwrap(value);
            call.attribute = (int)attribute;
            call.RequestExecution(this);
            return(call.__retval);
        }
Esempio n. 24
0
        /// <summary>
        /// Associates a value with the specified identifier and returns true (1) on
        /// success. Returns false (0) if this function is called incorrectly or an
        /// exception is thrown. For read-only values this function will return true
        /// (1) even though assignment failed.
        /// </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 bool SetValue(string key, CfrV8Value value, CfxV8PropertyAttribute attribute)
        {
            var call = new CfxV8ValueSetValueByKeyRemoteCall();

            call.@this     = RemotePtr.ptr;
            call.key       = key;
            call.value     = CfrObject.Unwrap(value).ptr;
            call.attribute = (int)attribute;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
Esempio n. 25
0
        /// <summary>
        /// Create a new CfrV8Value object of type Date. 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 CreateDate(CfrTime date)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxV8ValueCreateDateRemoteCall();

            if (!CfrObject.CheckConnection(date, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "date");
            }
            call.date = CfrObject.Unwrap(date).ptr;
            call.RequestExecution(connection);
            return(CfrV8Value.Wrap(new RemotePtr(connection, call.__retval)));
        }
Esempio n. 26
0
        /// <summary>
        /// Execute a string of JavaScript code in this V8 context. The |scriptUrl|
        /// parameter is the URL where the script in question can be found, if any. The
        /// |startLine| parameter is the base line number to use for error reporting.
        /// On success |retval| will be set to the return value, if any, and the
        /// function will return true (1). On failure |exception| will be set to the
        /// exception, if any, and the function will return false (0).
        /// </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 bool Eval(string code, string scriptUrl, int startLine, out CfrV8Value retval, out CfrV8Exception exception)
        {
            var call = new CfxV8ContextEvalRemoteCall();

            call.@this     = RemotePtr.ptr;
            call.code      = code;
            call.scriptUrl = scriptUrl;
            call.startLine = startLine;
            call.RequestExecution(RemotePtr.connection);
            retval    = CfrV8Value.Wrap(new RemotePtr(connection, call.retval));
            exception = CfrV8Exception.Wrap(new RemotePtr(connection, call.exception));
            return(call.__retval);
        }
Esempio n. 27
0
        /// <summary>
        /// Create a new CfrV8Value object of type function. 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 CreateFunction(string name, CfrV8Handler handler)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxV8ValueCreateFunctionRemoteCall();

            call.name = name;
            if (!CfrObject.CheckConnection(handler, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "handler");
            }
            call.handler = CfrObject.Unwrap(handler).ptr;
            call.RequestExecution(connection);
            return(CfrV8Value.Wrap(new RemotePtr(connection, call.__retval)));
        }
Esempio n. 28
0
        /// <summary>
        /// Returns true (1) if this object is pointing to the same handle as |that|
        /// object.
        /// </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 bool IsSame(CfrV8Value that)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxV8ValueIsSameRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(that, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "that");
            }
            call.that = CfrObject.Unwrap(that).ptr;
            call.RequestExecution(connection);
            return(call.__retval);
        }
Esempio n. 29
0
        /// <summary>
        /// Associates a value with the specified identifier and returns true (1) on
        /// success. Returns false (0) if this function is called incorrectly or an
        /// exception is thrown. For read-only values this function will return true
        /// (1) even though assignment failed.
        /// </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 bool SetValue(int index, CfrV8Value value)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxV8ValueSetValueByIndexRemoteCall();

            call.@this = RemotePtr.ptr;
            call.index = index;
            if (!CfrObject.CheckConnection(value, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "value");
            }
            call.value = CfrObject.Unwrap(value).ptr;
            call.RequestExecution(connection);
            return(call.__retval);
        }
Esempio n. 30
0
        /// <summary>
        /// Associates a value with the specified identifier and returns true (1) on
        /// success. Returns false (0) if this function is called incorrectly or an
        /// exception is thrown. For read-only values this function will return true
        /// (1) even though assignment failed.
        /// </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 bool SetValue(string key, CfrV8Value value, CfxV8PropertyAttribute attribute)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxV8ValueSetValueByKeyRemoteCall();

            call.@this = RemotePtr.ptr;
            call.key   = key;
            if (!CfrObject.CheckConnection(value, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "value");
            }
            call.value     = CfrObject.Unwrap(value).ptr;
            call.attribute = (int)attribute;
            call.RequestExecution(connection);
            return(call.__retval);
        }
Esempio n. 31
0
 /// <summary>
 /// Evaluates the specified JavaScript code using this context's global object.
 /// On success |retval| will be set to the return value, if any, and the
 /// function will return true (1). On failure |exception| will be set to the
 /// exception, if any, and the function will return false (0).
 /// </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 bool Eval(string code, out CfrV8Value retval, out CfrV8Exception exception)
 {
     var call = new CfxV8ContextEvalRenderProcessCall();
     call.self = CfrObject.Unwrap(this);
     call.code = code;
     call.RequestExecution(this);
     retval = CfrV8Value.Wrap(call.retval);
     exception = CfrV8Exception.Wrap(call.exception);
     return call.__retval;
 }
 public ChromiumFXJavascriptObject(CfrV8Value cfrV8Value) 
 {
     _CfrV8Value = cfrV8Value?? CfrV8Value.CreateUndefined();
 }