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" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 content::BrowserContext* browser_context) { | 92 content::BrowserContext* browser_context) { |
93 // TODO(msw): Eliminate "about:*" constants and literals from code and tests, | 93 // TODO(msw): Eliminate "about:*" constants and literals from code and tests, |
94 // then hopefully we can remove this forced fixup. | 94 // then hopefully we can remove this forced fixup. |
95 *url = URLFixerUpper::FixupURL(url->possibly_invalid_spec(), std::string()); | 95 *url = URLFixerUpper::FixupURL(url->possibly_invalid_spec(), std::string()); |
96 | 96 |
97 // Check that about: URLs are fixed up to chrome: by URLFixerUpper::FixupURL. | 97 // Check that about: URLs are fixed up to chrome: by URLFixerUpper::FixupURL. |
98 DCHECK((*url == GURL(chrome::kAboutBlankURL)) || | 98 DCHECK((*url == GURL(chrome::kAboutBlankURL)) || |
99 !url->SchemeIs(chrome::kAboutScheme)); | 99 !url->SchemeIs(chrome::kAboutScheme)); |
100 | 100 |
101 // Only handle chrome://foo/, URLFixerUpper::FixupURL translates about:foo. | 101 // Only handle chrome://foo/, URLFixerUpper::FixupURL translates about:foo. |
102 // TAB_CONTENTS_WEB handles about:blank, which frames are allowed to access. | |
103 if (!url->SchemeIs(chrome::kChromeUIScheme)) | 102 if (!url->SchemeIs(chrome::kChromeUIScheme)) |
104 return false; | 103 return false; |
105 | 104 |
106 std::string host(url->host()); | 105 std::string host(url->host()); |
107 std::string path; | 106 std::string path; |
108 // Replace about with chrome-urls. | 107 // Replace about with chrome-urls. |
109 if (host == chrome::kChromeUIAboutHost) | 108 if (host == chrome::kChromeUIAboutHost) |
110 host = chrome::kChromeUIChromeURLsHost; | 109 host = chrome::kChromeUIChromeURLsHost; |
111 // Replace cache with view-http-cache. | 110 // Replace cache with view-http-cache. |
112 if (host == chrome::kChromeUICacheHost) { | 111 if (host == chrome::kChromeUICacheHost) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 AboutTcmallocOutputs::AboutTcmallocOutputs() {} | 201 AboutTcmallocOutputs::AboutTcmallocOutputs() {} |
203 | 202 |
204 AboutTcmallocOutputs::~AboutTcmallocOutputs() {} | 203 AboutTcmallocOutputs::~AboutTcmallocOutputs() {} |
205 | 204 |
206 // Glue between the callback task and the method in the singleton. | 205 // Glue between the callback task and the method in the singleton. |
207 void AboutTcmallocRendererCallback(base::ProcessId pid, | 206 void AboutTcmallocRendererCallback(base::ProcessId pid, |
208 const std::string& output) { | 207 const std::string& output) { |
209 AboutTcmallocOutputs::GetInstance()->RendererCallback(pid, output); | 208 AboutTcmallocOutputs::GetInstance()->RendererCallback(pid, output); |
210 } | 209 } |
211 #endif | 210 #endif |
OLD | NEW |