pub struct CreateContextParams {Show 13 fields
pub service_directory: Option<ClientEnd<DirectoryMarker>>,
pub data_directory: Option<ClientEnd<DirectoryMarker>>,
pub user_agent_product: Option<String>,
pub user_agent_version: Option<String>,
pub remote_debugging_port: Option<u16>,
pub content_directories: Option<Vec<ContentDirectoryProvider>>,
pub features: Option<ContextFeatureFlags>,
pub playready_key_system: Option<String>,
pub unsafely_treat_insecure_origins_as_secure: Option<Vec<String>>,
pub cors_exempt_headers: Option<Vec<Vec<u8>>>,
pub cdm_data_directory: Option<ClientEnd<DirectoryMarker>>,
pub cdm_data_quota_bytes: Option<u64>,
pub data_quota_bytes: Option<u64>,
/* private fields */
}Expand description
Parameters specifying the configuration for a new [Context].
Fields§
§service_directory: Option<ClientEnd<DirectoryMarker>>Service directory to be used by the context.
The following services must be present in the service directory:
- [
fuchsia.buildinfo/Provider] - [
fuchsia.device/NameProvider] - [
fuchsia.fonts/Provider] - [
fuchsia.hwinfo.Product] - [
fuchsia.intl/PropertyProvider] - [
fuchsia.kernel/VmexResource] (unless [ContextFeatureFlags.DISABLE_DYNAMIC_CODE_GENERATION] is set) - [
fuchsia.logger/LogSink] - [
fuchsia.memorypressure/Provider] - [
fuchsia.process/Launcher] - [
fuchsia.sysmem/Allocator]
The following services are recommended to be present in order to allow CPU scheduling profiles to be applied to threads to tune their performance, especially for media rendering.
- [
fuchsia.media.ProfileProvider] (requirement will be removed in 2025) - [
fuchsia.scheduler.RoleManager]
The following services must be present in order to render web content in a Scenic view
using [Frame.CreateView], [Frame.CreateViewWithViewRef] or [Frame.CreateView2]]:
- [
fuchsia.accessibility.semantics/SemanticsManager] - [
fuchsia.ui.composition/Allocator] - [
fuchsia.ui.composition/Flatland] - [
fuchsia.ui.scenic/Scenic]
The following service must be present in order to collect diagnostic tracing data.
- [
fuchsia.tracing.perfetto.ProducerConnector]
data_directory: Option<ClientEnd<DirectoryMarker>>Handle to the directory that will contain the [Context]’s persistent data. If it is left
unset, then the created [Context] will be stateless, with all of its data discarded upon
[Context] destruction.
If set, data_directory must not be shared with any other [Context].
user_agent_product: Option<String>Optional string describing the embedding product to append to the User-Agent string.
See the specification for the
HTTP User-Agent header.
Requires that user_agent_version is also specified.
user_agent_version: Option<String>Optional version for the embedding product to append to the User-Agent string.
Requires that user_agent_product is also specified.
remote_debugging_port: Option<u16>Enables Frames to be created with remote debugging enabled using the DevTools protocol. If
port is 0, then an ephemeral port will be used, which can be queried via the
[Context.GetRemoteDebuggingPort] API.
Because remote debugging uses TCP, it is not valid to set a remote
debugging port without having also set [ContextFeatureFlags.NETWORK]
for the context.
content_directories: Option<Vec<ContentDirectoryProvider>>List of providers whose contents will be served by fuchsia-dir:// URLs.
features: Option<ContextFeatureFlags>Optional features that should be enabled for this context. Some features may also require
additional services in service_directory.
playready_key_system: Option<String>Enables PlayReady CDM for the Context using the specified string as a key system string. The string should be a reverse domain name, as required by EME API.
- Requires [
fuchsia.media.drm/PlayReady] service. - Requires that a
cdm_data_directorybe specified inCreateContextParams.
unsafely_treat_insecure_origins_as_secure: Option<Vec<String>>Treat given insecure origins as secure origins. For the definition of secure contexts, see Secure Contexts and origin trustworthiness.
Example value: {"http://a.com", "http://b.com"}.
cors_exempt_headers: Option<Vec<Vec<u8>>>Specifies a set of header names for which Cross-Origin Resource Sharing (CORS) checks should not be enforced.
cdm_data_directory: Option<ClientEnd<DirectoryMarker>>Specifies the storage to use to persistent content licensing related data (e.g.
provisioning data, persistent session data). By default these data will be placed under the
data_directory, if specified.
If neither data_directory nor cdm_data_directory are specified, then content licensing
features requiring persistent storage (e.g. persistent licensing sessions) will not be
available to the [Context].
Note that not all content licensing systems support persistent sessions, regardless of whether persistent storage is provided.
cdm_data_quota_bytes: Option<u64>Specifies a target maximum size for cdm_data_directory contents, in bytes. If the amount
of persisted CDM data exceeds this threshold, then the [Context] will attempt to purge
some data to meet the specified quota.
data_quota_bytes: Option<u64>Specifies a target maximum size for data_directory contents, in bytes.
The [Context] will attempt to limit browsing state (e.g. cookies, LocalStorage) to
not exceed the specified size.
Trait Implementations§
Source§impl Debug for CreateContextParams
impl Debug for CreateContextParams
Source§impl Decode<CreateContextParams, DefaultFuchsiaResourceDialect> for CreateContextParams
impl Decode<CreateContextParams, DefaultFuchsiaResourceDialect> for CreateContextParams
Source§impl Default for CreateContextParams
impl Default for CreateContextParams
Source§fn default() -> CreateContextParams
fn default() -> CreateContextParams
Source§impl PartialEq for CreateContextParams
impl PartialEq for CreateContextParams
Source§impl ResourceTypeMarker for CreateContextParams
impl ResourceTypeMarker for CreateContextParams
Source§type Borrowed<'a> = &'a mut CreateContextParams
type Borrowed<'a> = &'a mut CreateContextParams
Encode<Self>
type cheaply obtainable from &mut Self::Owned. There are three cases: Read moreSource§fn take_or_borrow<'a>(
value: &'a mut <Self as TypeMarker>::Owned,
) -> Self::Borrowed<'a>
fn take_or_borrow<'a>( value: &'a mut <Self as TypeMarker>::Owned, ) -> Self::Borrowed<'a>
&mut Self::Owned to Self::Borrowed. For
HandleBased types this is “take” (it returns an owned handle and
replaces value with Handle::invalid), and for all other types it is
“borrow” (just converts from one reference to another).Source§impl TypeMarker for CreateContextParams
impl TypeMarker for CreateContextParams
Source§type Owned = CreateContextParams
type Owned = CreateContextParams
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.