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

Unified Diff: chrome/browser/task_manager/task_manager_resource_providers.h

Issue 8764021: Make TaskManager not use ChildProcessInfo. After this change, I will make BrowserChildProcessHost... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/app/generated_resources.grd ('k') | chrome/browser/task_manager/task_manager_resource_providers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/task_manager_resource_providers.h
===================================================================
--- chrome/browser/task_manager/task_manager_resource_providers.h (revision 112384)
+++ chrome/browser/task_manager/task_manager_resource_providers.h (working copy)
@@ -13,9 +13,9 @@
#include "base/compiler_specific.h"
#include "base/process_util.h"
#include "chrome/browser/task_manager/task_manager.h"
-#include "content/common/child_process_info.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/common/process_type.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
class BackgroundContents;
@@ -233,7 +233,9 @@
class TaskManagerChildProcessResource : public TaskManager::Resource {
public:
- explicit TaskManagerChildProcessResource(const ChildProcessInfo& child_proc);
+ TaskManagerChildProcessResource(content::ProcessType type,
+ const string16& name,
+ base::ProcessHandle handle);
virtual ~TaskManagerChildProcessResource();
// TaskManager::Resource methods:
@@ -253,7 +255,9 @@
// process would be "Plug-in: Flash" when name is "Flash".
string16 GetLocalizedTitle() const;
- ChildProcessInfo child_process_;
+ content::ProcessType type_;
+ string16 name_;
+ base::ProcessHandle handle_;
int pid_;
mutable string16 title_;
bool network_usage_support_;
@@ -283,36 +287,45 @@
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // Retrieves the current ChildProcessInfo (performed in the IO thread).
- virtual void RetrieveChildProcessInfo();
+ private:
+ struct ChildProcessData {
+ content::ProcessType type;
+ string16 name;
+ base::ProcessHandle handle;
+ };
- // Notifies the UI thread that the ChildProcessInfo have been retrieved.
- virtual void ChildProcessInfoRetreived();
+ virtual ~TaskManagerChildProcessResourceProvider();
- // Whether we are currently reporting to the task manager. Used to ignore
- // notifications sent after StopUpdating().
- bool updating_;
+ // Retrieves information about the running ChildProcessHosts (performed in the
+ // IO thread).
+ virtual void RetrieveChildProcessInfo();
- // The list of ChildProcessInfo retrieved when starting the update.
- std::vector<ChildProcessInfo> existing_child_process_info_;
+ // Notifies the UI thread that the ChildProcessHosts information have been
+ // retrieved.
+ virtual void ChildProcessInfoRetreived(
+ const std::vector<ChildProcessData>& child_processes);
- private:
- virtual ~TaskManagerChildProcessResourceProvider();
+ void Add(const ChildProcessData& child_process_data);
+ void Remove(const ChildProcessData& child_process_data);
- void Add(const ChildProcessInfo& child_process_info);
- void Remove(const ChildProcessInfo& child_process_info);
+ void AddToTaskManager(const ChildProcessData& child_process_data);
- void AddToTaskManager(const ChildProcessInfo& child_process_info);
-
TaskManager* task_manager_;
+ // Whether we are currently reporting to the task manager. Used to ignore
+ // notifications sent after StopUpdating().
+ bool updating_;
+
// Maps the actual resources (the ChildProcessInfo) to the Task Manager
// resources.
- std::map<ChildProcessInfo, TaskManagerChildProcessResource*> resources_;
+ typedef std::map<base::ProcessHandle, TaskManagerChildProcessResource*>
+ ChildProcessMap;
+ ChildProcessMap resources_;
// Maps the pids to the resources (used for quick access to the resource on
// byte read notifications).
- std::map<int, TaskManagerChildProcessResource*> pid_to_resources_;
+ typedef std::map<int, TaskManagerChildProcessResource*> PidResourceMap;
+ PidResourceMap pid_to_resources_;
// A scoped container for notification registries.
content::NotificationRegistrar registrar_;
@@ -518,8 +531,6 @@
private:
virtual ~TaskManagerBrowserProcessResourceProvider();
- void AddToTaskManager(ChildProcessInfo child_process_info);
-
TaskManager* task_manager_;
TaskManagerBrowserProcessResource resource_;
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/task_manager/task_manager_resource_providers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698