summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-21 08:43:39 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-21 08:43:39 +0000
commit51549da314ab40bfce645bb6c5875c4e5ec12f67 (patch)
tree3e559616fcd7e3e21b694dcf6ed57794a85c6f0d /chrome
parent4d409d77dfaa84a06547d3e0a45191cf803fbb9d (diff)
downloadchromium_src-51549da314ab40bfce645bb6c5875c4e5ec12f67.zip
chromium_src-51549da314ab40bfce645bb6c5875c4e5ec12f67.tar.gz
chromium_src-51549da314ab40bfce645bb6c5875c4e5ec12f67.tar.bz2
Tommi, please review everything. John please review the changes to plugin_service.cc/.h
The test automation provider registers itself as a protocol factory for http/https requests. This is to ensure that intercepts set by the url request network tests work correctly. I was seeing these tests fail consistently on my setup as their intercept function would never get called. The other change is to add a simple mechanism based on a boolean flag to disable browser side plugins like gears which also intercept network requests and expect to be called on the IO thread. The chrome frame network tests run in a relatively simple environment where the network tests run in a separate thread (not the IO thread) which causes a number of DCHECKS to fire in debug build test runs. The flag used to determine whether browser plugins are loaded defaults to true. Review URL: http://codereview.chromium.org/414017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/plugin_service.cc11
-rw-r--r--chrome/browser/plugin_service.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc
index 5f66be9..ba5821e 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -42,10 +42,18 @@ static void NotifyPluginsOfActivation() {
#endif
// static
+bool PluginService::enable_chrome_plugins_ = true;
+
+// static
PluginService* PluginService::GetInstance() {
return Singleton<PluginService>::get();
}
+// static
+void PluginService::EnableChromePlugins(bool enable) {
+ enable_chrome_plugins_ = enable;
+}
+
PluginService::PluginService()
: main_message_loop_(MessageLoop::current()),
resource_dispatcher_host_(NULL),
@@ -103,6 +111,9 @@ PluginService::~PluginService() {
void PluginService::LoadChromePlugins(
ResourceDispatcherHost* resource_dispatcher_host) {
+ if (!enable_chrome_plugins_)
+ return;
+
resource_dispatcher_host_ = resource_dispatcher_host;
ChromePluginLib::LoadChromePlugins(GetCPBrowserFuncsForBrowser());
}
diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h
index c9ee5a1..7ab39e2 100644
--- a/chrome/browser/plugin_service.h
+++ b/chrome/browser/plugin_service.h
@@ -91,6 +91,8 @@ class PluginService
return resource_dispatcher_host_;
}
+ static void EnableChromePlugins(bool enable);
+
private:
friend struct DefaultSingletonTraits<PluginService>;
@@ -143,6 +145,9 @@ class PluginService
base::WaitableEventWatcher hklm_watcher_;
#endif
+ // Set to true if chrome plugins are enabled. Defaults to true.
+ static bool enable_chrome_plugins_;
+
DISALLOW_COPY_AND_ASSIGN(PluginService);
};