cef_request_context_t

A request context provides request handling for a set of related browser or URL request objects. A request context can be specified when creating a new browser via the cef_browser_host_t static factory functions or when creating a new URL request via the cef_urlrequest_t static factory functions. Browser objects with different request contexts will never be hosted in the same render process. Browser objects with the same request context may or may not be hosted in the same render process depending on the process model. Browser objects created indirectly via the JavaScript window.open function or targeted links will share the same render process and the same request context as the source browser. When running in single-process mode there is only a single render process (the main process) and so all browsers created in single-process mode will share the same request context. This will be the first request context passed into a cef_browser_host_t static factory function and all other request context objects will be ignored.

version(cef && embedded_cef_bindings)
extern (C)
struct cef_request_context_t {
extern (System)
int function(cef_request_context_t* self, cef_request_context_t* other) nothrow is_same;
extern (System)
int function(cef_request_context_t* self, cef_request_context_t* other) nothrow is_sharing_with;
extern (System)
int function(cef_request_context_t* self) nothrow is_global;
extern (System)
cef_request_context_handler_t* function(cef_request_context_t* self) nothrow get_handler;
extern (System)
cef_string_userfree_t function(cef_request_context_t* self) nothrow get_cache_path;
extern (System)
cef_cookie_manager_t* function(cef_request_context_t* self, cef_completion_callback_t* callback) nothrow get_cookie_manager;
}

Members

Variables

base
cef_preference_manager_t base;

Base structure.

clear_certificate_exceptions
void function(cef_request_context_t* self, cef_completion_callback_t* callback) nothrow clear_certificate_exceptions;

Clears all certificate exceptions that were added as part of handling

clear_http_auth_credentials
void function(cef_request_context_t* self, cef_completion_callback_t* callback) nothrow clear_http_auth_credentials;

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.

clear_scheme_handler_factories
int function(cef_request_context_t* self) nothrow clear_scheme_handler_factories;

Clear all registered scheme handler factories. Returns false (0) on error. This function may be called on any thread in the browser process.

close_all_connections
void function(cef_request_context_t* self, cef_completion_callback_t* callback) nothrow close_all_connections;

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.

did_load_extension
int function(cef_request_context_t* self, const(cef_string_t)* extension_id) nothrow did_load_extension;

Returns true (1) if this context was used to load the extension identified by |extension_id|. Other contexts sharing the same storage will also have access to the extension (see HasExtension). This function must be called on the browser process UI thread.

get_chrome_color_scheme_color
cef_color_t function(cef_request_context_t* self) nothrow get_chrome_color_scheme_color;

Returns the current Chrome color scheme color, or transparent (0) for the default color. Must be called on the browser process UI thread.

get_chrome_color_scheme_mode
cef_color_variant_t function(cef_request_context_t* self) nothrow get_chrome_color_scheme_mode;

Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must be called on the browser process UI thread.

get_chrome_color_scheme_variant
cef_color_variant_t function(cef_request_context_t* self) nothrow get_chrome_color_scheme_variant;

Returns the current Chrome color scheme variant. Must be called on the browser process UI thread.

get_content_setting
cef_content_setting_values_t function(cef_request_context_t* self, const(cef_string_t)* requesting_url, const(cef_string_t)* top_level_url, cef_content_setting_types_t content_type) nothrow get_content_setting;

Returns the current value for |content_type| that applies for the specified URLs. If both URLs are NULL the default value will be returned. Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must be called on the browser process UI thread.

get_extension
cef_extension_t* function(cef_request_context_t* self, const(cef_string_t)* extension_id) nothrow get_extension;

Returns the extension matching |extension_id| or NULL if no matching extension is accessible in this context (see HasExtension). This function must be called on the browser process UI thread.

get_extensions
int function(cef_request_context_t* self, cef_string_list_t extension_ids) nothrow get_extensions;

Retrieve the list of all extensions that this context has access to (see HasExtension). |extension_ids| will be populated with the list of extension ID values. Returns true (1) on success. This function must be called on the browser process UI thread.

get_media_router
cef_media_router_t* function(cef_request_context_t* self, cef_completion_callback_t* callback) nothrow get_media_router;

Returns the MediaRouter object associated with this context. If |callback| is non-NULL it will be executed asnychronously on the UI thread after the manager's context has been initialized.

get_website_setting
cef_value_t* function(cef_request_context_t* self, const(cef_string_t)* requesting_url, const(cef_string_t)* top_level_url, cef_content_setting_types_t content_type) nothrow get_website_setting;

Returns the current value for |content_type| that applies for the specified URLs. If both URLs are NULL the default value will be returned. Returns nullptr if no value is configured. Must be called on the browser process UI thread.

has_extension
int function(cef_request_context_t* self, const(cef_string_t)* extension_id) nothrow has_extension;

Returns true (1) if this context has access to the extension identified by |extension_id|. This may not be the context that was used to load the extension (see DidLoadExtension). This function must be called on the browser process UI thread.

load_extension
void function(cef_request_context_t* self, const(cef_string_t)* root_directory, cef_dictionary_value_t* manifest, cef_extension_handler_t* handler) nothrow load_extension;

Load an extension.

register_scheme_handler_factory
int function(cef_request_context_t* self, const(cef_string_t)* scheme_name, const(cef_string_t)* domain_name, cef_scheme_handler_factory_t* factory) nothrow register_scheme_handler_factory;

will cause the factory to match all domain names. The |domain_name| value will be ignored for non-standard schemes. If |scheme_name| is a built-in scheme and no handler is returned by |factory| then the built-in scheme handler factory will be called. If |scheme_name| is a custom scheme then you must also implement the cef_app_t::on_register_custom_schemes() function in all processes. This function may be called multiple times to change or remove the factory that matches the specified |scheme_name| and optional |domain_name|. Returns false (0) if an error occurs. This function may be called on any thread in the browser process.

resolve_host
void function(cef_request_context_t* self, const(cef_string_t)* origin, cef_resolve_callback_t* callback) nothrow resolve_host;

Attempts to resolve |origin| to a list of associated IP addresses. |callback| will be executed on the UI thread after completion.

set_chrome_color_scheme
void function(cef_request_context_t* self, cef_color_variant_t variant, cef_color_t user_color) nothrow set_chrome_color_scheme;

Sets the Chrome color scheme for all browsers that share this request context. |variant| values of SYSTEM, LIGHT and DARK change the underlying color mode (e.g. light vs dark). Other |variant| values determine how |user_color| will be applied in the current color mode. If |user_color| is transparent (0) the default color will be used.

set_content_setting
void function(cef_request_context_t* self, const(cef_string_t)* requesting_url, const(cef_string_t)* top_level_url, cef_content_setting_types_t content_type, cef_content_setting_values_t value) nothrow set_content_setting;

Sets the current value for |content_type| for the specified URLs in the default scope. If both URLs are NULL, and the context is not incognito, the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for |value| to use the default value for this content type.

set_website_setting
void function(cef_request_context_t* self, const(cef_string_t)* requesting_url, const(cef_string_t)* top_level_url, cef_content_setting_types_t content_type, cef_value_t* value) nothrow set_website_setting;

Sets the current value for |content_type| for the specified URLs in the default scope. If both URLs are NULL, and the context is not incognito, the default value will be set. Pass nullptr for |value| to remove the default value for this content type.

Meta