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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "chrome/browser/net/url_fixer_upper.h" | 13 #include "chrome/browser/net/url_fixer_upper.h" |
14 #include "chrome/browser/ui/browser_dialogs.h" | 14 #include "chrome/browser/ui/browser_dialogs.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "content/public/browser/sensors_provider.h" | 17 #include "content/public/browser/sensors_provider.h" |
18 | 18 |
19 #if defined(USE_TCMALLOC) | |
20 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" | |
21 #endif | |
22 | |
23 namespace { | 19 namespace { |
24 | 20 |
25 // Add paths here to be included in chrome://chrome-urls (about:about). | 21 // Add paths here to be included in chrome://chrome-urls (about:about). |
26 // These paths will also be suggested by BuiltinProvider. | 22 // These paths will also be suggested by BuiltinProvider. |
27 const char* const kChromePaths[] = { | 23 const char* const kChromePaths[] = { |
28 chrome::kChromeUIAppCacheInternalsHost, | 24 chrome::kChromeUIAppCacheInternalsHost, |
29 chrome::kChromeUIBlobInternalsHost, | 25 chrome::kChromeUIBlobInternalsHost, |
30 chrome::kChromeUIBookmarksHost, | 26 chrome::kChromeUIBookmarksHost, |
31 chrome::kChromeUICacheHost, | 27 chrome::kChromeUICacheHost, |
32 chrome::kChromeUIChromeURLsHost, | 28 chrome::kChromeUIChromeURLsHost, |
(...skipping 19 matching lines...) Expand all Loading... |
52 chrome::kChromeUIPluginsHost, | 48 chrome::kChromeUIPluginsHost, |
53 chrome::kChromeUIPolicyHost, | 49 chrome::kChromeUIPolicyHost, |
54 chrome::kChromeUIPrintHost, | 50 chrome::kChromeUIPrintHost, |
55 chrome::kChromeUIProfilerHost, | 51 chrome::kChromeUIProfilerHost, |
56 chrome::kChromeUIQuotaInternalsHost, | 52 chrome::kChromeUIQuotaInternalsHost, |
57 chrome::kChromeUISessionsHost, | 53 chrome::kChromeUISessionsHost, |
58 chrome::kChromeUISettingsHost, | 54 chrome::kChromeUISettingsHost, |
59 chrome::kChromeUIStatsHost, | 55 chrome::kChromeUIStatsHost, |
60 chrome::kChromeUISyncInternalsHost, | 56 chrome::kChromeUISyncInternalsHost, |
61 chrome::kChromeUITaskManagerHost, | 57 chrome::kChromeUITaskManagerHost, |
62 chrome::kChromeUITCMallocHost, | |
63 chrome::kChromeUITermsHost, | 58 chrome::kChromeUITermsHost, |
64 chrome::kChromeUITracingHost, | 59 chrome::kChromeUITracingHost, |
65 chrome::kChromeUIVersionHost, | 60 chrome::kChromeUIVersionHost, |
66 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
67 chrome::kChromeUIConflictsHost, | 62 chrome::kChromeUIConflictsHost, |
68 #endif | 63 #endif |
69 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 64 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
70 chrome::kChromeUILinuxProxyConfigHost, | 65 chrome::kChromeUILinuxProxyConfigHost, |
71 chrome::kChromeUISandboxHost, | 66 chrome::kChromeUISandboxHost, |
72 #endif | 67 #endif |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 180 } |
186 | 181 |
187 std::vector<std::string> ChromePaths() { | 182 std::vector<std::string> ChromePaths() { |
188 std::vector<std::string> paths; | 183 std::vector<std::string> paths; |
189 paths.reserve(arraysize(kChromePaths)); | 184 paths.reserve(arraysize(kChromePaths)); |
190 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 185 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
191 paths.push_back(kChromePaths[i]); | 186 paths.push_back(kChromePaths[i]); |
192 return paths; | 187 return paths; |
193 } | 188 } |
194 | 189 |
195 #if defined(USE_TCMALLOC) | |
196 // static | |
197 AboutTcmallocOutputs* AboutTcmallocOutputs::GetInstance() { | |
198 return Singleton<AboutTcmallocOutputs>::get(); | |
199 } | |
200 | |
201 AboutTcmallocOutputs::AboutTcmallocOutputs() {} | |
202 | |
203 AboutTcmallocOutputs::~AboutTcmallocOutputs() {} | |
204 | |
205 // Glue between the callback task and the method in the singleton. | |
206 void AboutTcmallocRendererCallback(base::ProcessId pid, | |
207 const std::string& output) { | |
208 AboutTcmallocOutputs::GetInstance()->RendererCallback(pid, output); | |
209 } | |
210 #endif | |
OLD | NEW |