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

Unified Diff: chrome/common/secure_origin_whitelist.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/secure_origin_whitelist.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/secure_origin_whitelist.cc
diff --git a/chrome/common/secure_origin_whitelist.cc b/chrome/common/secure_origin_whitelist.cc
index 030151272b9d090e16cfa72953b54621d53c60f1..6d35beb473a96c28b344e8bce77e4cf0349f8f49 100644
--- a/chrome/common/secure_origin_whitelist.cc
+++ b/chrome/common/secure_origin_whitelist.cc
@@ -4,14 +4,13 @@
#include "chrome/common/secure_origin_whitelist.h"
-#include <vector>
-
#include "base/command_line.h"
#include "base/strings/string_split.h"
#include "chrome/common/chrome_switches.h"
#include "extensions/common/constants.h"
-void GetSecureOriginWhitelist(std::set<GURL>* origins) {
+std::vector<GURL> GetSecureOriginWhitelist() {
+ std::vector<GURL> origins;
// If kUnsafelyTreatInsecureOriginAsSecure option is given and
// kUserDataDir is present, add the given origins as trustworthy
// for whitelisting.
@@ -23,11 +22,14 @@ void GetSecureOriginWhitelist(std::set<GURL>* origins) {
switches::kUnsafelyTreatInsecureOriginAsSecure);
for (const std::string& origin : base::SplitString(
origins_str, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL))
- origins->insert(GURL(origin));
+ origins.push_back(GURL(origin));
}
+
+ return origins;
}
-void GetSchemesBypassingSecureContextCheckWhitelist(
- std::set<std::string>* schemes) {
- schemes->insert(extensions::kExtensionScheme);
+std::set<std::string> GetSchemesBypassingSecureContextCheckWhitelist() {
+ std::set<std::string> schemes;
+ schemes.insert(extensions::kExtensionScheme);
+ return schemes;
}
« no previous file with comments | « chrome/common/secure_origin_whitelist.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698