Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: content/public/common/url_constants.cc

Issue 9349010: Move handling of debug urls like chrome://crash, chrome://gpuclean to content. These are for test... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/public/common/url_constants.h" 5 #include "content/public/common/url_constants.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "googleurl/src/url_util.h" 8 #include "googleurl/src/url_util.h"
9 9
10 namespace { 10 namespace {
11 const char* kDefaultSavableSchemes[] = { 11 const char* kDefaultSavableSchemes[] = {
12 chrome::kHttpScheme, 12 chrome::kHttpScheme,
13 chrome::kHttpsScheme, 13 chrome::kHttpsScheme,
14 chrome::kFileScheme, 14 chrome::kFileScheme,
15 chrome::kFtpScheme, 15 chrome::kFtpScheme,
16 chrome::kChromeDevToolsScheme, 16 chrome::kChromeDevToolsScheme,
17 chrome::kChromeUIScheme, 17 chrome::kChromeUIScheme,
18 NULL 18 NULL
19 }; 19 };
20 char** g_savable_schemes = const_cast<char**>(kDefaultSavableSchemes); 20 char** g_savable_schemes = const_cast<char**>(kDefaultSavableSchemes);
21 } // namespace 21 } // namespace
22 22
23 namespace chrome { 23 namespace chrome {
Elliot Glaysher 2012/02/08 01:06:35 I guess we already have chrome all over here, huh?
jam 2012/02/08 01:20:14 yeah we need to rename this namespace to chrome. i
24 24
25 const char kAboutScheme[] = "about"; 25 const char kAboutScheme[] = "about";
26 const char kBlobScheme[] = "blob"; 26 const char kBlobScheme[] = "blob";
27 27
28 // Before adding new chrome schemes please check with security@chromium.org. 28 // Before adding new chrome schemes please check with security@chromium.org.
29 // There are security implications associated with introducing new schemes. 29 // There are security implications associated with introducing new schemes.
30 const char kChromeDevToolsScheme[] = "chrome-devtools"; 30 const char kChromeDevToolsScheme[] = "chrome-devtools";
31 const char kChromeInternalScheme[] = "chrome-internal"; 31 const char kChromeInternalScheme[] = "chrome-internal";
32 const char kChromeUIScheme[] = "chrome"; 32 const char kChromeUIScheme[] = "chrome";
33 const char kDataScheme[] = "data"; 33 const char kDataScheme[] = "data";
34 const char kFileScheme[] = "file"; 34 const char kFileScheme[] = "file";
35 const char kFileSystemScheme[] = "filesystem"; 35 const char kFileSystemScheme[] = "filesystem";
36 const char kFtpScheme[] = "ftp"; 36 const char kFtpScheme[] = "ftp";
37 const char kHttpScheme[] = "http"; 37 const char kHttpScheme[] = "http";
38 const char kHttpsScheme[] = "https"; 38 const char kHttpsScheme[] = "https";
39 const char kJavaScriptScheme[] = "javascript"; 39 const char kJavaScriptScheme[] = "javascript";
40 const char kMailToScheme[] = "mailto"; 40 const char kMailToScheme[] = "mailto";
41 const char kMetadataScheme[] = "metadata"; 41 const char kMetadataScheme[] = "metadata";
42 const char kViewSourceScheme[] = "view-source"; 42 const char kViewSourceScheme[] = "view-source";
43 43
44 const char kStandardSchemeSeparator[] = "://"; 44 const char kStandardSchemeSeparator[] = "://";
45 45
46 const char kAboutBlankURL[] = "about:blank"; 46 const char kAboutBlankURL[] = "about:blank";
47 const char kAboutCrashURL[] = "about:crash"; 47 const char kChromeUIBrowserCrashHost[] = "inducebrowsercrashforrealz";
48 const char kChromeUICrashURL[] = "chrome://crash/";
49 const char kChromeUIGpuCleanURL[] = "chrome://gpuclean";
50 const char kChromeUIGpuCrashURL[] = "chrome://gpucrash";
51 const char kChromeUIGpuHangURL[] = "chrome://gpuhang";
52 const char kChromeUIHangURL[] = "chrome://hang/";
53 const char kChromeUIKillURL[] = "chrome://kill/";
54 const char kChromeUIShorthangURL[] = "chrome://shorthang/";
48 55
Avi (use Gerrit) 2012/02/08 03:46:41 Why do some of these end with a slash and some do
49 const char kUnreachableWebDataURL[] = "chrome://chromewebdata/"; 56 const char kUnreachableWebDataURL[] = "chrome://chromewebdata/";
50 57
51 const char** GetSavableSchemes() { 58 const char** GetSavableSchemes() {
52 return const_cast<const char**>(g_savable_schemes); 59 return const_cast<const char**>(g_savable_schemes);
53 } 60 }
54 61
55 void RegisterContentSchemes(const char** additional_savable_schemes) { 62 void RegisterContentSchemes(const char** additional_savable_schemes) {
56 // Don't need "chrome-internal" which was used in old versions of Chrome for 63 // Don't need "chrome-internal" which was used in old versions of Chrome for
57 // the new tab page. 64 // the new tab page.
58 url_util::AddStandardScheme(kChromeDevToolsScheme); 65 url_util::AddStandardScheme(kChromeDevToolsScheme);
(...skipping 19 matching lines...) Expand all
78 arraysize(kDefaultSavableSchemes) * sizeof(char*)); 85 arraysize(kDefaultSavableSchemes) * sizeof(char*));
79 for (int i = 0; i < schemes; ++i) { 86 for (int i = 0; i < schemes; ++i) {
80 g_savable_schemes[arraysize(kDefaultSavableSchemes) + i - 1] = 87 g_savable_schemes[arraysize(kDefaultSavableSchemes) + i - 1] =
81 base::strdup(additional_savable_schemes[i]); 88 base::strdup(additional_savable_schemes[i]);
82 } 89 }
83 g_savable_schemes[arraysize(kDefaultSavableSchemes) + schemes - 1] = 0; 90 g_savable_schemes[arraysize(kDefaultSavableSchemes) + schemes - 1] = 0;
84 } 91 }
85 } 92 }
86 93
87 } // namespace chrome 94 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698