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

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: Comments Created 5 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 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 // Schemes that can register a service worker.
91 static void registerURLSchemeAsAllowingServiceWorkers(const String& scheme);
92 static bool shouldTreatURLSchemeAsAllowingServiceWorkers(const String& schem e);
93
90 // Allow resources from some schemes to load on a page, regardless of its 94 // Allow resources from some schemes to load on a page, regardless of its
91 // Content Security Policy. 95 // Content Security Policy.
92 // This enum should be kept in sync with public/web/WebSecurityPolicy.h. 96 // This enum should be kept in sync with public/web/WebSecurityPolicy.h.
93 // Enforced in AssertMatchingEnums.cpp. 97 // Enforced in AssertMatchingEnums.cpp.
94 enum PolicyAreas : uint32_t { 98 enum PolicyAreas : uint32_t {
95 PolicyAreaNone = 0, 99 PolicyAreaNone = 0,
96 PolicyAreaImage = 1 << 0, 100 PolicyAreaImage = 1 << 0,
97 PolicyAreaStyle = 1 << 1, 101 PolicyAreaStyle = 1 << 1,
98 // Add more policy areas as needed by clients. 102 // Add more policy areas as needed by clients.
99 PolicyAreaAll = ~static_cast<uint32_t>(0), 103 PolicyAreaAll = ~static_cast<uint32_t>(0),
100 }; 104 };
101 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas = PolicyAreaAll); 105 static void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas = PolicyAreaAll);
102 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme); 106 static void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme);
103 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po licyAreas = PolicyAreaAll); 107 static bool schemeShouldBypassContentSecurityPolicy(const String& scheme, Po licyAreas = PolicyAreaAll);
104 108
105 private: 109 private:
106 static const URLSchemesSet& localSchemes(); 110 static const URLSchemesSet& localSchemes();
107 }; 111 };
108 112
109 } // namespace blink 113 } // namespace blink
110 114
111 #endif // SchemeRegistry_h 115 #endif // SchemeRegistry_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerContainer.cpp ('k') | Source/platform/weborigin/SchemeRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698