diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-26 10:15:06 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-26 10:15:06 +0000 |
commit | 44495c48060e337c767b8a2ac3c5ee2a69500852 (patch) | |
tree | 0ad9e1c33f113b0b7ad775731be436e8dc153978 | |
parent | 8c482f6539b048bdc0d47eec83ea546bd7ecbcee (diff) | |
download | chromium_src-44495c48060e337c767b8a2ac3c5ee2a69500852.zip chromium_src-44495c48060e337c767b8a2ac3c5ee2a69500852.tar.gz chromium_src-44495c48060e337c767b8a2ac3c5ee2a69500852.tar.bz2 |
Move kDataScheme constant into content namespace.
BUG=None
TEST=None, no functional changes
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/147823002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247171 0039d316-1c4b-4281-b951-d872f2087c98
27 files changed, 29 insertions, 30 deletions
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc index 35793cf..12a0656 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.cc +++ b/android_webview/browser/net/aw_url_request_context_getter.cc @@ -99,7 +99,7 @@ scoped_ptr<net::URLRequestJobFactory> CreateJobFactory( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); DCHECK(set_protocol); set_protocol = aw_job_factory->SetProtocolHandler( - chrome::kDataScheme, new net::DataProtocolHandler()); + content::kDataScheme, new net::DataProtocolHandler()); DCHECK(set_protocol); set_protocol = aw_job_factory->SetProtocolHandler( chrome::kBlobScheme, (*protocol_handlers)[chrome::kBlobScheme].release()); diff --git a/apps/shell/shell_content_browser_client.cc b/apps/shell/shell_content_browser_client.cc index 4217301..8239d47 100644 --- a/apps/shell/shell_content_browser_client.cc +++ b/apps/shell/shell_content_browser_client.cc @@ -69,7 +69,7 @@ bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { chrome::kBlobScheme, chrome::kChromeUIScheme, chrome::kChromeDevToolsScheme, - chrome::kDataScheme, + content::kDataScheme, content::kFileScheme, content::kFileSystemScheme, extensions::kExtensionScheme, diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc index 5bb163c..aea5f7a 100644 --- a/chrome/browser/autocomplete/autocomplete_input.cc +++ b/chrome/browser/autocomplete/autocomplete_input.cc @@ -187,7 +187,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( // we should still claim to handle them. if (LowerCaseEqualsASCII(parsed_scheme, content::kViewSourceScheme) || LowerCaseEqualsASCII(parsed_scheme, content::kJavaScriptScheme) || - LowerCaseEqualsASCII(parsed_scheme, chrome::kDataScheme)) + LowerCaseEqualsASCII(parsed_scheme, content::kDataScheme)) return URL; // Finally, check and see if the user has explicitly opened this scheme as diff --git a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc index a13dc26..b74cceb 100644 --- a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc @@ -61,7 +61,7 @@ TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreWebSafe) { EXPECT_TRUE(IsWebScheme(content::kHttpScheme)); EXPECT_TRUE(IsWebScheme(content::kHttpsScheme)); EXPECT_TRUE(IsWebScheme(content::kFtpScheme)); - EXPECT_TRUE(IsWebScheme(chrome::kDataScheme)); + EXPECT_TRUE(IsWebScheme(content::kDataScheme)); EXPECT_TRUE(IsWebScheme("feed")); EXPECT_TRUE(IsWebScheme(chrome::kBlobScheme)); EXPECT_TRUE(IsWebScheme(content::kFileSystemScheme)); @@ -84,7 +84,7 @@ TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) { EXPECT_FALSE(IsExtensionScheme(content::kHttpScheme)); EXPECT_FALSE(IsExtensionScheme(content::kHttpsScheme)); EXPECT_FALSE(IsExtensionScheme(content::kFtpScheme)); - EXPECT_FALSE(IsExtensionScheme(chrome::kDataScheme)); + EXPECT_FALSE(IsExtensionScheme(content::kDataScheme)); EXPECT_FALSE(IsExtensionScheme("feed")); EXPECT_FALSE(IsExtensionScheme(chrome::kBlobScheme)); EXPECT_FALSE(IsExtensionScheme(content::kFileSystemScheme)); diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index de05b83..a8a0eba 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -94,7 +94,7 @@ GURL GetImageURLFromData(std::string contents) { std::string contents_base64; base::Base64Encode(contents, &contents_base64); - // TODO(dvh): make use of chrome::kDataScheme. Filed as crbug/297301. + // TODO(dvh): make use of content::kDataScheme. Filed as crbug/297301. const char kDataURLPrefix[] = "data:image;base64,"; return GURL(kDataURLPrefix + contents_base64); } diff --git a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc index 54b8409..86aa198 100644 --- a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc +++ b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc @@ -20,7 +20,7 @@ const char* kValidSchemes[] = { content::kFileScheme, content::kFtpScheme, content::kJavaScriptScheme, - chrome::kDataScheme, + content::kDataScheme, content::kFileSystemScheme, }; diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc index d1d73b6..4156f98 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc @@ -424,7 +424,7 @@ static bool MergeOnBeforeRequestResponsesHelper( if ((*delta)->new_url.is_empty()) continue; if (consider_only_cancel_scheme_urls && - !(*delta)->new_url.SchemeIs(chrome::kDataScheme) && + !(*delta)->new_url.SchemeIs(content::kDataScheme) && (*delta)->new_url.spec() != "about:blank") { continue; } diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 31ad820..314f965 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -644,7 +644,7 @@ void IOThread::InitAsync() { TRACE_EVENT_END0("startup", "IOThread::InitAsync:HttpNetworkSession"); scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( new net::URLRequestJobFactoryImpl()); - job_factory->SetProtocolHandler(chrome::kDataScheme, + job_factory->SetProtocolHandler(content::kDataScheme, new net::DataProtocolHandler()); job_factory->SetProtocolHandler( content::kFileScheme, diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index e1e6092..8ab64e6 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -606,7 +606,7 @@ bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { extensions::kExtensionScheme, extensions::kExtensionResourceScheme, chrome::kChromeUIScheme, - chrome::kDataScheme, + content::kDataScheme, #if defined(OS_CHROMEOS) chrome::kDriveScheme, #endif // defined(OS_CHROMEOS) @@ -1015,7 +1015,7 @@ scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( CreateExtensionResourceProtocolHandler()); DCHECK(set_protocol); set_protocol = job_factory->SetProtocolHandler( - chrome::kDataScheme, new net::DataProtocolHandler()); + content::kDataScheme, new net::DataProtocolHandler()); DCHECK(set_protocol); #if defined(OS_CHROMEOS) if (!is_incognito() && profile_params_) { diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc index 93d11de..7ccad03 100644 --- a/chrome/browser/search_engines/template_url_parser.cc +++ b/chrome/browser/search_engines/template_url_parser.cc @@ -246,7 +246,7 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) { break; case TemplateURLParsingContext::IMAGE: { GURL image_url(base::UTF16ToUTF8(context->string_)); - if (image_url.SchemeIs(chrome::kDataScheme)) { + if (image_url.SchemeIs(content::kDataScheme)) { // TODO (jcampan): bug 1169256: when dealing with data URL, we need to // decode the data URL in the renderer. For now, we'll just point to the // favicon from the URL. diff --git a/chrome/browser/ui/views/toolbar/site_chip_view.cc b/chrome/browser/ui/views/toolbar/site_chip_view.cc index a411f3b..9124293 100644 --- a/chrome/browser/ui/views/toolbar/site_chip_view.cc +++ b/chrome/browser/ui/views/toolbar/site_chip_view.cc @@ -237,7 +237,7 @@ base::string16 SiteChipView::SiteLabelFromURL(const GURL& provided_url) { if (url.SchemeIs(chrome::kBlobScheme) || url.SchemeIs(chrome::kChromeDevToolsScheme) || url.SchemeIs(chrome::kChromeNativeScheme) || - url.SchemeIs(chrome::kDataScheme) || + url.SchemeIs(content::kDataScheme) || url.SchemeIs(content::kFileScheme) || url.SchemeIs(content::kFileSystemScheme) || url.SchemeIs(content::kGuestScheme) || diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index 47f5816..7376031 100644 --- a/chrome/renderer/content_settings_observer.cc +++ b/chrome/renderer/content_settings_observer.cc @@ -230,7 +230,7 @@ void ContentSettingsObserver::DidCommitProvisionalLoad(bool is_new_navigation) { // If we start failing this DCHECK, please makes sure we don't regress // this bug: http://code.google.com/p/chromium/issues/detail?id=79304 DCHECK(frame->document().securityOrigin().toString() == "null" || - !url.SchemeIs(chrome::kDataScheme)); + !url.SchemeIs(content::kDataScheme)); } bool ContentSettingsObserver::allowDatabase(WebFrame* frame, diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc index 31a9a56..69249b1 100644 --- a/chrome/renderer/extensions/extension_helper.cc +++ b/chrome/renderer/extensions/extension_helper.cc @@ -334,7 +334,7 @@ void ExtensionHelper::OnGetApplicationInfo(int page_id) { // to decode arbitrary data URLs in the browser process. See // http://b/issue?id=1162972 for (size_t i = 0; i < app_info.icons.size(); ++i) { - if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) { + if (app_info.icons[i].url.SchemeIs(content::kDataScheme)) { app_info.icons.erase(app_info.icons.begin() + i); --i; } diff --git a/chrome/utility/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc index 11b7c22..dd44f5a 100644 --- a/chrome/utility/importer/bookmark_html_reader.cc +++ b/chrome/utility/importer/bookmark_html_reader.cc @@ -57,7 +57,7 @@ void DataURLToFaviconUsage( const GURL& favicon_data, std::vector<ImportedFaviconUsage>* favicons) { if (!link_url.is_valid() || !favicon_data.is_valid() || - !favicon_data.SchemeIs(chrome::kDataScheme)) + !favicon_data.SchemeIs(content::kDataScheme)) return; // Parse the data URL. diff --git a/content/browser/android/load_url_params.cc b/content/browser/android/load_url_params.cc index 57eff2d..2c49e97 100644 --- a/content/browser/android/load_url_params.cc +++ b/content/browser/android/load_url_params.cc @@ -39,7 +39,7 @@ bool RegisterLoadUrlParams(JNIEnv* env) { jboolean IsDataScheme(JNIEnv* env, jclass clazz, jstring jurl) { GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); - return url.SchemeIs(chrome::kDataScheme); + return url.SchemeIs(kDataScheme); } } // namespace content diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index 3b8db44..0b67427 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc @@ -311,7 +311,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() { RegisterWebSafeScheme(kHttpScheme); RegisterWebSafeScheme(kHttpsScheme); RegisterWebSafeScheme(kFtpScheme); - RegisterWebSafeScheme(chrome::kDataScheme); + RegisterWebSafeScheme(kDataScheme); RegisterWebSafeScheme("feed"); RegisterWebSafeScheme(chrome::kBlobScheme); RegisterWebSafeScheme(kFileSystemScheme); diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index b5f7df0..c74294f 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc @@ -123,7 +123,7 @@ TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { EXPECT_TRUE(p->IsWebSafeScheme(kHttpScheme)); EXPECT_TRUE(p->IsWebSafeScheme(kHttpsScheme)); EXPECT_TRUE(p->IsWebSafeScheme(kFtpScheme)); - EXPECT_TRUE(p->IsWebSafeScheme(chrome::kDataScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(kDataScheme)); EXPECT_TRUE(p->IsWebSafeScheme("feed")); EXPECT_TRUE(p->IsWebSafeScheme(chrome::kBlobScheme)); EXPECT_TRUE(p->IsWebSafeScheme(kFileSystemScheme)); diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index 33dd5d0..ae41845 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -1222,7 +1222,7 @@ base::FilePath SavePackage::GetSuggestedNameForSaveAs( // similarly). if (title_ == net::FormatUrl(page_url_, accept_langs)) { std::string url_path; - if (!page_url_.SchemeIs(chrome::kDataScheme)) { + if (!page_url_.SchemeIs(kDataScheme)) { std::vector<std::string> url_parts; base::SplitString(page_url_.path(), '/', &url_parts); if (!url_parts.empty()) { diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index 0526f69..c2ae947 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc @@ -654,7 +654,7 @@ void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) { } break; case LOAD_TYPE_DATA: - if (!params.url.SchemeIs(chrome::kDataScheme)) { + if (!params.url.SchemeIs(kDataScheme)) { NOTREACHED() << "Data load must use data scheme."; return; } diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 7464e6c..d485fd9 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -572,7 +572,7 @@ void RenderViewHostImpl::Navigate(const ViewMsg_Navigate_Params& params) { if (!GetProcess()->IsGuest()) { ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( GetProcess()->GetID(), params.url); - if (params.url.SchemeIs(chrome::kDataScheme) && + if (params.url.SchemeIs(kDataScheme) && params.base_url_for_data_url.SchemeIs(kFileScheme)) { // If 'data:' is used, and we have a 'file:' base url, grant access to // local files. diff --git a/content/common/savable_url_schemes.cc b/content/common/savable_url_schemes.cc index 74f59e6..0880dc6 100644 --- a/content/common/savable_url_schemes.cc +++ b/content/common/savable_url_schemes.cc @@ -20,7 +20,7 @@ const char* const kDefaultSavableSchemes[] = { kFtpScheme, chrome::kChromeDevToolsScheme, chrome::kChromeUIScheme, - chrome::kDataScheme, + kDataScheme, NULL }; diff --git a/content/public/common/url_constants.cc b/content/public/common/url_constants.cc index 8bd370e..a1a4117 100644 --- a/content/public/common/url_constants.cc +++ b/content/public/common/url_constants.cc @@ -13,11 +13,11 @@ const char kBlobScheme[] = "blob"; // There are security implications associated with introducing new schemes. const char kChromeDevToolsScheme[] = "chrome-devtools"; const char kChromeUIScheme[] = "chrome"; -const char kDataScheme[] = "data"; } // namespace chrome namespace content { +const char kDataScheme[] = "data"; const char kFileScheme[] = "file"; const char kFileSystemScheme[] = "filesystem"; const char kFtpScheme[] = "ftp"; diff --git a/content/public/common/url_constants.h b/content/public/common/url_constants.h index 14439cb..5459ce4 100644 --- a/content/public/common/url_constants.h +++ b/content/public/common/url_constants.h @@ -19,11 +19,11 @@ CONTENT_EXPORT extern const char kAboutScheme[]; CONTENT_EXPORT extern const char kBlobScheme[]; CONTENT_EXPORT extern const char kChromeDevToolsScheme[]; CONTENT_EXPORT extern const char kChromeUIScheme[]; // Used for WebUIs. -CONTENT_EXPORT extern const char kDataScheme[]; } // namespace chrome namespace content { +CONTENT_EXPORT extern const char kDataScheme[]; CONTENT_EXPORT extern const char kFileScheme[]; CONTENT_EXPORT extern const char kFileSystemScheme[]; CONTENT_EXPORT extern const char kFtpScheme[]; diff --git a/content/renderer/image_loading_helper.cc b/content/renderer/image_loading_helper.cc index 8f403bb..a1d6f94 100644 --- a/content/renderer/image_loading_helper.cc +++ b/content/renderer/image_loading_helper.cc @@ -110,7 +110,7 @@ void ImageLoadingHelper::OnDownloadImage(int id, uint32_t max_image_size) { std::vector<SkBitmap> result_images; std::vector<gfx::Size> result_original_image_sizes; - if (image_url.SchemeIs(chrome::kDataScheme)) { + if (image_url.SchemeIs(kDataScheme)) { SkBitmap data_image = ImageFromDataUrl(image_url); if (!data_image.empty()) { result_images.push_back(ResizeImage(data_image, max_image_size)); diff --git a/content/renderer/web_ui_extension.cc b/content/renderer/web_ui_extension.cc index b49241e..fe2fea7 100644 --- a/content/renderer/web_ui_extension.cc +++ b/content/renderer/web_ui_extension.cc @@ -93,7 +93,7 @@ bool WebUIExtensionWrapper::ShouldRespondToRequest( bool webui_enabled = (render_view->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI) && (frame_url.SchemeIs(chrome::kChromeUIScheme) || - frame_url.SchemeIs(chrome::kDataScheme)); + frame_url.SchemeIs(kDataScheme)); if (!webui_enabled) return false; diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc index 7b39919..53eb7f7 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc @@ -183,7 +183,7 @@ bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { kFileSystemScheme, chrome::kChromeUIScheme, chrome::kChromeDevToolsScheme, - chrome::kDataScheme, + kDataScheme, kFileScheme, }; for (size_t i = 0; i < arraysize(kProtocolList); ++i) { diff --git a/content/shell/browser/shell_url_request_context_getter.cc b/content/shell/browser/shell_url_request_context_getter.cc index 5ec8f23..bd5c937 100644 --- a/content/shell/browser/shell_url_request_context_getter.cc +++ b/content/shell/browser/shell_url_request_context_getter.cc @@ -205,8 +205,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { // ShellContentBrowserClient::IsHandledURL(). InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); bool set_protocol = job_factory->SetProtocolHandler( - chrome::kDataScheme, - new net::DataProtocolHandler); + kDataScheme, new net::DataProtocolHandler); DCHECK(set_protocol); set_protocol = job_factory->SetProtocolHandler( kFileScheme, |