diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 03:29:28 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 03:29:28 +0000 |
commit | e000c4e2867b398739908e915266ac204a09dca1 (patch) | |
tree | 63e2e460ea95d6548315dfdda5c0b2a05083e96e /chrome | |
parent | 5cac27f202d39511fcab5176f6bb527a5c5a8653 (diff) | |
download | chromium_src-e000c4e2867b398739908e915266ac204a09dca1.zip chromium_src-e000c4e2867b398739908e915266ac204a09dca1.tar.gz chromium_src-e000c4e2867b398739908e915266ac204a09dca1.tar.bz2 |
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.
Review URL: http://codereview.chromium.org/18401
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 16 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 3 |
3 files changed, 7 insertions, 29 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index c8b8e6e..1e1db05 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -267,7 +267,6 @@ bool BrowserRenderProcessHost::Init() { switches::kDisablePopupBlocking, switches::kUseLowFragHeapCrt, switches::kGearsInRenderer, - switches::kEnableUserScripts, switches::kEnableVideo, }; @@ -515,21 +514,8 @@ 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(); - if (!user_script_master) { - return; - } + DCHECK(user_script_master); if (!user_script_master->ScriptsReady()) { // No scripts ready. :( diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 1544198..0eb16ee 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -172,7 +172,6 @@ RenderView::RenderView(RenderThreadBase* render_thread) disable_popup_blocking_(false), has_unload_listener_(false), decrement_shared_popup_at_destruction_(false), - user_scripts_enabled_(false), waiting_for_create_window_ack_(false), form_field_autofill_request_id_(0), popup_notification_visible_(false), @@ -317,8 +316,6 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd, command_line.HasSwitch(switches::kDomAutomationController); disable_popup_blocking_ = command_line.HasSwitch(switches::kDisablePopupBlocking); - user_scripts_enabled_ = - command_line.HasSwitch(switches::kEnableUserScripts); debug_message_handler_ = new DebugMessageHandler(this); render_thread_->AddFilter(debug_message_handler_); @@ -1491,14 +1488,12 @@ void RenderView::DidFinishDocumentLoadForFrame(WebView* webview, // Inject any user scripts. Do not inject into chrome UI pages, but do inject // into any other document. - if (user_scripts_enabled_) { - const GURL &gurl = frame->GetURL(); - if (g_render_thread && // Will be NULL when testing. - (gurl.SchemeIs("file") || - gurl.SchemeIs("http") || - gurl.SchemeIs("https"))) { - g_render_thread->user_script_slave()->InjectScripts(frame); - } + const GURL &gurl = frame->GetURL(); + if (g_render_thread && // Will be NULL when testing. + (gurl.SchemeIs("file") || + gurl.SchemeIs("http") || + gurl.SchemeIs("https"))) { + g_render_thread->user_script_slave()->InjectScripts(frame); } } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 49b0be1..5aff4bd 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -702,9 +702,6 @@ class RenderView : public RenderWidget, // maintains the cache and other features of the accessibility tree. scoped_ptr<GlueAccessibility> glue_accessibility_; - // True if user scripts are enabled in this process. - bool user_scripts_enabled_; - // Resource message queue. Used to queue up resource IPCs if we need // to wait for an ACK from the browser before proceeding. std::queue<IPC::Message*> queued_resource_messages_; |