| 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 // the root of the JSON hierarchy for about:memory jstemplate | 865 // the root of the JSON hierarchy for about:memory jstemplate |
| 866 DictionaryValue root; | 866 DictionaryValue root; |
| 867 ListValue* browsers = new ListValue(); | 867 ListValue* browsers = new ListValue(); |
| 868 root.Set("browsers", browsers); | 868 root.Set("browsers", browsers); |
| 869 | 869 |
| 870 const std::vector<ProcessData>& browser_processes = processes(); | 870 const std::vector<ProcessData>& browser_processes = processes(); |
| 871 | 871 |
| 872 // Aggregate per-process data into browser summary data. | 872 // Aggregate per-process data into browser summary data. |
| 873 std::wstring log_string; | 873 std::wstring log_string; |
| 874 for (size_t index = 0; index < browser_processes.size(); index++) { | 874 for (size_t index = 0; index < browser_processes.size(); index++) { |
| 875 if (browser_processes[index].processes.size() == 0) | 875 if (browser_processes[index].processes.empty()) |
| 876 continue; | 876 continue; |
| 877 | 877 |
| 878 // Sum the information for the processes within this browser. | 878 // Sum the information for the processes within this browser. |
| 879 ProcessMemoryInformation aggregate; | 879 ProcessMemoryInformation aggregate; |
| 880 ProcessMemoryInformationList::const_iterator iterator; | 880 ProcessMemoryInformationList::const_iterator iterator; |
| 881 iterator = browser_processes[index].processes.begin(); | 881 iterator = browser_processes[index].processes.begin(); |
| 882 aggregate.pid = iterator->pid; | 882 aggregate.pid = iterator->pid; |
| 883 aggregate.version = iterator->version; | 883 aggregate.version = iterator->version; |
| 884 while (iterator != browser_processes[index].processes.end()) { | 884 while (iterator != browser_processes[index].processes.end()) { |
| 885 if (!iterator->is_diagnostics || | 885 if (!iterator->is_diagnostics || |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 return false; | 1129 return false; |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 std::vector<std::string> AboutPaths() { | 1132 std::vector<std::string> AboutPaths() { |
| 1133 std::vector<std::string> paths; | 1133 std::vector<std::string> paths; |
| 1134 paths.reserve(arraysize(kAllAboutPaths)); | 1134 paths.reserve(arraysize(kAllAboutPaths)); |
| 1135 for (size_t i = 0; i < arraysize(kAllAboutPaths); i++) | 1135 for (size_t i = 0; i < arraysize(kAllAboutPaths); i++) |
| 1136 paths.push_back(kAllAboutPaths[i]); | 1136 paths.push_back(kAllAboutPaths[i]); |
| 1137 return paths; | 1137 return paths; |
| 1138 } | 1138 } |
| OLD | NEW |