Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: restore //url dchecks (#15637)
- Loading branch information
Showing
6 changed files
with
65 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
patches/common/chromium/content_allow_embedder_to_prevent_locking_scheme_registry.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Jeremy Apthorp <nornagon@nornagon.net> | ||
Date: Wed, 21 Nov 2018 14:31:34 -0800 | ||
Subject: content: allow embedder to prevent locking scheme registry | ||
|
||
The //content layer requires all schemes to be registered during startup, | ||
because Add*Scheme aren't threadsafe. However, Electron exposes the option to | ||
register additional schemes via JavaScript in the main process before the app | ||
is ready, but after the //content layer has already locked the registry. | ||
|
||
Without this patch, calling `registerStandardSchemes` during initialization | ||
when in debug mode will cause a DCHECK to fire. | ||
|
||
|
||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc | ||
index 034fdcad958cb25780c304d184b2fbb721a13200..c2090368f6678950690463e0b90620cb9fdf5f41 100644 | ||
--- a/content/app/content_main_runner_impl.cc | ||
+++ b/content/app/content_main_runner_impl.cc | ||
@@ -808,7 +808,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { | ||
#endif | ||
|
||
RegisterPathProvider(); | ||
- RegisterContentSchemes(true); | ||
+ RegisterContentSchemes(delegate_->ShouldLockSchemeRegistry()); | ||
|
||
#if defined(OS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) | ||
int icudata_fd = g_fds->MaybeGet(kAndroidICUDataDescriptor); | ||
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc | ||
index c4bdfd36ad0c34b3a91b59502414bc98c091ccee..d7ac740d0088c002bee98238faea1ef9593eee92 100644 | ||
--- a/content/public/app/content_main_delegate.cc | ||
+++ b/content/public/app/content_main_delegate.cc | ||
@@ -63,6 +63,10 @@ bool ContentMainDelegate::ShouldEnableProfilerRecording() { | ||
return false; | ||
} | ||
|
||
+bool ContentMainDelegate::ShouldLockSchemeRegistry() { | ||
+ return true; | ||
+} | ||
+ | ||
service_manager::ProcessType ContentMainDelegate::OverrideProcessType() { | ||
return service_manager::ProcessType::kDefault; | ||
} | ||
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h | ||
index 979e25d1c1b9ff4b16adbab28cb44d8473f8232a..7aca113058ed111a98e396df57ebc36c06e3b896 100644 | ||
--- a/content/public/app/content_main_delegate.h | ||
+++ b/content/public/app/content_main_delegate.h | ||
@@ -101,6 +101,9 @@ class CONTENT_EXPORT ContentMainDelegate { | ||
// Returns whether or not profiler recording should be enabled. | ||
virtual bool ShouldEnableProfilerRecording(); | ||
|
||
+ // Allows the embedder to prevent locking the scheme registry. | ||
+ virtual bool ShouldLockSchemeRegistry(); | ||
+ | ||
// Fatal errors during initialization are reported by this function, so that | ||
// the embedder can implement graceful exit by displaying some message and | ||
// returning initialization error code. Default behavior is CHECK(false). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters