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

Unified Diff: extensions/common/csp_validator.cc

Issue 301033004: replaced the string 'chrome-extensions://' with constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed whitespace before a newline Created 6 years, 7 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/browser/extensions/window_open_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/csp_validator.cc
diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc
index 0ee01168936eb76176efd3dff7e6498cd891c8f0..94f880e7207e92e972e52a08e5f9c444c4bcb457 100644
--- a/extensions/common/csp_validator.cc
+++ b/extensions/common/csp_validator.cc
@@ -9,6 +9,8 @@
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
+#include "content/public/common/url_constants.h"
+#include "extensions/common/constants.h"
namespace extensions {
@@ -71,7 +73,10 @@ bool HasOnlySecureTokens(base::StringTokenizer& tokenizer,
StartsWithASCII(source, "http://localhost:", false) ||
StartsWithASCII(source, "https://", true) ||
StartsWithASCII(source, "chrome://", true) ||
- StartsWithASCII(source, "chrome-extension://", true) ||
+ StartsWithASCII(source,
+ std::string(extensions::kExtensionScheme) +
+ content::kStandardSchemeSeparator,
+ true) ||
StartsWithASCII(source, "chrome-extension-resource:", true)) {
continue;
}
« no previous file with comments | « chrome/browser/extensions/window_open_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698