protocol: api to register schemes that can handle service worker
This commit is contained in:
parent
5e9aca4524
commit
855d49100f
12 changed files with 86 additions and 8 deletions
|
@ -54,6 +54,8 @@ bool g_suppress_renderer_process_restart = false;
|
|||
|
||||
// Custom schemes to be registered to standard.
|
||||
std::string g_custom_schemes = "";
|
||||
// Custom schemes to be registered to handle service worker.
|
||||
std::string g_custom_service_worker_schemes = "";
|
||||
|
||||
scoped_refptr<net::X509Certificate> ImportCertFromFile(
|
||||
const base::FilePath& path) {
|
||||
|
@ -87,6 +89,11 @@ void AtomBrowserClient::SetCustomSchemes(
|
|||
g_custom_schemes = base::JoinString(schemes, ",");
|
||||
}
|
||||
|
||||
void AtomBrowserClient::SetCustomServiceWorkerSchemes(
|
||||
const std::vector<std::string>& schemes) {
|
||||
g_custom_service_worker_schemes = base::JoinString(schemes, ",");
|
||||
}
|
||||
|
||||
AtomBrowserClient::AtomBrowserClient() : delegate_(nullptr) {
|
||||
}
|
||||
|
||||
|
@ -172,6 +179,11 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
|
|||
command_line->AppendSwitchASCII(switches::kRegisterStandardSchemes,
|
||||
g_custom_schemes);
|
||||
|
||||
// The registered service worker schemes.
|
||||
if (!g_custom_service_worker_schemes.empty())
|
||||
command_line->AppendSwitchASCII(switches::kRegisterServiceWorkerSchemes,
|
||||
g_custom_service_worker_schemes);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Append --app-user-model-id.
|
||||
PWSTR current_app_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue