OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <psapi.h> | 6 #include <psapi.h> |
7 | 7 |
8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
9 #include "base/histogram.h" | |
10 #include "base/image_util.h" | |
11 #include "base/message_loop.h" | |
12 #include "base/process_util.h" | |
13 #include "base/scoped_ptr.h" | |
14 #include "base/thread.h" | |
15 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
17 #include "chrome/browser/renderer_host/render_process_host.h" | 11 #include "chrome/browser/renderer_host/render_process_host.h" |
18 #include "chrome/browser/renderer_host/render_view_host.h" | |
19 #include "chrome/browser/tab_contents/tab_contents.h" | |
20 #include "chrome/browser/tab_contents/web_contents.h" | 12 #include "chrome/browser/tab_contents/web_contents.h" |
21 #include "chrome/common/child_process_host.h" | 13 #include "chrome/common/child_process_host.h" |
22 | 14 |
23 class RenderViewHostDelegate; | 15 class RenderViewHostDelegate; |
24 | 16 |
25 // Template of static data we use for finding browser process information. | 17 // Template of static data we use for finding browser process information. |
26 // These entries must match the ordering for MemoryDetails::BrowserProcess. | 18 // These entries must match the ordering for MemoryDetails::BrowserProcess. |
27 static ProcessData g_process_template[] = { | 19 static ProcessData g_process_template[] = { |
28 { L"Chromium", L"chrome.exe", }, | 20 { L"Chromium", L"chrome.exe", }, |
29 { L"IE", L"iexplore.exe", }, | 21 { L"IE", L"iexplore.exe", }, |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 268 } |
277 | 269 |
278 UMA_HISTOGRAM_COUNTS_100(L"Memory.ProcessCount", | 270 UMA_HISTOGRAM_COUNTS_100(L"Memory.ProcessCount", |
279 static_cast<int>(browser.processes.size())); | 271 static_cast<int>(browser.processes.size())); |
280 UMA_HISTOGRAM_COUNTS_100(L"Memory.PluginProcessCount", plugin_count); | 272 UMA_HISTOGRAM_COUNTS_100(L"Memory.PluginProcessCount", plugin_count); |
281 UMA_HISTOGRAM_COUNTS_100(L"Memory.WorkerProcessCount", worker_count); | 273 UMA_HISTOGRAM_COUNTS_100(L"Memory.WorkerProcessCount", worker_count); |
282 | 274 |
283 int total_sample = static_cast<int>(aggregate_memory / 1000); | 275 int total_sample = static_cast<int>(aggregate_memory / 1000); |
284 UMA_HISTOGRAM_MEMORY_MB(L"Memory.Total", total_sample); | 276 UMA_HISTOGRAM_MEMORY_MB(L"Memory.Total", total_sample); |
285 } | 277 } |
OLD | NEW |