Index: content/browser/plugin_service.h |
diff --git a/content/browser/plugin_service.h b/content/browser/plugin_service.h |
index 975d815753da6cfba3181a35ee6d46e578a1faae..311af631285cd54f13b1289c4f82d064a1c4e22c 100644 |
--- a/content/browser/plugin_service.h |
+++ b/content/browser/plugin_service.h |
@@ -12,11 +12,8 @@ |
#include <string> |
#include "base/basictypes.h" |
-#include "base/file_path.h" |
-#include "base/hash_tables.h" |
#include "base/memory/scoped_vector.h" |
#include "base/memory/singleton.h" |
-#include "base/synchronization/lock.h" |
#include "base/synchronization/waitable_event_watcher.h" |
#include "build/build_config.h" |
#include "content/browser/plugin_process_host.h" |
@@ -40,19 +37,16 @@ |
struct PepperPluginInfo; |
class PluginDirWatcherDelegate; |
+namespace content { |
+class PluginFilter; |
+} |
+ |
// This must be created on the main thread but it's only called on the IO/file |
// thread. |
class PluginService |
: public base::WaitableEventWatcher::Delegate, |
public NotificationObserver { |
public: |
- struct OverriddenPlugin { |
- int render_process_id; |
- int render_view_id; |
- GURL url; |
- webkit::npapi::WebPluginInfo plugin; |
- }; |
- |
// Returns the PluginService singleton. |
static PluginService* GetInstance(); |
@@ -84,6 +78,7 @@ class PluginService |
void OpenChannelToNpapiPlugin(int render_process_id, |
int render_view_id, |
const GURL& url, |
+ const GURL& page_url, |
const std::string& mime_type, |
PluginProcessHost::Client* client); |
void OpenChannelToPpapiPlugin(const FilePath& path, |
@@ -92,26 +87,19 @@ class PluginService |
PpapiBrokerProcessHost::Client* client); |
// Gets the plugin in the list of plugins that matches the given url and mime |
- // type. Must be called on the FILE thread. |
- bool GetPluginInfo(int render_process_id, |
- int render_view_id, |
- const GURL& url, |
+ // type. Must be called on the FILE thread. Takes ownership of |filter|. |
+ bool GetPluginInfo(const GURL& url, |
const std::string& mime_type, |
+ bool allow_wildcard, |
+ content::PluginFilter* filter, |
+ bool* use_stale, |
webkit::npapi::WebPluginInfo* info, |
std::string* actual_mime_type); |
- // Safe to be called from any thread. |
- void OverridePluginForTab(const OverriddenPlugin& plugin); |
- |
- // Restricts the given plugin to the the scheme and host of the given url. |
- // Call with an empty url to reset this. |
- // Can be called on any thread. |
- void RestrictPluginToUrl(const FilePath& plugin_path, const GURL& url); |
- |
- // Returns true if the given plugin is allowed to be used by a page with |
- // the given URL. |
- // Can be called on any thread. |
- bool PluginAllowedForURL(const FilePath& plugin_path, const GURL& url); |
+ // Returns a list of installed plug-ins, filtering them with |filter|. |
+ // Must be called on the FILE thread. Takes ownership of |filter|. |
+ void GetPlugins(content::PluginFilter* filter, |
+ std::vector<webkit::npapi::WebPluginInfo>* plugins); |
// Tells all the renderer processes to throw away their cache of the plugin |
// list, and optionally also reload all the pages with plugins. |
@@ -139,10 +127,9 @@ class PluginService |
// Helper so we can do the plugin lookup on the FILE thread. |
void GetAllowedPluginForOpenChannelToPlugin( |
- int render_process_id, |
- int render_view_id, |
const GURL& url, |
const std::string& mime_type, |
+ content::PluginFilter* filter, |
PluginProcessHost::Client* client); |
// Helper so we can finish opening the channel after looking up the |
@@ -162,11 +149,6 @@ class PluginService |
// The browser's UI locale. |
const std::string ui_locale_; |
- // Map of plugin paths to the origin they are restricted to. |
- base::Lock restricted_plugin_lock_; // Guards access to restricted_plugin_. |
- typedef base::hash_map<FilePath, GURL> RestrictedPluginMap; |
- RestrictedPluginMap restricted_plugin_; |
- |
NotificationRegistrar registrar_; |
#if defined(OS_WIN) |
@@ -186,9 +168,6 @@ class PluginService |
std::vector<PepperPluginInfo> ppapi_plugins_; |
- std::vector<OverriddenPlugin> overridden_plugins_; |
- base::Lock overridden_plugins_lock_; |
- |
DISALLOW_COPY_AND_ASSIGN(PluginService); |
}; |