internal void Associate(CefBrowser browser, CefFrame frame, CefV8Context context) { var webView = new CefV8_WebView(context,context.GetTaskRunner()); var taskCompletionSource = _TaskCompletionSources.GetOrDefault(frame.Identifier); if (taskCompletionSource!=null) { _TaskCompletionSources.Remove(frame.Identifier); taskCompletionSource.TrySetResult(webView); } _Associated.Add(frame.Identifier, webView); }
/// <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) { var n_arguments = CreateArguments(arguments); cef_v8value_t *n_retval; fixed(cef_v8value_t **n_arguments_ptr = n_arguments) { n_retval = cef_v8value_t.execute_function_with_context( _self, context.ToNative(), obj != null ? obj.ToNative() : null, n_arguments != null ? (UIntPtr)n_arguments.Length : UIntPtr.Zero, n_arguments_ptr ); } return(CefV8Value.FromNativeOrNull(n_retval)); }
/// <summary> /// Called for global uncaught exceptions in a frame. Execution of this /// callback is disabled by default. To enable set /// CefSettings.uncaught_exception_stack_size > 0. /// </summary> protected virtual 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 method is called. /// </summary> protected virtual void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context) { }
protected override void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context) { _MVVMCefApp.Reset(frame); }
protected override void OnContextCreated(CefBrowser browser, CefFrame frame, CefV8Context context) { _MVVMCefApp.Associate(browser, frame, context); }
/// <summary> /// Called immediately before the V8 context for a frame is released. No /// references to the context should be kept after this method is called. /// </summary> protected virtual void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context) { }
/// <summary> /// Called for global uncaught exceptions in a frame. Execution of this /// callback is disabled by default. To enable set /// CefSettings.uncaught_exception_stack_size > 0. /// </summary> protected virtual 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) { if (that == null) return false; return cef_v8context_t.is_same(_self, that.ToNative()) != 0; }
/// <summary> /// Returns true if this object is pointing to the same handle as |that| /// object. /// </summary> public bool IsSame(CefV8Context that) { if (that == null) return false; return cef_v8context_t.is_same(_self, that.ToNative()) != 0; }
internal void Associate(CefBrowser browser, CefFrame frame, CefV8Context context) { _Associated.Add(frame.Identifier, new CefV8_WebView(context, context.GetTaskRunner())); }
/// <summary> /// Returns the entered (bottom) context object in the V8 context stack. /// </summary> public static CefV8Context GetEnteredContext() { return(CefV8Context.FromNative( cef_v8context_t.get_entered_context() )); }
/// <summary> /// Returns the current (top) context object in the V8 context stack. /// </summary> public static CefV8Context GetCurrentContext() { return(CefV8Context.FromNative( cef_v8context_t.get_current_context() )); }
/// <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) { var n_arguments = CreateArguments(arguments); cef_v8value_t* n_retval; fixed (cef_v8value_t** n_arguments_ptr = n_arguments) { n_retval = cef_v8value_t.execute_function_with_context( _self, context.ToNative(), obj != null ? obj.ToNative() : null, n_arguments != null ? (UIntPtr)n_arguments.Length : UIntPtr.Zero, n_arguments_ptr ); } return CefV8Value.FromNativeOrNull(n_retval); }
protected override void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context) { MessageRouter.OnContextReleased(browser, frame, context); }
protected override void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context) { Debug.WriteLine(DBGPREFIX + "OnContextReleased called"); _messageRouter.OnContextReleased(browser, frame, context); }
public TestCefGlueWindow(CefFrame iFrame, CefV8CompleteContext iContext) { _CefFrame = iFrame; _CefV8Context = iContext.Context; }