summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_service.h
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 14:38:00 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 14:38:00 +0000
commita40996367757f82fb2e22035ac65c9d0510e1651 (patch)
treeb4676838b8c03991dc09736ea0046cd61a27442c /chrome/browser/plugin_service.h
parentd90bcafafdccbef95760c2d9c1b4ce8206d46b7b (diff)
downloadchromium_src-a40996367757f82fb2e22035ac65c9d0510e1651.zip
chromium_src-a40996367757f82fb2e22035ac65c9d0510e1651.tar.gz
chromium_src-a40996367757f82fb2e22035ac65c9d0510e1651.tar.bz2
Reverting 23420. It caused a reliability regression.
TBR=jam BUG=none TEST=reliability Review URL: http://codereview.chromium.org/165532 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_service.h')
-rw-r--r--chrome/browser/plugin_service.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h
index 6933895..8bcbf7c 100644
--- a/chrome/browser/plugin_service.h
+++ b/chrome/browser/plugin_service.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/hash_tables.h"
+#include "base/lock.h"
#include "base/ref_counted.h"
#include "base/singleton.h"
#include "base/waitable_event_watcher.h"
@@ -35,8 +36,8 @@ class URLRequestContext;
class ResourceDispatcherHost;
class ResourceMessageFilter;
-// This must be created on the main thread but it's only called on the IO/file
-// thread.
+// This can be called on the main thread and IO thread. However it must
+// be created on the main thread.
class PluginService
: public base::WaitableEventWatcher::Delegate,
public NotificationObserver {
@@ -44,6 +45,9 @@ class PluginService
// Returns the PluginService singleton.
static PluginService* GetInstance();
+ // Gets the list of available plugins.
+ void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins);
+
// Load all the plugins that should be loaded for the lifetime of the browser
// (ie, with the LoadOnStartup flag set).
void LoadChromePlugins(ResourceDispatcherHost* resource_dispatcher_host);
@@ -78,6 +82,8 @@ class PluginService
const std::wstring& locale,
IPC::Message* reply_msg);
+ bool HavePluginFor(const std::string& mime_type, bool allow_wildcard);
+
// Get the path to the plugin specified. policy_url is the URL of the page
// requesting the plugin, so we can verify whether the plugin is allowed
// on that page.
@@ -109,6 +115,9 @@ class PluginService
virtual void Observe(NotificationType type, const NotificationSource& source,
const NotificationDetails& details);
+ // Get plugin info by matching full path.
+ bool GetPluginInfoByPath(const FilePath& plugin_path, WebPluginInfo* info);
+
// Returns true if the given plugin is allowed to be used by a page with
// the given URL.
bool PluginAllowedForURL(const FilePath& plugin_path, const GURL& url);
@@ -134,6 +143,10 @@ class PluginService
typedef base::hash_map<FilePath, GURL> PrivatePluginMap;
PrivatePluginMap private_plugins_;
+ // Need synchronization whenever we access the plugin_list singelton through
+ // webkit_glue since this class is called on the main and IO thread.
+ Lock lock_;
+
NotificationRegistrar registrar_;
#if defined(OS_WIN)