Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9889)

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 1821413003: Remove logic for lazy initialization of WebKit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/chrome_render_process_observer.cc
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc
index e8daff7e736b2f2bfc706b243a9f9d2a802cfc1a..fab4631e6e26d01aae8704a04b753b97dac49137 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -183,7 +183,7 @@ class ResourceUsageReporterImpl : public ResourceUsageReporter {
// Since it is not safe to call any Blink or V8 functions until Blink has
// been initialized (which also initializes V8), early out and send 0 back
// for all resources.
- if (!observer_ || !observer_->webkit_initialized()) {
+ if (!observer_) {
SendResults();
return;
}
@@ -238,7 +238,7 @@ void CreateResourceUsageReporter(
bool ChromeRenderProcessObserver::is_incognito_process_ = false;
ChromeRenderProcessObserver::ChromeRenderProcessObserver()
- : webkit_initialized_(false), weak_factory_(this) {
+ : weak_factory_(this) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
@@ -274,6 +274,19 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver()
chrome_common_media::LocalizedStringProvider);
InitFieldTrialObserving(command_line);
+
+ // chrome-native: is a scheme used for placeholder navigations that allow
+ // UIs to be drawn with platform native widgets instead of HTML. These pages
+ // should not be accessible, and should also be treated as empty documents
+ // that can commit synchronously. No code should be runnable in these pages,
+ // so it should not need to access anything nor should it allow javascript
+ // URLs since it should never be visible to the user.
+ WebString native_scheme(base::ASCIIToUTF16(chrome::kChromeNativeScheme));
+ WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(native_scheme);
+ WebSecurityPolicy::registerURLSchemeAsEmptyDocument(native_scheme);
+ WebSecurityPolicy::registerURLSchemeAsNoAccess(native_scheme);
+ WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs(
+ native_scheme);
}
ChromeRenderProcessObserver::~ChromeRenderProcessObserver() {}
@@ -320,26 +333,6 @@ bool ChromeRenderProcessObserver::OnControlMessageReceived(
return handled;
}
-void ChromeRenderProcessObserver::WebKitInitialized() {
- webkit_initialized_ = true;
- // chrome-native: is a scheme used for placeholder navigations that allow
- // UIs to be drawn with platform native widgets instead of HTML. These pages
- // should not be accessible, and should also be treated as empty documents
- // that can commit synchronously. No code should be runnable in these pages,
- // so it should not need to access anything nor should it allow javascript
- // URLs since it should never be visible to the user.
- WebString native_scheme(base::ASCIIToUTF16(chrome::kChromeNativeScheme));
- WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(native_scheme);
- WebSecurityPolicy::registerURLSchemeAsEmptyDocument(native_scheme);
- WebSecurityPolicy::registerURLSchemeAsNoAccess(native_scheme);
- WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs(
- native_scheme);
-}
-
-void ChromeRenderProcessObserver::OnRenderProcessShutdown() {
- webkit_initialized_ = false;
-}
-
void ChromeRenderProcessObserver::OnSetIsIncognitoProcess(
bool is_incognito_process) {
is_incognito_process_ = is_incognito_process;

Powered by Google App Engine
This is Rietveld 408576698