diff options
author | mal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 04:25:58 +0000 |
---|---|---|
committer | mal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 04:25:58 +0000 |
commit | 31d9a1aedd6b5ee288face8603e6ab91d334c5e3 (patch) | |
tree | 034092192c9430f04e5c32f7327bde4c8224d1a5 /chrome/browser/renderer_host | |
parent | e000c4e2867b398739908e915266ac204a09dca1 (diff) | |
download | chromium_src-31d9a1aedd6b5ee288face8603e6ab91d334c5e3.zip chromium_src-31d9a1aedd6b5ee288face8603e6ab91d334c5e3.tar.gz chromium_src-31d9a1aedd6b5ee288face8603e6ab91d334c5e3.tar.bz2 |
Rolback r8793: Remove extraneous uses of the --enable-user-script
switch. It's better to check this at one chokepoint
(initialization) and let the rest of the code work
the same, but end up as no-ops.
This seems to break ui_tests.
Review URL: http://codereview.chromium.org/19418
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 16 |
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. :( |