/// <summary> /// Creates a new context object that shares storage with |other| and uses an /// optional |handler|. /// </summary> public static CefRequestContext CreateContext(CefRequestContext other, CefRequestContextHandler handler) { return(CefRequestContext.FromNative( cef_request_context_t.create_context( other.ToNative(), handler != null ? handler.ToNative() : null ) )); }
internal static CefRequestContextHandler FromNativeOrNull(cef_request_context_handler_t *ptr) { CefRequestContextHandler value = null; bool found; lock (_roots) { found = _roots.TryGetValue((IntPtr)ptr, out value); } return(found ? value : null); }
/// <summary> /// Creates a new context object with the specified |settings| and optional /// |handler|. /// </summary> public static CefRequestContext CreateContext(CefRequestContextSettings settings, CefRequestContextHandler handler) { var n_settings = settings.ToNative(); var result = CefRequestContext.FromNative( cef_request_context_t.create_context( n_settings, handler != null ? handler.ToNative() : null ) ); CefRequestContextSettings.Free(n_settings); return(result); }
/// <summary> /// Returns the handler for this context if any. /// </summary> public CefRequestContextHandler GetHandler() { return(CefRequestContextHandler.FromNativeOrNull( cef_request_context_t.get_handler(_self) )); }