summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_service.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 23:16:42 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-13 23:16:42 +0000
commita436d92d5121ebfc9996682cfed4c3ad33313138 (patch)
tree55c32ef45ccc9e808e98074b5a26565239ed06fc /chrome/browser/plugin_service.h
parentb2ca508afc56d4b7f6d5b036dd721604440210b3 (diff)
downloadchromium_src-a436d92d5121ebfc9996682cfed4c3ad33313138.zip
chromium_src-a436d92d5121ebfc9996682cfed4c3ad33313138.tar.gz
chromium_src-a436d92d5121ebfc9996682cfed4c3ad33313138.tar.bz2
Have ChildProcessInfo contain a list of all running child processes (i.e. instead of Service and other child process service maintain it). In a future change I'll start moving some of the code from PluginProcessHost to ChildProcessInfo.
Review URL: http://codereview.chromium.org/24017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_service.h')
-rw-r--r--chrome/browser/plugin_service.h73
1 files changed, 6 insertions, 67 deletions
diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h
index c569bdb..66bd408 100644
--- a/chrome/browser/plugin_service.h
+++ b/chrome/browser/plugin_service.h
@@ -14,6 +14,7 @@
#include "base/hash_tables.h"
#include "base/lock.h"
#include "base/ref_counted.h"
+#include "base/singleton.h"
#include "chrome/browser/browser_process.h"
#include "webkit/glue/webplugin.h"
@@ -34,13 +35,6 @@ class PluginService {
// Returns the PluginService singleton.
static PluginService* GetInstance();
- // Creates the PluginService object, but doesn't actually build the plugin
- // list yet. It's generated lazily.
- // Note: don't call these directly - use GetInstance() above. They are public
- // so Singleton can access them.
- PluginService();
- ~PluginService();
-
// Gets the list of available plugins.
void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins);
@@ -78,13 +72,6 @@ class PluginService {
const std::wstring& locale,
IPC::Message* reply_msg);
- // A PluginProcessHost object calls this before its process is shut down.
- void OnPluginProcessIsShuttingDown(PluginProcessHost* host);
-
- // A PluginProcessHost object calls this after its process has exited. This
- // call deletes the host instance.
- void OnPluginProcessExited(PluginProcessHost* host);
-
bool HavePluginFor(const std::string& mime_type, bool allow_wildcard);
FilePath GetPluginPath(const GURL& url,
@@ -114,10 +101,12 @@ class PluginService {
void Shutdown();
private:
- friend class PluginProcessHostIterator;
+ friend DefaultSingletonTraits<PluginService>;
- // Removes a host from the plugin_hosts collection
- void RemoveHost(PluginProcessHost* host);
+ // Creates the PluginService object, but doesn't actually build the plugin
+ // list yet. It's generated lazily.
+ PluginService();
+ ~PluginService();
// Shutdown handler which executes in the context of the IO thread.
void OnShutdown();
@@ -165,54 +154,4 @@ class PluginService {
DISALLOW_COPY_AND_ASSIGN(PluginService);
};
-// The PluginProcessHostIterator allows to iterate through all the
-// PluginProcessHosts. Note that this should be done from the IO thread and that
-// the iterator should not be kept around as it may be invalidated on
-// subsequent event processing in the event loop.
-class PluginProcessHostIterator {
- public:
- PluginProcessHostIterator();
- PluginProcessHostIterator(const PluginProcessHostIterator& instance);
-
- PluginProcessHostIterator& operator=(
- const PluginProcessHostIterator& instance) {
- iterator_ = instance.iterator_;
- return *this;
- }
-
- const PluginProcessHost* operator->() const {
- return iterator_->second;
- }
-
- const PluginProcessHost* operator*() const {
- return iterator_->second;
- }
-
- const PluginProcessHost* operator++() { // ++preincrement
- ++iterator_;
- if (iterator_ == end_)
- return NULL;
- else
- return iterator_->second;
- }
-
- const PluginProcessHost* operator++(int) { // postincrement++
- const PluginProcessHost* r;
- if (iterator_ == end_)
- r = NULL;
- else
- r = iterator_->second;
- iterator_++;
- return r;
- }
-
- bool Done() {
- return (iterator_ == end_);
- }
-
- private:
- PluginService::PluginMap::const_iterator iterator_;
- PluginService::PluginMap::const_iterator end_;
-};
-
#endif // CHROME_BROWSER_PLUGIN_SERVICE_H_