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

Unified Diff: content/public/common/url_utils.cc

Issue 2622693002: Cleanup of static lists of schemes & origins that are created at startup. (Closed)
Patch Set: use struct 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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/url_utils.cc
diff --git a/content/public/common/url_utils.cc b/content/public/common/url_utils.cc
index 4133cb0154218575c62bd411e7c95b9bc70453b2..f2887524317d8b2156dfae41106c87ca75ba640f 100644
--- a/content/public/common/url_utils.cc
+++ b/content/public/common/url_utils.cc
@@ -5,13 +5,13 @@
#include "content/public/common/url_utils.h"
#include "build/build_config.h"
-#include "content/common/savable_url_schemes.h"
+#include "content/common/url_schemes.h"
#include "content/public/common/url_constants.h"
#include "url/gurl.h"
namespace content {
-const char* const* GetSavableSchemes() {
+const std::vector<std::string>* GetSavableSchemes() {
return GetSavableSchemesInternal();
}
@@ -21,8 +21,9 @@ bool HasWebUIScheme(const GURL& url) {
}
bool IsSavableURL(const GURL& url) {
- for (int i = 0; GetSavableSchemes()[i] != NULL; ++i) {
- if (url.SchemeIs(GetSavableSchemes()[i]))
+ const std::vector<std::string>* savable_schemes = GetSavableSchemesInternal();
+ for (auto& scheme : *savable_schemes) {
+ if (url.SchemeIs(scheme))
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698