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

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

Issue 1191793003: [Service Worker Registration] removed protocolIsInHTTPFamily and replaced with SchemeRegistry check (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added shouldAllowServiceWorkers in SchemeRegistry. Used instead of isSecure in ServiceWorkerContai… Created 5 years, 6 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
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Allow non-HTTP schemes to be registered to allow CORS requests. 80 // Allow non-HTTP schemes to be registered to allow CORS requests.
81 static void registerURLSchemeAsCORSEnabled(const String& scheme); 81 static void registerURLSchemeAsCORSEnabled(const String& scheme);
82 static bool shouldTreatURLSchemeAsCORSEnabled(const String& scheme); 82 static bool shouldTreatURLSchemeAsCORSEnabled(const String& scheme);
83 83
84 // Serialize the registered schemes in a comma-separated list. 84 // Serialize the registered schemes in a comma-separated list.
85 static String listOfCORSEnabledURLSchemes(); 85 static String listOfCORSEnabledURLSchemes();
86 86
87 // "Legacy" schemes (e.g. 'ftp:', 'gopher:') which we might want to treat di fferently from "webby" schemes. 87 // "Legacy" schemes (e.g. 'ftp:', 'gopher:') which we might want to treat di fferently from "webby" schemes.
88 static bool shouldTreatURLSchemeAsLegacy(const String& scheme); 88 static bool shouldTreatURLSchemeAsLegacy(const String& scheme);
89 89
90 // Allows 'HTTP/HTTPS' and 'chrome-extension' schemes to register ServiceWor kers
91 static bool shouldAllowServiceWorkers(const String& scheme);
92
90 // Allow resources from some schemes to load on a page, regardless of its 93 // Allow resources from some schemes to load on a page, regardless of its
91 // Content Security Policy. 94 // Content Security Policy.
92 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. 95 // This enum should be kept in sync with public/web/WebSecurityPolicy.h.
93 // Enforced in AssertMatchingEnums.cpp. 96 // Enforced in AssertMatchingEnums.cpp.
94 enum PolicyAreas : uint32_t { 97 enum PolicyAreas : uint32_t {
95 PolicyAreaNone = 0, 98 PolicyAreaNone = 0,
96 PolicyAreaImage = 1 << 0, 99 PolicyAreaImage = 1 << 0,
97 PolicyAreaStyle = 1 << 1, 100 PolicyAreaStyle = 1 << 1,
98 // Add more policy areas as needed by clients. 101 // Add more policy areas as needed by clients.
99 PolicyAreaAll = ~static_cast<uint32_t>(0), 102 PolicyAreaAll = ~static_cast<uint32_t>(0),
100 }; 103 };
101 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas = PolicyAreaAll); 104 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas = PolicyAreaAll);
102 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme); 105 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme);
103 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po licyAreas = PolicyAreaAll); 106 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po licyAreas = PolicyAreaAll);
104 107
105 private: 108 private:
106 static const URLSchemesSet& localSchemes(); 109 static const URLSchemesSet& localSchemes();
107 }; 110 };
108 111
109 } // namespace blink 112 } // namespace blink
110 113
111 #endif // SchemeRegistry_h 114 #endif // SchemeRegistry_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698