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

Unified Diff: chrome/browser/memory_details.h

Issue 177024: Linux: about:memory (Closed)
Patch Set: ... Created 11 years, 4 months 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/browser/browser_resources.grd ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory_details.h
diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
index 8876c474c8294c144a96b6c93cc5ddcac969f039..2e7e852426630b3a638c45adb5f08a74df3211a6 100644
--- a/chrome/browser/memory_details.h
+++ b/chrome/browser/memory_details.h
@@ -17,8 +17,11 @@ class MessageLoop;
// have multiple processes (of course!). Even IE has multiple
// processes these days.
struct ProcessMemoryInformation {
- ProcessMemoryInformation() {
- memset(this, 0, sizeof(ProcessMemoryInformation));
+ ProcessMemoryInformation()
+ : pid(0),
+ num_processes(0),
+ is_diagnostics(false),
+ type(ChildProcessInfo::UNKNOWN_PROCESS) {
}
// The process id.
@@ -46,8 +49,8 @@ typedef std::vector<ProcessMemoryInformation> ProcessMemoryInformationList;
// Browser Process Information.
struct ProcessData {
- const wchar_t* name;
- const wchar_t* process_name;
+ std::wstring name;
+ std::wstring process_name;
ProcessMemoryInformationList processes;
};
@@ -71,26 +74,13 @@ struct ProcessData {
// }
class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
public:
- // Known browsers which we collect details for.
- enum {
- CHROME_BROWSER = 0,
- IE_BROWSER,
- FIREFOX_BROWSER,
- OPERA_BROWSER,
- SAFARI_BROWSER,
- IE_64BIT_BROWSER,
- KONQUEROR_BROWSER,
- MAX_BROWSERS
- } BrowserProcess;
-
// Constructor.
MemoryDetails();
virtual ~MemoryDetails() {}
- // Access to the process detail information. This is an array
- // of MAX_BROWSER ProcessData structures. This data is only available
+ // Access to the process detail information. This data is only available
// after OnDetailsAvailable() has been called.
- ProcessData* processes() { return process_data_; }
+ const std::vector<ProcessData>& processes() { return process_data_; }
// Initiate updating the current memory details. These are fetched
// asynchronously because data must be collected from multiple threads.
@@ -123,7 +113,10 @@ class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
// the global histograms for tracking memory usage.
void UpdateHistograms();
- ProcessData process_data_[MAX_BROWSERS];
+ // Returns a pointer to the ProcessData structure for Chrome.
+ ProcessData* ChromeBrowser();
+
+ std::vector<ProcessData> process_data_;
MessageLoop* ui_loop_;
DISALLOW_EVIL_CONSTRUCTORS(MemoryDetails);
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698