/// <summary> /// Execute the function using the specified V8 context. |object| is the /// receiver ('this' object) of the function. If |object| is empty 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 method is called incorrectly or an /// exception is thrown. /// </summary> public CefV8Value ExecuteFunctionWithContext(CefV8Context context, CefV8Value obj, CefV8Value[] arguments) { ThrowIfObjectIsInvalid(); var n_arguments = CreateArgumentsArray(arguments); fixed(cef_v8value_t **n_arguments_ptr = n_arguments) { return(CefV8Value.FromOrDefault( cef_v8value_t.invoke_execute_function_with_context( this.ptr, context.GetNativePointerAndAddRef(), obj.GetNativePointerAndAddRef(), n_arguments != null ? n_arguments.Length : 0, n_arguments_ptr ) )); } }
/// <summary> /// Execute the function using the specified V8 context. |object| is the /// receiver ('this' object) of the function. If |object| is empty 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 method is called incorrectly or an /// exception is thrown. /// </summary> public CefV8Value ExecuteFunctionWithContext(CefV8Context context, CefV8Value obj, CefV8Value[] arguments) { ThrowIfObjectIsInvalid(); var n_arguments = CreateArgumentsArray(arguments); fixed (cef_v8value_t** n_arguments_ptr = n_arguments) { return CefV8Value.FromOrDefault( cef_v8value_t.invoke_execute_function_with_context( this.ptr, context.GetNativePointerAndAddRef(), obj.GetNativePointerAndAddRef(), n_arguments != null ? n_arguments.Length : 0, n_arguments_ptr ) ); } }
/// <summary> /// Called for global uncaught exceptions. Execution of this callback is /// disabled by default. To enable set /// CefSettings.uncaught_exception_stack_size > 0. /// </summary> protected abstract void OnUncaughtException(CefBrowser browser, CefFrame frame, CefV8Context context, CefV8Exception exception, CefV8StackTrace stackTrace);
/// <summary> /// Returns true if this object is pointing to the same handle as |that| /// object. /// </summary> public bool IsSame(CefV8Context that) { return cef_v8context_t.invoke_is_same(this.ptr, that.ptr) != 0; }
/// <summary> /// Called immediately before the V8 context for a frame is released. No /// references to the context should be kept after this function is /// called. /// </summary> protected abstract void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context);
/// <summary> /// Returns true if this object is pointing to the same handle as |that| /// object. /// </summary> public bool IsSame(CefV8Context that) { return(cef_v8context_t.invoke_is_same(this.ptr, that.ptr) != 0); }
/// <summary> /// Returns the entered (bottom) context object in the V8 context stack. /// </summary> public static CefV8Context GetEnteredContext() { return(CefV8Context.From( NativeMethods.cef_v8context_get_entered_context() )); }
/// <summary> /// Returns the current (top) context object in the V8 context stack. /// </summary> public static CefV8Context GetCurrentContext() { return(CefV8Context.From( NativeMethods.cef_v8context_get_current_context() )); }
/// <summary> /// Called for global uncaught exceptions. Execution of this callback is /// disabled by default. To enable set /// CefSettings.uncaught_exception_stack_size > 0. /// </summary> protected abstract void OnUncaughtException(CefBrowser browser, CefFrame frame, CefV8Context context, CefV8Exception exception, CefV8StackTrace stackTrace);
/// <summary> /// Called immediately before the V8 context for a frame is released. No /// references to the context should be kept after this function is /// called. /// </summary> protected abstract void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context);