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

Side by Side Diff: chrome/browser/memory_details_mac.cc

Issue 823533004: Move memory histograms generation to MetricsMemoryDetails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better class comment. Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/memory_details_linux.cc ('k') | chrome/browser/memory_details_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/memory_details.h" 5 #include "chrome/browser/memory_details.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 30 matching lines...) Expand all
41 // TODO(viettrungluu): possibly add more? 41 // TODO(viettrungluu): possibly add more?
42 CHROME_BROWSER = 0, 42 CHROME_BROWSER = 0,
43 SAFARI_BROWSER, 43 SAFARI_BROWSER,
44 FIREFOX_BROWSER, 44 FIREFOX_BROWSER,
45 CAMINO_BROWSER, 45 CAMINO_BROWSER,
46 OPERA_BROWSER, 46 OPERA_BROWSER,
47 OMNIWEB_BROWSER, 47 OMNIWEB_BROWSER,
48 MAX_BROWSERS 48 MAX_BROWSERS
49 } BrowserProcess; 49 } BrowserProcess;
50 50
51 51 MemoryDetails::MemoryDetails() {
52 MemoryDetails::MemoryDetails()
53 : user_metrics_mode_(UPDATE_USER_METRICS),
54 memory_growth_tracker_(NULL) {
55 const base::FilePath browser_process_path = 52 const base::FilePath browser_process_path =
56 base::GetProcessExecutablePath(base::GetCurrentProcessHandle()); 53 base::GetProcessExecutablePath(base::GetCurrentProcessHandle());
57 const std::string browser_process_name = 54 const std::string browser_process_name =
58 browser_process_path.BaseName().value(); 55 browser_process_path.BaseName().value();
59 const std::string google_browser_name = 56 const std::string google_browser_name =
60 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); 57 l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
61 58
62 // (Human and process) names of browsers; should match the ordering for 59 // (Human and process) names of browsers; should match the ordering for
63 // |BrowserProcess| (i.e., |BrowserType|). 60 // |BrowserProcess| (i.e., |BrowserType|).
64 // TODO(viettrungluu): The current setup means that we can't detect both 61 // TODO(viettrungluu): The current setup means that we can't detect both
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if (info.working_set.priv == 0) { 232 if (info.working_set.priv == 0) {
236 scoped_ptr<base::ProcessMetrics> metrics; 233 scoped_ptr<base::ProcessMetrics> metrics;
237 metrics.reset(base::ProcessMetrics::CreateProcessMetrics( 234 metrics.reset(base::ProcessMetrics::CreateProcessMetrics(
238 pid, content::BrowserChildProcessHost::GetPortProvider())); 235 pid, content::BrowserChildProcessHost::GetPortProvider()));
239 metrics->GetWorkingSetKBytes(&info.working_set); 236 metrics->GetWorkingSetKBytes(&info.working_set);
240 } 237 }
241 238
242 // Add the process info to our list. 239 // Add the process info to our list.
243 process_data_[CHROME_BROWSER].processes.push_back(info); 240 process_data_[CHROME_BROWSER].processes.push_back(info);
244 } 241 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details_linux.cc ('k') | chrome/browser/memory_details_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698