| OLD | NEW |
| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 name = rhs.name; | 100 name = rhs.name; |
| 101 process_name = rhs.process_name; | 101 process_name = rhs.process_name; |
| 102 processes = rhs.processes; | 102 processes = rhs.processes; |
| 103 return *this; | 103 return *this; |
| 104 } | 104 } |
| 105 | 105 |
| 106 // About threading: | 106 // About threading: |
| 107 // | 107 // |
| 108 // This operation will hit no fewer than 3 threads. | 108 // This operation will hit no fewer than 3 threads. |
| 109 // | 109 // |
| 110 // The ChildProcessInfo::Iterator can only be accessed from the IO thread. | 110 // The BrowserChildProcessHostIterator can only be accessed from the IO thread. |
| 111 // | 111 // |
| 112 // The RenderProcessHostIterator can only be accessed from the UI thread. | 112 // The RenderProcessHostIterator can only be accessed from the UI thread. |
| 113 // | 113 // |
| 114 // This operation can take 30-100ms to complete. We never want to have | 114 // This operation can take 30-100ms to complete. We never want to have |
| 115 // one task run for that long on the UI or IO threads. So, we run the | 115 // one task run for that long on the UI or IO threads. So, we run the |
| 116 // expensive parts of this operation over on the file thread. | 116 // expensive parts of this operation over on the file thread. |
| 117 // | 117 // |
| 118 void MemoryDetails::StartFetch() { | 118 void MemoryDetails::StartFetch() { |
| 119 // This might get called from the UI or FILE threads, but should not be | 119 // This might get called from the UI or FILE threads, but should not be |
| 120 // getting called from the IO thread. | 120 // getting called from the IO thread. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", | 424 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", |
| 425 pepper_plugin_count); | 425 pepper_plugin_count); |
| 426 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); | 426 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); |
| 427 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); | 427 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); |
| 428 // TODO(viettrungluu): Do we want separate counts for the other | 428 // TODO(viettrungluu): Do we want separate counts for the other |
| 429 // (platform-specific) process types? | 429 // (platform-specific) process types? |
| 430 | 430 |
| 431 int total_sample = static_cast<int>(aggregate_memory / 1000); | 431 int total_sample = static_cast<int>(aggregate_memory / 1000); |
| 432 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); | 432 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); |
| 433 } | 433 } |
| OLD | NEW |