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

Side by Side Diff: chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc

Issue 2563843002: Restrict app sandbox's CSP to disallow loading web content in them. (Closed)
Patch Set: sync @tott Created 3 years, 11 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 | chrome/browser/extensions/sandboxed_pages_apitest.cc » ('j') | 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 "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (IsIsolateExtensionsEnabled()) { 298 if (IsIsolateExtensionsEnabled()) {
299 const Extension* extension = 299 const Extension* extension =
300 ExtensionRegistry::Get(browser_context) 300 ExtensionRegistry::Get(browser_context)
301 ->enabled_extensions() 301 ->enabled_extensions()
302 .GetExtensionOrAppByURL(effective_site_url); 302 .GetExtensionOrAppByURL(effective_site_url);
303 if (extension) { 303 if (extension) {
304 // Always isolate Chrome Web Store. 304 // Always isolate Chrome Web Store.
305 if (extension->id() == kWebStoreAppId) 305 if (extension->id() == kWebStoreAppId)
306 return true; 306 return true;
307 307
308 // --isolate-extensions should isolate extensions, except for a) hosted 308 // --isolate-extensions should isolate extensions, except for hosted
309 // apps, b) platform apps. 309 // apps. Isolating hosted apps is a good idea, but ought to be a separate
310 // a) Isolating hosted apps is a good idea, but ought to be a separate 310 // knob.
311 // knob. 311 if (extension->is_hosted_app())
312 // b) Sandbox pages in platform app can load web content in iframes;
313 // isolating the app and the iframe leads to StoragePartition mismatch
314 // in the two processes.
315 // TODO(lazyboy): We should deprecate this behaviour and not let web
316 // content load in platform app's process; see http://crbug.com/615585.
317 if (extension->is_hosted_app() || extension->is_platform_app())
318 return false; 312 return false;
319 313
320 // Isolate all extensions. 314 // Isolate all extensions.
321 return true; 315 return true;
322 } 316 }
323 } 317 }
324 return false; 318 return false;
325 } 319 }
326 320
327 // static 321 // static
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 command_line->AppendSwitch(switches::kExtensionProcess); 792 command_line->AppendSwitch(switches::kExtensionProcess);
799 } 793 }
800 } 794 }
801 795
802 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { 796 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() {
803 content::ResourceDispatcherHost::Get()->RegisterInterceptor( 797 content::ResourceDispatcherHost::Get()->RegisterInterceptor(
804 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); 798 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived));
805 } 799 }
806 800
807 } // namespace extensions 801 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/sandboxed_pages_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698