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

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

Issue 1351313002: Allow 'chrome-extension:' URLs to bypass content settings (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
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 | « 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // allowed to receive CORS requests. 271 // allowed to receive CORS requests.
272 WebSecurityPolicy::registerURLSchemeAsCORSEnabled(extension_scheme); 272 WebSecurityPolicy::registerURLSchemeAsCORSEnabled(extension_scheme);
273 WebSecurityPolicy::registerURLSchemeAsCORSEnabled(extension_resource_scheme); 273 WebSecurityPolicy::registerURLSchemeAsCORSEnabled(extension_resource_scheme);
274 274
275 // chrome-extension: resources should bypass Content Security Policy checks 275 // chrome-extension: resources should bypass Content Security Policy checks
276 // when included in protected resources. 276 // when included in protected resources.
277 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( 277 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
278 extension_scheme); 278 extension_scheme);
279 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( 279 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
280 extension_resource_scheme); 280 extension_resource_scheme);
281
282 // Extension resources, when loaded as the top-level document, should
283 // bypass Blink's strict first-party origin checks.
284 WebSecurityPolicy::registerURLSchemeAsFirstPartyWhenTopLevel(
285 extension_scheme);
286 WebSecurityPolicy::registerURLSchemeAsFirstPartyWhenTopLevel(
287 extension_resource_scheme);
281 } 288 }
282 289
283 Dispatcher::~Dispatcher() { 290 Dispatcher::~Dispatcher() {
284 } 291 }
285 292
286 void Dispatcher::OnRenderFrameCreated(content::RenderFrame* render_frame) { 293 void Dispatcher::OnRenderFrameCreated(content::RenderFrame* render_frame) {
287 script_injection_manager_->OnRenderFrameCreated(render_frame); 294 script_injection_manager_->OnRenderFrameCreated(render_frame);
288 } 295 }
289 296
290 bool Dispatcher::IsExtensionActive(const std::string& extension_id) const { 297 bool Dispatcher::IsExtensionActive(const std::string& extension_id) const {
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 void Dispatcher::AddChannelSpecificFeatures() { 1592 void Dispatcher::AddChannelSpecificFeatures() {
1586 // chrome-extension: resources should be allowed to register a Service Worker. 1593 // chrome-extension: resources should be allowed to register a Service Worker.
1587 if (FeatureProvider::GetBehaviorFeature(BehaviorFeature::kServiceWorker) 1594 if (FeatureProvider::GetBehaviorFeature(BehaviorFeature::kServiceWorker)
1588 ->IsAvailableToEnvironment() 1595 ->IsAvailableToEnvironment()
1589 .is_available()) 1596 .is_available())
1590 WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( 1597 WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers(
1591 WebString::fromUTF8(kExtensionScheme)); 1598 WebString::fromUTF8(kExtensionScheme));
1592 } 1599 }
1593 1600
1594 } // namespace extensions 1601 } // 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