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

Unified Diff: Source/platform/weborigin/SchemeRegistry.cpp

Issue 389053003: Always report access control failure if accessing unsupported URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Include supported schemes in console error message Created 6 years, 5 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: Source/platform/weborigin/SchemeRegistry.cpp
diff --git a/Source/platform/weborigin/SchemeRegistry.cpp b/Source/platform/weborigin/SchemeRegistry.cpp
index 1b9134e966bf33887396874b7854239d27ab6f65..96cc09357431a742dd93683a9a45875050dee0c3 100644
--- a/Source/platform/weborigin/SchemeRegistry.cpp
+++ b/Source/platform/weborigin/SchemeRegistry.cpp
@@ -28,6 +28,7 @@
#include "platform/weborigin/SchemeRegistry.h"
#include "wtf/MainThread.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -256,6 +257,23 @@ bool SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(const String& scheme)
return CORSEnabledSchemes().contains(scheme);
}
+String SchemeRegistry::listOfCORSEnabledURLSchemes()
+{
+ StringBuilder builder;
+ const URLSchemesMap& corsEnabledSchemes = CORSEnabledSchemes();
+
+ bool addSeparator = false;
+ for (URLSchemesMap::const_iterator it = corsEnabledSchemes.begin(); it != corsEnabledSchemes.end(); ++it) {
+ if (addSeparator)
+ builder.append(", ");
+ else
+ addSeparator = true;
+
+ builder.append(*it);
+ }
+ return builder.toString();
+}
+
void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme)
{
ContentSecurityPolicyBypassingSchemes().add(scheme);
« Source/platform/weborigin/SchemeRegistry.h ('K') | « Source/platform/weborigin/SchemeRegistry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698