OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/containers/scoped_ptr_map.h" | 10 #include "base/containers/scoped_ptr_map.h" |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 // The "guestViewDeny" module must always be loaded last. It registers | 1560 // The "guestViewDeny" module must always be loaded last. It registers |
1561 // error-providing custom elements for the GuestView types that are not | 1561 // error-providing custom elements for the GuestView types that are not |
1562 // available, and thus all of those types must have been checked and loaded | 1562 // available, and thus all of those types must have been checked and loaded |
1563 // (or not loaded) beforehand. | 1563 // (or not loaded) beforehand. |
1564 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1564 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
1565 module_system->Require("guestViewDeny"); | 1565 module_system->Require("guestViewDeny"); |
1566 } | 1566 } |
1567 } | 1567 } |
1568 | 1568 |
1569 void Dispatcher::AddChannelSpecificFeatures() { | 1569 void Dispatcher::AddChannelSpecificFeatures() { |
1570 // chrome-extension: resources should be allowed to register a Service Worker. | |
1571 if (FeatureProvider::GetBehaviorFeature(BehaviorFeature::kServiceWorker) | 1570 if (FeatureProvider::GetBehaviorFeature(BehaviorFeature::kServiceWorker) |
1572 ->IsAvailableToEnvironment() | 1571 ->IsAvailableToEnvironment() |
1573 .is_available()) | 1572 .is_available()) { |
1574 WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( | 1573 // If chrome-extension: is allowed to register service workers, register it |
1575 WebString::fromUTF8(kExtensionScheme)); | 1574 // as an allowed scheme for both service workers and the Fetch API. |
| 1575 WebString scheme = WebString::fromUTF8(kExtensionScheme); |
| 1576 WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers(scheme); |
| 1577 WebSecurityPolicy::registerURLSchemeAsSupportingFetchAPI(scheme); |
| 1578 } |
1576 } | 1579 } |
1577 | 1580 |
1578 } // namespace extensions | 1581 } // namespace extensions |
OLD | NEW |