- virtual bool BasicStartupComplete(int* exit_code);
- virtual void PreSandboxStartup() {}
- virtual void SandboxInitialized(const std::string& process_type) {}
- virtual void PreBrowserMain() {}
- virtual ContentBrowserClient* CreateContentBrowserClient();
- virtual ContentGpuClient* CreateContentGpuClient();
- virtual ContentRendererClient* CreateContentRendererClient();
- virtual ContentUtilityClient* CreateContentUtilityClient();
- virtual absl::variant
RunProcess( const std::string& process_type, MainFunctionParams main_function_params); - virtual bool ShouldCreateFeatureList();
- virtual bool ShouldLockSchemeRegistry();
virtual bool BasicStartupComplete(int* exit_code);
Tells the embedder that the absolute basic startup has been done, i.e. it’s now safe to create singletons and check the command line. Return true if the process should exit afterwards, and if so, |exit_code| should be set. This is the place for embedder to do the things that must happen at the start. Most of its startup code should be in the methods below.
virtual void PreSandboxStartup() {}
This is where the embedder puts all of its startup code that needs to run before the sandbox is engaged.
virtual void SandboxInitialized(const std::string& process_type) {}
This is where the embedder can add startup code to run after the sandbox has been initialized.
virtual void PreBrowserMain() {}
Allows the embedder to perform platform-specific initialization before BrowserMain() is invoked (i.e. before BrowserMainRunner, BrowserMainLoop, BrowserMainParts, etc. are created).
virtual ContentBrowserClient* CreateContentBrowserClient();
virtual ContentGpuClient* CreateContentGpuClient();
virtual ContentRendererClient* CreateContentRendererClient();
virtual ContentUtilityClient* CreateContentUtilityClient();
Called once per relevant process type to allow the embedder to customize content. If an embedder wants the default (empty) implementation, don’t override this.
virtual absl::variant RunProcess( const std::string& process_type, MainFunctionParams main_function_params);
Asks the embedder to start a process. The embedder may return the |main_function_params| back to decline the request and kick-off the default behavior or return a non-negative exit code to indicate it handled the request.
virtual bool ShouldCreateFeatureList();
Returns true if content should create field trials and initialize the FeatureList instance for this process. Default implementation returns true. Embedders that need to control when and/or how FeatureList should be created should override and return false.
virtual bool ShouldLockSchemeRegistry();
Allows the embedder to prevent locking the scheme registry. The scheme registry is the list of URL schemes we recognize, with some additional information about each scheme such as whether it expects a host. The scheme registry is not thread-safe, so by default it is locked before any threads are created to ensure single-threaded access. An embedder can override this to prevent the scheme registry from being locked during startup, but if they do so then they are responsible for making sure that the registry is only accessed in a thread-safe way, and for calling url::LockSchemeRegistries() when initialization is complete. If possible, prefer registering additional schemes through ContentClient::AddAdditionalSchemes over preventing the scheme registry from being locked.