diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 23:55:10 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 23:55:10 +0000 |
commit | a27a938d8511abfaf89d6e2d0e4d4242c76dffed (patch) | |
tree | 98b133536459106b96a0ee09e0deb94b8d92c4b3 /chrome/browser/task_manager_resource_providers.h | |
parent | 342c2c40bd1729fe985d5a6ee06f6eb28bbcdc22 (diff) | |
download | chromium_src-a27a938d8511abfaf89d6e2d0e4d4242c76dffed.zip chromium_src-a27a938d8511abfaf89d6e2d0e4d4242c76dffed.tar.gz chromium_src-a27a938d8511abfaf89d6e2d0e4d4242c76dffed.tar.bz2 |
Refactor plugin process code in the browser process so that the browser/about:memory/task manager/metrics code doesn't depend on PluginProcessHost pointers. In a future changelist I'll add one central child process registry in the browser process.
Review URL: http://codereview.chromium.org/20196
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager_resource_providers.h')
-rw-r--r-- | chrome/browser/task_manager_resource_providers.h | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/chrome/browser/task_manager_resource_providers.h b/chrome/browser/task_manager_resource_providers.h index 2fb0820..a56aed5 100644 --- a/chrome/browser/task_manager_resource_providers.h +++ b/chrome/browser/task_manager_resource_providers.h @@ -6,11 +6,10 @@ #define CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ #include "base/basictypes.h" -#include "chrome/browser/plugin_process_info.h" #include "chrome/browser/task_manager.h" +#include "chrome/common/child_process_info.h" #include "chrome/common/notification_observer.h" -class PluginProcessHost; class WebContents; // These file contains the resource providers used in the task manager. @@ -75,10 +74,10 @@ class TaskManagerWebContentsResourceProvider DISALLOW_COPY_AND_ASSIGN(TaskManagerWebContentsResourceProvider); }; -class TaskManagerPluginProcessResource : public TaskManager::Resource { +class TaskManagerChildProcessResource : public TaskManager::Resource { public: - explicit TaskManagerPluginProcessResource(PluginProcessInfo plugin_proc); - ~TaskManagerPluginProcessResource(); + explicit TaskManagerChildProcessResource(ChildProcessInfo child_proc); + ~TaskManagerChildProcessResource(); // TaskManagerResource methods: std::wstring GetTitle() const; @@ -93,29 +92,29 @@ class TaskManagerPluginProcessResource : public TaskManager::Resource { network_usage_support_ = true; } - // Returns the pid of the plugin process. + // Returns the pid of the child process. int process_id() const { return pid_; } private: - PluginProcessInfo plugin_process_; + ChildProcessInfo child_process_; int pid_; mutable std::wstring title_; bool network_usage_support_; - // The icon painted for plugins. + // The icon painted for the child processs. // TODO (jcampan): we should have plugin specific icons for well-known // plugins. static SkBitmap* default_icon_; - DISALLOW_COPY_AND_ASSIGN(TaskManagerPluginProcessResource); + DISALLOW_COPY_AND_ASSIGN(TaskManagerChildProcessResource); }; -class TaskManagerPluginProcessResourceProvider +class TaskManagerChildProcessResourceProvider : public TaskManager::ResourceProvider, public NotificationObserver { public: - explicit TaskManagerPluginProcessResourceProvider(TaskManager* task_manager); - virtual ~TaskManagerPluginProcessResourceProvider(); + explicit TaskManagerChildProcessResourceProvider(TaskManager* task_manager); + virtual ~TaskManagerChildProcessResourceProvider(); virtual TaskManager::Resource* GetResource(int origin_pid, int render_process_host_id, @@ -128,38 +127,38 @@ class TaskManagerPluginProcessResourceProvider const NotificationSource& source, const NotificationDetails& details); - // Retrieves the current PluginProcessInfo (performed in the IO thread). - virtual void RetrievePluginProcessInfo(); + // Retrieves the current ChildProcessInfo (performed in the IO thread). + virtual void RetrieveChildProcessInfo(); - // Notifies the UI thread that the PluginProcessInfo have been retrieved. - virtual void PluginProcessInfoRetreived(); + // Notifies the UI thread that the ChildProcessInfo have been retrieved. + virtual void ChildProcessInfoRetreived(); // Whether we are currently reporting to the task manager. Used to ignore // notifications sent after StopUpdating(). bool updating_; - // The list of PluginProcessInfo retrieved when starting the update. - std::vector<PluginProcessInfo> existing_plugin_process_info; + // The list of ChildProcessInfo retrieved when starting the update. + std::vector<ChildProcessInfo> existing_child_process_info_; private: - void Add(PluginProcessInfo plugin_process_info); - void Remove(PluginProcessInfo plugin_process_info); + void Add(ChildProcessInfo child_process_info); + void Remove(ChildProcessInfo child_process_info); - void AddToTaskManager(PluginProcessInfo plugin_process_info); + void AddToTaskManager(ChildProcessInfo child_process_info); TaskManager* task_manager_; MessageLoop* ui_loop_; - // Maps the actual resources (the PluginProcessInfo) to the Task Manager + // Maps the actual resources (the ChildProcessInfo) to the Task Manager // resources. - std::map<PluginProcessInfo, TaskManagerPluginProcessResource*> resources_; + std::map<ChildProcessInfo, TaskManagerChildProcessResource*> resources_; // Maps the pids to the resources (used for quick access to the resource on // byte read notifications). - std::map<int, TaskManagerPluginProcessResource*> pid_to_resources_; + std::map<int, TaskManagerChildProcessResource*> pid_to_resources_; - DISALLOW_COPY_AND_ASSIGN(TaskManagerPluginProcessResourceProvider); + DISALLOW_COPY_AND_ASSIGN(TaskManagerChildProcessResourceProvider); }; class TaskManagerBrowserProcessResource : public TaskManager::Resource { @@ -212,7 +211,7 @@ class TaskManagerBrowserProcessResourceProvider bool updating_; private: - void AddToTaskManager(PluginProcessInfo plugin_process_info); + void AddToTaskManager(ChildProcessInfo child_process_info); TaskManager* task_manager_; TaskManagerBrowserProcessResource resource_; |