public unsafe cef_v8value_t *ExecuteFunctionWithContext(cef_v8context_t *context, cef_v8value_t * @object, UIntPtr argumentsCount, [Immutable] cef_v8value_t **arguments) { fixed(cef_v8value_t *self = &this) { return(((delegate * unmanaged[Stdcall] < cef_v8value_t *, cef_v8context_t *, cef_v8value_t *, UIntPtr, cef_v8value_t **, cef_v8value_t * >)execute_function_with_context)(self, context, @object, argumentsCount, arguments)); } }
public unsafe int IsSame(cef_v8context_t *that) { fixed(cef_v8context_t *self = &this) { return(((delegate * unmanaged[Stdcall] < cef_v8context_t *, cef_v8context_t *, int >)is_same)(self, that)); } }
public unsafe static CefV8Context Wrap(Func <IntPtr, CefV8Context> create, cef_v8context_t *instance) { if (instance == null) { return(null); } IntPtr key = new IntPtr(instance); lock (WeakRefs) { CefV8Context wrapper; foreach (WeakReference <CefV8Context> weakRef in WeakRefs) { if (weakRef.TryGetTarget(out wrapper)) { if (wrapper._instance == key || instance->IsSame(wrapper.GetNativeInstance()) != 0) { instance->@base.Release(); return(wrapper); } } } wrapper = CefBaseRefCounted <cef_v8context_t> .Wrap(create, instance); WeakRefs.Add(wrapper.WeakRef); return(wrapper); } }
private CefV8Context(cef_v8context_t *ptr) { if (ptr == null) { throw new ArgumentNullException("ptr"); } _self = ptr; }
internal static CefV8Context FromNativeOrNull(cef_v8context_t *ptr) { if (ptr == null) { return(null); } return(new CefV8Context(ptr)); }
public void Dispose() { if (_self != null) { Release(); _self = null; } GC.SuppressFinalize(this); }
public void Dispose() { if (_self != null) { Release(); _self = null; } GC.SuppressFinalize(this); }
static public CefV8Context GetCurrent() { cef_v8context_t *ctx = cef_v8context_get_current_context(); if (ctx == null) { return(null); } //TODO:find all cases need FromOutVal return(CefV8Context.FromOutVal(ctx)); }
public static cef_v8value_t *get_global(cef_v8context_t *self) { get_global_delegate d; var p = self->_get_global; if (p == _p8) { d = _d8; } else { d = (get_global_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_global_delegate)); if (_p8 == IntPtr.Zero) { _d8 = d; _p8 = p; } } return(d(self)); }
public static cef_frame_t *get_frame(cef_v8context_t *self) { get_frame_delegate d; var p = self->_get_frame; if (p == _p7) { d = _d7; } else { d = (get_frame_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_frame_delegate)); if (_p7 == IntPtr.Zero) { _d7 = d; _p7 = p; } } return(d(self)); }
public static cef_browser_t *get_browser(cef_v8context_t *self) { get_browser_delegate d; var p = self->_get_browser; if (p == _p6) { d = _d6; } else { d = (get_browser_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_browser_delegate)); if (_p6 == IntPtr.Zero) { _d6 = d; _p6 = p; } } return(d(self)); }
public static int is_valid(cef_v8context_t *self) { is_valid_delegate d; var p = self->_is_valid; if (p == _p5) { d = _d5; } else { d = (is_valid_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_valid_delegate)); if (_p5 == IntPtr.Zero) { _d5 = d; _p5 = p; } } return(d(self)); }
public static int has_at_least_one_ref(cef_v8context_t *self) { has_at_least_one_ref_delegate d; var p = self->_base._has_at_least_one_ref; if (p == _p3) { d = _d3; } else { d = (has_at_least_one_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_at_least_one_ref_delegate)); if (_p3 == IntPtr.Zero) { _d3 = d; _p3 = p; } } return(d(self)); }
public static int release(cef_v8context_t *self) { release_delegate d; var p = self->_base._release; if (p == _p1) { d = _d1; } else { d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate)); if (_p1 == IntPtr.Zero) { _d1 = d; _p1 = p; } } return(d(self)); }
public static int eval(cef_v8context_t *self, cef_string_t *code, cef_string_t *script_url, int start_line, cef_v8value_t **retval, cef_v8exception_t **exception) { eval_delegate d; var p = self->_eval; if (p == _pc) { d = _dc; } else { d = (eval_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(eval_delegate)); if (_pc == IntPtr.Zero) { _dc = d; _pc = p; } } return(d(self, code, script_url, start_line, retval, exception)); }
public static int exit(cef_v8context_t *self) { exit_delegate d; var p = self->_exit; if (p == _pa) { d = _da; } else { d = (exit_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(exit_delegate)); if (_pa == IntPtr.Zero) { _da = d; _pa = p; } } return(d(self)); }
public static int get_refct(cef_v8context_t *self) { get_refct_delegate d; var p = self->_base._get_refct; if (p == _p2) { d = _d2; } else { d = (get_refct_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_refct_delegate)); if (_p2 == IntPtr.Zero) { _d2 = d; _p2 = p; } } return(d(self)); }
public static int is_same(cef_v8context_t *self, cef_v8context_t *that) { is_same_delegate d; var p = self->_is_same; if (p == _pb) { d = _db; } else { d = (is_same_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_same_delegate)); if (_pb == IntPtr.Zero) { _db = d; _pb = p; } } return(d(self, that)); }
public static void add_ref(cef_v8context_t *self) { add_ref_delegate d; var p = self->_base._add_ref; if (p == _p0) { d = _d0; } else { d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate)); if (_p0 == IntPtr.Zero) { _d0 = d; _p0 = p; } } d(self); }
public static int enter(cef_v8context_t *self) { enter_delegate d; var p = self->_enter; if (p == _p9) { d = _d9; } else { d = (enter_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(enter_delegate)); if (_p9 == IntPtr.Zero) { _d9 = d; _p9 = p; } } return(d(self)); }
public unsafe extern cef_v8value_t *ExecuteFunctionWithContext(cef_v8context_t *context, cef_v8value_t * @object, UIntPtr argumentsCount, [Immutable] cef_v8value_t **arguments);
public unsafe extern void OnContextReleased(cef_browser_t *browser, cef_frame_t *frame, cef_v8context_t *context);
public unsafe extern void OnUncaughtException(cef_browser_t *browser, cef_frame_t *frame, cef_v8context_t *context, cef_v8exception_t *exception, cef_v8stack_trace_t *stackTrace);
private void on_context_released(cef_render_process_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_v8context_t *context) { CheckSelf(self); var m_browser = CefBrowser.FromNative(browser); var m_frame = CefFrame.FromNative(frame); var m_context = CefV8Context.FromNative(context); OnContextReleased(m_browser, m_frame, m_context); }
private void on_uncaught_exception(cef_render_process_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_v8context_t *context, cef_v8exception_t *exception, cef_v8stack_trace_t *stackTrace) { CheckSelf(self); var mBrowser = CefBrowser.FromNative(browser); var mFrame = CefFrame.FromNative(frame); var mContext = CefV8Context.FromNative(context); var mException = CefV8Exception.FromNative(exception); var mStackTrace = CefV8StackTrace.FromNative(stackTrace); OnUncaughtException(mBrowser, mFrame, mContext, mException, mStackTrace); }
/// <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 abstract void OnContextReleased(cef_browser_t* browser, cef_frame_t* frame, cef_v8context_t* context); private void on_uncaught_exception(cef_render_process_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_v8context_t *context, cef_v8exception_t *exception, cef_v8stack_trace_t *stackTrace) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefRenderProcessHandler.OnUncaughtException }
/// <summary> /// Called before browser navigation. Return true to cancel the navigation or /// false to allow the navigation to proceed. The |request| object cannot be /// modified in this callback. /// </summary> // protected abstract int OnBeforeNavigation(cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, CefNavigationType navigation_type, int is_redirect); private void on_context_created(cef_render_process_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_v8context_t *context) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefRenderProcessHandler.OnContextCreated }
private CefV8Context(cef_v8context_t* ptr) { if (ptr == null) throw new ArgumentNullException("ptr"); _self = ptr; }
internal static CefV8Context FromNativeOrNull(cef_v8context_t* ptr) { if (ptr == null) return null; return new CefV8Context(ptr); }
internal static CefV8Context FromNative(cef_v8context_t* ptr) { return new CefV8Context(ptr); }
public static cef_v8value_t *execute_function_with_context(cef_v8value_t *self, cef_v8context_t *context, cef_v8value_t * @object, UIntPtr argumentsCount, cef_v8value_t **arguments) { execute_function_with_context_delegate d; var p = self->_execute_function_with_context; if (p == _p2e) { d = _d2e; } else { d = (execute_function_with_context_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(execute_function_with_context_delegate)); if (_p2e == IntPtr.Zero) { _d2e = d; _p2e = p; } } return(d(self, context, @object, argumentsCount, arguments)); }
public CefV8Context(cef_v8context_t *instance) : base((cef_base_ref_counted_t *)instance) { }