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

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

Issue 1305253012: Allow 'chrome-extension:' URLs to bypass content settings (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/platform/weborigin/SchemeRegistry.h ('k') | Source/web/WebSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/weborigin/SchemeRegistry.cpp
diff --git a/Source/platform/weborigin/SchemeRegistry.cpp b/Source/platform/weborigin/SchemeRegistry.cpp
index 099dbbb17a03895397bf9870779e686e6c41353c..46964fa41cf75e84717c4e74ee3e34721516e65c 100644
--- a/Source/platform/weborigin/SchemeRegistry.cpp
+++ b/Source/platform/weborigin/SchemeRegistry.cpp
@@ -189,6 +189,13 @@ static URLSchemesSet& fetchAPISchemes()
return fetchAPISchemes;
}
+static URLSchemesSet& firstPartyWhenTopLevelSchemes()
+{
+ assertLockHeld();
+ DEFINE_STATIC_LOCAL_NOASSERT(URLSchemesSet, firstPartyWhenTopLevelSchemes, ());
+ return firstPartyWhenTopLevelSchemes;
+}
+
static URLSchemesMap<SchemeRegistry::PolicyAreas>& ContentSecurityPolicyBypassingSchemes()
{
assertLockHeld();
@@ -380,6 +387,20 @@ bool SchemeRegistry::shouldTreatURLSchemeAsSupportingFetchAPI(const String& sche
return fetchAPISchemes().contains(scheme);
}
+void SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel(const String& scheme)
+{
+ MutexLocker locker(mutex());
+ firstPartyWhenTopLevelSchemes().add(scheme);
+}
+
+bool SchemeRegistry::shouldTreatURLSchemeAsFirstPartyWhenTopLevel(const String& scheme)
+{
+ if (scheme.isEmpty())
+ return false;
+ MutexLocker locker(mutex());
+ return firstPartyWhenTopLevelSchemes().contains(scheme);
+}
+
void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas policyAreas)
{
MutexLocker locker(mutex());
« no previous file with comments | « Source/platform/weborigin/SchemeRegistry.h ('k') | Source/web/WebSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698