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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 1310953003: Enable the Fetch API for extensions which service workers are supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698