| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // Collect the list of child processes. | 91 // Collect the list of child processes. |
| 92 for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) { | 92 for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) { |
| 93 ProcessMemoryInformation info; | 93 ProcessMemoryInformation info; |
| 94 info.pid = base::GetProcId(iter->handle()); | 94 info.pid = base::GetProcId(iter->handle()); |
| 95 if (!info.pid) | 95 if (!info.pid) |
| 96 continue; | 96 continue; |
| 97 | 97 |
| 98 info.type = iter->type(); | 98 info.type = iter->type(); |
| 99 info.renderer_type = iter->renderer_type(); | 99 info.renderer_type = iter->renderer_type(); |
| 100 info.titles.push_back(WideToUTF16Hack(iter->name())); | 100 info.titles.push_back(iter->name()); |
| 101 child_info.push_back(info); | 101 child_info.push_back(info); |
| 102 } | 102 } |
| 103 | 103 |
| 104 // Now go do expensive memory lookups from the file thread. | 104 // Now go do expensive memory lookups from the file thread. |
| 105 BrowserThread::PostTask( | 105 BrowserThread::PostTask( |
| 106 BrowserThread::FILE, FROM_HERE, | 106 BrowserThread::FILE, FROM_HERE, |
| 107 NewRunnableMethod(this, &MemoryDetails::CollectProcessData, child_info)); | 107 NewRunnableMethod(this, &MemoryDetails::CollectProcessData, child_info)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void MemoryDetails::CollectChildInfoOnUIThread() { | 110 void MemoryDetails::CollectChildInfoOnUIThread() { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", | 359 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", |
| 360 pepper_plugin_count); | 360 pepper_plugin_count); |
| 361 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); | 361 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); |
| 362 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); | 362 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); |
| 363 // TODO(viettrungluu): Do we want separate counts for the other | 363 // TODO(viettrungluu): Do we want separate counts for the other |
| 364 // (platform-specific) process types? | 364 // (platform-specific) process types? |
| 365 | 365 |
| 366 int total_sample = static_cast<int>(aggregate_memory / 1000); | 366 int total_sample = static_cast<int>(aggregate_memory / 1000); |
| 367 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); | 367 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); |
| 368 } | 368 } |
| OLD | NEW |