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

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

Issue 2622693002: Cleanup of static lists of schemes & origins that are created at startup. (Closed)
Patch Set: merge Created 3 years, 11 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
« no previous file with comments | « content/public/common/url_utils.h ('k') | content/public/test/content_test_suite_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_utils.h" 5 #include "content/public/common/url_utils.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/common/savable_url_schemes.h" 8 #include "content/common/url_schemes.h"
9 #include "content/public/common/url_constants.h" 9 #include "content/public/common/url_constants.h"
10 #include "url/gurl.h"
11 10
12 namespace content { 11 namespace content {
13 12
14 const char* const* GetSavableSchemes() {
15 return GetSavableSchemesInternal();
16 }
17
18 bool HasWebUIScheme(const GURL& url) { 13 bool HasWebUIScheme(const GURL& url) {
19 return url.SchemeIs(kChromeDevToolsScheme) || 14 return url.SchemeIs(kChromeDevToolsScheme) ||
20 url.SchemeIs(kChromeUIScheme); 15 url.SchemeIs(kChromeUIScheme);
21 } 16 }
22 17
23 bool IsSavableURL(const GURL& url) { 18 bool IsSavableURL(const GURL& url) {
24 for (int i = 0; GetSavableSchemes()[i] != NULL; ++i) { 19 for (auto& scheme : GetSavableSchemes()) {
25 if (url.SchemeIs(GetSavableSchemes()[i])) 20 if (url.SchemeIs(scheme))
26 return true; 21 return true;
27 } 22 }
28 return false; 23 return false;
29 } 24 }
30 25
31 } // namespace content 26 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/url_utils.h ('k') | content/public/test/content_test_suite_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698