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

Unified Diff: chrome/browser/plugin_service.cc

Issue 3015029: Replace ViewHostMsg_GetPluginPath with ViewHostMsg_GetPluginInfo. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: compile fixes 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/renderer_host/resource_message_filter.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 1b363827e32d7c27afa1495c21ad0d186799885e..197a3ffa92511463e6721592da1203bc859cc1dc 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -228,10 +228,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);
@@ -241,21 +244,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()) {
@@ -336,8 +324,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/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698