/// <summary> /// Start tracing events on all processes. Tracing is initialized asynchronously /// and |callback| will be executed on the UI thread after initialization is /// complete. /// If CfxBeginTracing was called previously, or if a CfxEndTracingAsync call is /// pending, CfxBeginTracing will fail and return false (0). /// |categories| is a comma-delimited list of category wildcards. A category can /// have an optional '-' prefix to make it an excluded category. Having both /// included and excluded categories in the same list is not supported. /// Example: "test_MyTest*" Example: "test_MyTest*,test_OtherStuff" Example: /// "-excluded_category1,-excluded_category2" /// This function must be called on the browser process UI thread. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_trace_capi.h">cef/include/capi/cef_trace_capi.h</see>. /// </remarks> public static bool BeginTracing(string categories, CfxCompletionCallback callback) { var categories_pinned = new PinnedString(categories); var __retval = CfxApi.cfx_begin_tracing(categories_pinned.Obj.PinnedPtr, categories_pinned.Length, CfxCompletionCallback.Unwrap(callback)); categories_pinned.Obj.Free(); return(0 != __retval); }
/// <summary> /// Set the schemes supported by this manager. The default schemes ("http", /// "https", "ws" and "wss") will always be supported. If |callback| is non- /// NULL it will be executed asnychronously on the IO thread after the change /// has been applied. Must be called before any cookies are accessed. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_cookie_capi.h">cef/include/capi/cef_cookie_capi.h</see>. /// </remarks> public void SetSupportedSchemes(System.Collections.Generic.List <string> schemes, CfxCompletionCallback callback) { PinnedString[] schemes_handles; var schemes_unwrapped = StringFunctions.UnwrapCfxStringList(schemes, out schemes_handles); CfxApi.CookieManager.cfx_cookie_manager_set_supported_schemes(NativePtr, schemes_unwrapped, CfxCompletionCallback.Unwrap(callback)); StringFunctions.FreePinnedStrings(schemes_handles); StringFunctions.CfxStringListCopyToManaged(schemes_unwrapped, schemes); CfxApi.Runtime.cfx_string_list_free(schemes_unwrapped); }
/// <summary> /// Returns the default cookie manager for this object. This will be the global /// cookie manager if this object is the global request context. Otherwise, /// this will be the default cookie manager used when this request context does /// not receive a value via CfxRequestContextHandler.GetCookieManager(). /// If |callback| is non-NULL it will be executed asnychronously on the IO /// thread after the manager's storage has been initialized. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_context_capi.h">cef/include/capi/cef_request_context_capi.h</see>. /// </remarks> public CfxCookieManager GetDefaultCookieManager(CfxCompletionCallback callback) { return(CfxCookieManager.Wrap(CfxApi.cfx_request_context_get_default_cookie_manager(NativePtr, CfxCompletionCallback.Unwrap(callback)))); }
/// <summary> /// Returns the global cookie manager. By default data will be stored at /// CfxSettings.CachePath if specified or in memory otherwise. If |callback| is /// non-NULL it will be executed asnychronously on the IO thread after the /// manager's storage has been initialized. Using this function is equivalent to /// calling CfxRequestContext.CfxRequestContextGetGlobalContext()->get_d /// efault_cookie_manager(). /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_cookie_capi.h">cef/include/capi/cef_cookie_capi.h</see>. /// </remarks> public static CfxCookieManager GetGlobalManager(CfxCompletionCallback callback) { return(CfxCookieManager.Wrap(CfxApi.CookieManager.cfx_cookie_manager_get_global_manager(CfxCompletionCallback.Unwrap(callback)))); }
/// <summary> /// Creates a new cookie manager. If |path| is NULL data will be stored in memory /// only. Otherwise, data will be stored at the specified |path|. To persist /// session cookies (cookies without an expiry date or validity interval) set /// |persistSessionCookies| to true (1). Session cookies are generally intended /// to be transient and most Web browsers do not persist them. If |callback| is /// non-NULL it will be executed asnychronously on the IO thread after the /// manager's storage has been initialized. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_cookie_capi.h">cef/include/capi/cef_cookie_capi.h</see>. /// </remarks> public static CfxCookieManager CreateManager(string path, bool persistSessionCookies, CfxCompletionCallback callback) { var path_pinned = new PinnedString(path); var __retval = CfxApi.CookieManager.cfx_cookie_manager_create_manager(path_pinned.Obj.PinnedPtr, path_pinned.Length, persistSessionCookies ? 1 : 0, CfxCompletionCallback.Unwrap(callback)); path_pinned.Obj.Free(); return(CfxCookieManager.Wrap(__retval)); }
/// <summary> /// Flush the backing store (if any) to disk. If |callback| is non-NULL it will /// be executed asnychronously on the IO thread after the flush is complete. /// Returns false (0) if cookies cannot be accessed. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_cookie_capi.h">cef/include/capi/cef_cookie_capi.h</see>. /// </remarks> public bool FlushStore(CfxCompletionCallback callback) { return(0 != CfxApi.CookieManager.cfx_cookie_manager_flush_store(NativePtr, CfxCompletionCallback.Unwrap(callback))); }
/// <summary> /// Sets the directory path that will be used for storing cookie data. If /// |path| is NULL data will be stored in memory only. Otherwise, data will be /// stored at the specified |path|. To persist session cookies (cookies without /// an expiry date or validity interval) set |persistSessionCookies| to true /// (1). Session cookies are generally intended to be transient and most Web /// browsers do not persist them. If |callback| is non-NULL it will be executed /// asnychronously on the IO thread after the manager's storage has been /// initialized. Returns false (0) if cookies cannot be accessed. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_cookie_capi.h">cef/include/capi/cef_cookie_capi.h</see>. /// </remarks> public bool SetStoragePath(string path, bool persistSessionCookies, CfxCompletionCallback callback) { var path_pinned = new PinnedString(path); var __retval = CfxApi.CookieManager.cfx_cookie_manager_set_storage_path(NativePtr, path_pinned.Obj.PinnedPtr, path_pinned.Length, persistSessionCookies ? 1 : 0, CfxCompletionCallback.Unwrap(callback)); path_pinned.Obj.Free(); return(0 != __retval); }
/// <summary> /// Clears all active and idle connections that Chromium currently has. This is /// only recommended if you have released all other CEF objects but don't yet /// want to call cef_shutdown(). If |callback| is non-NULL it will be executed /// on the UI thread after completion. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_context_capi.h">cef/include/capi/cef_request_context_capi.h</see>. /// </remarks> public void CloseAllConnections(CfxCompletionCallback callback) { CfxApi.RequestContext.cfx_request_context_close_all_connections(NativePtr, CfxCompletionCallback.Unwrap(callback)); }
/// <summary> /// Clears all certificate exceptions that were added as part of handling /// CfxRequestHandler.OnCertificateError(). If you call this it is /// recommended that you also call close_all_connections() or you risk not /// being prompted again for server certificates if you reconnect quickly. If /// |callback| is non-NULL it will be executed on the UI thread after /// completion. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_context_capi.h">cef/include/capi/cef_request_context_capi.h</see>. /// </remarks> public void ClearCertificateExceptions(CfxCompletionCallback callback) { CfxApi.RequestContext.cfx_request_context_clear_certificate_exceptions(NativePtr, CfxCompletionCallback.Unwrap(callback)); }
/// <summary> /// Clears all HTTP authentication credentials that were added as part of /// handling GetAuthCredentials. If |callback| is non-NULL it will be executed /// on the UI thread after completion. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_context_capi.h">cef/include/capi/cef_request_context_capi.h</see>. /// </remarks> public void ClearHttpAuthCredentials(CfxCompletionCallback callback) { CfxApi.RequestContext.cfx_request_context_clear_http_auth_credentials(NativePtr, CfxCompletionCallback.Unwrap(callback)); }