| 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/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // you have another about:memory tab open (which would be committed), | 228 // you have another about:memory tab open (which would be committed), |
| 229 // we don't want to count it either, so we also check the last committed | 229 // we don't want to count it either, so we also check the last committed |
| 230 // entry. | 230 // entry. |
| 231 // | 231 // |
| 232 // Either the pending or last committed entries can be NULL. | 232 // Either the pending or last committed entries can be NULL. |
| 233 const NavigationEntry* pending_entry = NULL; | 233 const NavigationEntry* pending_entry = NULL; |
| 234 //contents->controller()->GetPendingEntry(); | 234 //contents->controller()->GetPendingEntry(); |
| 235 const NavigationEntry* last_committed_entry = | 235 const NavigationEntry* last_committed_entry = |
| 236 contents->controller()->GetLastCommittedEntry(); | 236 contents->controller()->GetLastCommittedEntry(); |
| 237 if ((last_committed_entry && | 237 if ((last_committed_entry && |
| 238 LowerCaseEqualsASCII(last_committed_entry->display_url().spec(), | 238 LowerCaseEqualsASCII(last_committed_entry->display_url().spec(), |
| 239 chrome::kAboutMemoryURL)) || | 239 chrome::kAboutMemoryURL)) || |
| 240 (pending_entry && | 240 (pending_entry && |
| 241 LowerCaseEqualsASCII(pending_entry->display_url().spec(), | 241 LowerCaseEqualsASCII(pending_entry->display_url().spec(), |
| 242 chrome::kAboutMemoryURL))) | 242 chrome::kAboutMemoryURL))) |
| 243 process.is_diagnostics = true; | 243 process.is_diagnostics = true; |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 // Get rid of other Chrome processes that are from a different profile. | 248 // Get rid of other Chrome processes that are from a different profile. |
| 249 for (size_t index = 0; index < process_data_[CHROME_BROWSER].processes.size(); | 249 for (size_t index = 0; index < process_data_[CHROME_BROWSER].processes.size(); |
| 250 index++) { | 250 index++) { |
| 251 if (process_data_[CHROME_BROWSER].processes[index].type == | 251 if (process_data_[CHROME_BROWSER].processes[index].type == |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 291 } |
| 292 | 292 |
| 293 UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount", | 293 UMA_HISTOGRAM_COUNTS_100("Memory.ProcessCount", |
| 294 static_cast<int>(browser.processes.size())); | 294 static_cast<int>(browser.processes.size())); |
| 295 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count); | 295 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count); |
| 296 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); | 296 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); |
| 297 | 297 |
| 298 int total_sample = static_cast<int>(aggregate_memory / 1000); | 298 int total_sample = static_cast<int>(aggregate_memory / 1000); |
| 299 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); | 299 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); |
| 300 } | 300 } |
| OLD | NEW |