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

Unified Diff: chrome/browser/plugin_service.cc

Issue 2967007: Disable outdated plugins, block non-sandboxed plugins. (Closed)
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « chrome/browser/plugin_service.h ('k') | chrome/browser/plugin_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_service.cc
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc
index b7f0489569c06148ed64ed188745c38af27fa9d6..9cb30199f5c4c84ebb3e3eb20681b7fa47c303d2 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -62,6 +62,11 @@ void PluginService::InitGlobalInstance(Profile* profile) {
// We first group the plugins and then figure out which groups to disable.
plugin_updater::DisablePluginGroupsFromPrefs(profile);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableOutdatedPlugins)) {
+ plugin_updater::DisableOutdatedPluginGroups();
+ }
+
// Have Chrome plugins write their data to the profile directory.
GetInstance()->SetChromePluginDataDir(profile->GetPath());
}
@@ -229,10 +234,13 @@ void PluginService::OpenChannelToPlugin(
const std::wstring& locale,
IPC::Message* reply_msg) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- // We don't need a policy URL here because that was already checked by a
- // previous call to GetPluginPath.
- GURL policy_url;
- FilePath plugin_path = GetPluginPath(url, policy_url, mime_type, NULL);
+ bool allow_wildcard = true;
+ WebPluginInfo info;
+ FilePath plugin_path;
+ if (NPAPI::PluginList::Singleton()->GetPluginInfo(
+ url, mime_type, allow_wildcard, &info, NULL) && info.enabled) {
+ plugin_path = info.path;
+ }
PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path);
if (plugin_host) {
plugin_host->OpenChannelToPlugin(renderer_msg_filter, mime_type, reply_msg);
@@ -242,21 +250,6 @@ void PluginService::OpenChannelToPlugin(
}
}
-FilePath PluginService::GetPluginPath(const GURL& url,
- const GURL& policy_url,
- const std::string& mime_type,
- std::string* actual_mime_type) {
- bool allow_wildcard = true;
- WebPluginInfo info;
- if (NPAPI::PluginList::Singleton()->GetPluginInfo(
- url, mime_type, allow_wildcard, &info, actual_mime_type) &&
- info.enabled && PluginAllowedForURL(info.path, policy_url)) {
- return info.path;
- }
-
- return FilePath();
-}
-
static void PurgePluginListCache(bool reload_pages) {
for (RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator();
!it.IsAtEnd(); it.Advance()) {
@@ -337,8 +330,8 @@ void PluginService::Observe(NotificationType type,
}
}
-bool PluginService::PluginAllowedForURL(const FilePath& plugin_path,
- const GURL& url) {
+bool PluginService::PrivatePluginAllowedForURL(const FilePath& plugin_path,
+ const GURL& url) {
if (url.is_empty())
return true; // Caller wants all plugins.
« no previous file with comments | « chrome/browser/plugin_service.h ('k') | chrome/browser/plugin_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698