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

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

Issue 2766313002: Allow webview guests to skip WAR checks in ShouldAllowOpenURL. (Closed)
Patch Set: Created 3 years, 9 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 // 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 // Note that this is intentionally done after the check for blob: and 606 // Note that this is intentionally done after the check for blob: and
607 // filesystem: URLs above, for consistency with the renderer-side checks 607 // filesystem: URLs above, for consistency with the renderer-side checks
608 // which already disallow navigations from chrome URLs to blob/filesystem 608 // which already disallow navigations from chrome URLs to blob/filesystem
609 // URLs. 609 // URLs.
610 if (site_url.SchemeIs(content::kChromeUIScheme) || 610 if (site_url.SchemeIs(content::kChromeUIScheme) ||
611 site_url.SchemeIs(chrome::kChromeSearchScheme)) { 611 site_url.SchemeIs(chrome::kChromeSearchScheme)) {
612 *result = true; 612 *result = true;
613 return true; 613 return true;
614 } 614 }
615 615
616 // <webview> guests should be allowed to load only webview-accessible
617 // resources, but that check is done later in
618 // AllowCrossRendererResourceLoadHelper, so allow <webview> guests to proceed
Devlin 2017/03/22 21:58:56 This makes me a bit sad... what would need to happ
alexmos 2017/03/22 23:56:39 I think this one is called on the UI thread only f
619 // here and rely on that check instead. See https://crbug.com/691941.
620 if (site_url.SchemeIs(content::kGuestScheme)) {
621 *result = true;
622 return true;
623 }
624
616 if (WebAccessibleResourcesInfo::IsResourceWebAccessible(to_extension, 625 if (WebAccessibleResourcesInfo::IsResourceWebAccessible(to_extension,
617 to_url.path())) { 626 to_url.path())) {
618 *result = true; 627 *result = true;
619 return true; 628 return true;
620 } 629 }
621 630
622 if (!site_url.SchemeIsHTTPOrHTTPS() && !site_url.SchemeIs(kExtensionScheme)) { 631 if (!site_url.SchemeIsHTTPOrHTTPS() && !site_url.SchemeIs(kExtensionScheme)) {
623 RecordShowAllowOpenURLFailure( 632 RecordShowAllowOpenURLFailure(
624 FAILURE_SCHEME_NOT_HTTP_OR_HTTPS_OR_EXTENSION); 633 FAILURE_SCHEME_NOT_HTTP_OR_HTTPS_OR_EXTENSION);
625 634
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 command_line->AppendSwitch(switches::kExtensionProcess); 805 command_line->AppendSwitch(switches::kExtensionProcess);
797 } 806 }
798 } 807 }
799 808
800 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { 809 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() {
801 content::ResourceDispatcherHost::Get()->RegisterInterceptor( 810 content::ResourceDispatcherHost::Get()->RegisterInterceptor(
802 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); 811 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived));
803 } 812 }
804 813
805 } // namespace extensions 814 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698