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

Side by Side Diff: extensions/browser/extension_navigation_throttle.cc

Issue 2657813004: PlzNavigate: set the error code in NavigationHandle on abort (Closed)
Patch Set: PlzNavigate: set the error code in NavigationHandle on abort Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browser/extension_navigation_throttle.h" 5 #include "extensions/browser/extension_navigation_throttle.h"
6 6
7 #include "components/guest_view/browser/guest_view_base.h" 7 #include "components/guest_view/browser/guest_view_base.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/navigation_handle.h" 9 #include "content/public/browser/navigation_handle.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 std::string resource_path = url.path(); 83 std::string resource_path = url.path();
84 bool is_guest = WebViewGuest::GetGuestPartitionConfigForSite( 84 bool is_guest = WebViewGuest::GetGuestPartitionConfigForSite(
85 navigation_handle()->GetStartingSiteInstance()->GetSiteURL(), 85 navigation_handle()->GetStartingSiteInstance()->GetSiteURL(),
86 &partition_domain, &partition_id, &in_memory); 86 &partition_domain, &partition_id, &in_memory);
87 87
88 bool allowed = true; 88 bool allowed = true;
89 url_request_util::AllowCrossRendererResourceLoadHelper( 89 url_request_util::AllowCrossRendererResourceLoadHelper(
90 is_guest, extension, owner_extension, partition_id, resource_path, 90 is_guest, extension, owner_extension, partition_id, resource_path,
91 navigation_handle()->GetPageTransition(), &allowed); 91 navigation_handle()->GetPageTransition(), &allowed);
92 if (!allowed) 92 if (!allowed)
93 return content::NavigationThrottle::CANCEL; 93 return content::NavigationThrottle::BLOCK_REQUEST;
clamy 2017/01/26 15:33:45 Some tests expect this particular return code when
Devlin 2017/01/26 15:50:17 Which tests? I wonder if the return on line 64 sh
clamy 2017/01/26 15:58:06 The issue was with WebViewTests/WebViewTest.Shim_T
nasko 2017/01/26 17:20:18 Let's ensure that we pick the right error code we
clamy 2017/01/27 17:21:51 I've modified the other return, still letting the
94 } 94 }
95 } 95 }
96 96
97 return content::NavigationThrottle::PROCEED; 97 return content::NavigationThrottle::PROCEED;
98 } 98 }
99 99
100 // Now enforce web_accessible_resources for navigations. Top-level navigations 100 // Now enforce web_accessible_resources for navigations. Top-level navigations
101 // should always be allowed. 101 // should always be allowed.
102 102
103 // If the navigation is not to a chrome-extension:// URL, no need to perform 103 // If the navigation is not to a chrome-extension:// URL, no need to perform
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 if (WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, 155 if (WebAccessibleResourcesInfo::IsResourceWebAccessible(extension,
156 resource_path)) { 156 resource_path)) {
157 return content::NavigationThrottle::PROCEED; 157 return content::NavigationThrottle::PROCEED;
158 } 158 }
159 159
160 return content::NavigationThrottle::BLOCK_REQUEST; 160 return content::NavigationThrottle::BLOCK_REQUEST;
161 } 161 }
162 162
163 } // namespace extensions 163 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698