summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 1e1db05..c8b8e6e 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -267,6 +267,7 @@ bool BrowserRenderProcessHost::Init() {
switches::kDisablePopupBlocking,
switches::kUseLowFragHeapCrt,
switches::kGearsInRenderer,
+ switches::kEnableUserScripts,
switches::kEnableVideo,
};
@@ -514,8 +515,21 @@ void BrowserRenderProcessHost::InitVisitedLinks() {
}
void BrowserRenderProcessHost::InitUserScripts() {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableUserScripts)) {
+ return;
+ }
+
+ // TODO(aa): Figure out lifetime and ownership of this object
+ // - VisitedLinkMaster is owned by Profile, but there has been talk of
+ // having scripts live elsewhere besides the profile.
+ // - File IO should be asynchronous (see VisitedLinkMaster), but how do we
+ // get scripts to the first renderer without blocking startup? Should we
+ // cache some information across restarts?
UserScriptMaster* user_script_master = profile()->GetUserScriptMaster();
- DCHECK(user_script_master);
+ if (!user_script_master) {
+ return;
+ }
if (!user_script_master->ScriptsReady()) {
// No scripts ready. :(