OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/file_version_info.h" | 15 #include "base/file_version_info.h" |
16 #include "base/histogram.h" | 16 #include "base/histogram.h" |
17 #include "base/i18n/number_formatting.h" | 17 #include "base/i18n/number_formatting.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/platform_thread.h" | 19 #include "base/platform_thread.h" |
20 #include "base/stats_table.h" | 20 #include "base/stats_table.h" |
| 21 #include "base/string_number_conversions.h" |
21 #include "base/string_piece.h" | 22 #include "base/string_piece.h" |
22 #include "base/string_util.h" | 23 #include "base/string_util.h" |
23 #include "base/thread.h" | 24 #include "base/thread.h" |
24 #include "base/tracked_objects.h" | 25 #include "base/tracked_objects.h" |
25 #include "chrome/browser/browser.h" | 26 #include "chrome/browser/browser.h" |
26 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/chrome_thread.h" | 28 #include "chrome/browser/chrome_thread.h" |
28 #include "chrome/browser/defaults.h" | 29 #include "chrome/browser/defaults.h" |
29 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 30 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
30 #include "chrome/browser/google_service_auth_error.h" | 31 #include "chrome/browser/google_service_auth_error.h" |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 browsers->Append(browser_data); | 990 browsers->Append(browser_data); |
990 browser_data->SetString(L"name", browser_processes[index].name); | 991 browser_data->SetString(L"name", browser_processes[index].name); |
991 | 992 |
992 BindProcessMetrics(browser_data, &aggregate); | 993 BindProcessMetrics(browser_data, &aggregate); |
993 | 994 |
994 // We log memory info as we record it. | 995 // We log memory info as we record it. |
995 if (log_string.length() > 0) | 996 if (log_string.length() > 0) |
996 log_string.append(L", "); | 997 log_string.append(L", "); |
997 log_string.append(browser_processes[index].name); | 998 log_string.append(browser_processes[index].name); |
998 log_string.append(L", "); | 999 log_string.append(L", "); |
999 log_string.append(Int64ToWString(aggregate.working_set.priv)); | 1000 log_string.append(UTF8ToWide( |
| 1001 base::Int64ToString(aggregate.working_set.priv))); |
1000 log_string.append(L", "); | 1002 log_string.append(L", "); |
1001 log_string.append(Int64ToWString(aggregate.working_set.shared)); | 1003 log_string.append(UTF8ToWide( |
| 1004 base::Int64ToString(aggregate.working_set.shared))); |
1002 log_string.append(L", "); | 1005 log_string.append(L", "); |
1003 log_string.append(Int64ToWString(aggregate.working_set.shareable)); | 1006 log_string.append(UTF8ToWide( |
| 1007 base::Int64ToString(aggregate.working_set.shareable))); |
1004 } | 1008 } |
1005 if (log_string.length() > 0) | 1009 if (log_string.length() > 0) |
1006 LOG(INFO) << "memory: " << log_string; | 1010 LOG(INFO) << "memory: " << log_string; |
1007 | 1011 |
1008 // Set the browser & renderer detailed process data. | 1012 // Set the browser & renderer detailed process data. |
1009 DictionaryValue* browser_data = new DictionaryValue(); | 1013 DictionaryValue* browser_data = new DictionaryValue(); |
1010 root.Set(L"browzr_data", browser_data); | 1014 root.Set(L"browzr_data", browser_data); |
1011 ListValue* child_data = new ListValue(); | 1015 ListValue* child_data = new ListValue(); |
1012 root.Set(L"child_data", child_data); | 1016 root.Set(L"child_data", child_data); |
1013 | 1017 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 // Run the dialog. This will re-use the existing one if it's already up. | 1173 // Run the dialog. This will re-use the existing one if it's already up. |
1170 AboutIPCDialog::RunDialog(); | 1174 AboutIPCDialog::RunDialog(); |
1171 return true; | 1175 return true; |
1172 } | 1176 } |
1173 #endif | 1177 #endif |
1174 | 1178 |
1175 #endif // OFFICIAL_BUILD | 1179 #endif // OFFICIAL_BUILD |
1176 | 1180 |
1177 return false; | 1181 return false; |
1178 } | 1182 } |
OLD | NEW |