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

Side by Side Diff: Source/platform/weborigin/SchemeRegistry.h

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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/platform/weborigin/SchemeRegistry.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 static bool shouldTreatURLSchemeAsLegacy(const String& scheme); 88 static bool shouldTreatURLSchemeAsLegacy(const String& scheme);
89 89
90 // Schemes that can register a service worker. 90 // Schemes that can register a service worker.
91 static void registerURLSchemeAsAllowingServiceWorkers(const String& scheme); 91 static void registerURLSchemeAsAllowingServiceWorkers(const String& scheme);
92 static bool shouldTreatURLSchemeAsAllowingServiceWorkers(const String& schem e); 92 static bool shouldTreatURLSchemeAsAllowingServiceWorkers(const String& schem e);
93 93
94 // HTTP-like schemes that are treated as supporting the Fetch API. 94 // HTTP-like schemes that are treated as supporting the Fetch API.
95 static void registerURLSchemeAsSupportingFetchAPI(const String& scheme); 95 static void registerURLSchemeAsSupportingFetchAPI(const String& scheme);
96 static bool shouldTreatURLSchemeAsSupportingFetchAPI(const String& scheme); 96 static bool shouldTreatURLSchemeAsSupportingFetchAPI(const String& scheme);
97 97
98 // Schemes which override the first-/third-party checks on a Document.
99 static void registerURLSchemeAsFirstPartyWhenTopLevel(const String& scheme);
100 static bool shouldTreatURLSchemeAsFirstPartyWhenTopLevel(const String& schem e);
101
98 // Allow resources from some schemes to load on a page, regardless of its 102 // Allow resources from some schemes to load on a page, regardless of its
99 // Content Security Policy. 103 // Content Security Policy.
100 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. 104 // This enum should be kept in sync with public/web/WebSecurityPolicy.h.
101 // Enforced in AssertMatchingEnums.cpp. 105 // Enforced in AssertMatchingEnums.cpp.
102 enum PolicyAreas : uint32_t { 106 enum PolicyAreas : uint32_t {
103 PolicyAreaNone = 0, 107 PolicyAreaNone = 0,
104 PolicyAreaImage = 1 << 0, 108 PolicyAreaImage = 1 << 0,
105 PolicyAreaStyle = 1 << 1, 109 PolicyAreaStyle = 1 << 1,
106 // Add more policy areas as needed by clients. 110 // Add more policy areas as needed by clients.
107 PolicyAreaAll = ~static_cast<uint32_t>(0), 111 PolicyAreaAll = ~static_cast<uint32_t>(0),
108 }; 112 };
109 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas = PolicyAreaAll); 113 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas = PolicyAreaAll);
110 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme); 114 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme);
111 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po licyAreas = PolicyAreaAll); 115 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po licyAreas = PolicyAreaAll);
112 116
113 private: 117 private:
114 static const URLSchemesSet& localSchemes(); 118 static const URLSchemesSet& localSchemes();
115 }; 119 };
116 120
117 } // namespace blink 121 } // namespace blink
118 122
119 #endif // SchemeRegistry_h 123 #endif // SchemeRegistry_h
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/platform/weborigin/SchemeRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698