 Chromium Code Reviews
 Chromium Code Reviews Issue 2881733006:
  ExtensionNavigationThrottle: Enforce the same rules on redirect as we  (Closed)
    
  
    Issue 2881733006:
  ExtensionNavigationThrottle: Enforce the same rules on redirect as we  (Closed) 
  | Index: extensions/browser/extension_navigation_throttle.cc | 
| diff --git a/extensions/browser/extension_navigation_throttle.cc b/extensions/browser/extension_navigation_throttle.cc | 
| index 37ead6b0182a5c7869ac4802805a5671b8542f09..59761df67e22c5ae26849d8e88661b730967010a 100644 | 
| --- a/extensions/browser/extension_navigation_throttle.cc | 
| +++ b/extensions/browser/extension_navigation_throttle.cc | 
| @@ -32,7 +32,7 @@ ExtensionNavigationThrottle::ExtensionNavigationThrottle( | 
| ExtensionNavigationThrottle::~ExtensionNavigationThrottle() {} | 
| content::NavigationThrottle::ThrottleCheckResult | 
| -ExtensionNavigationThrottle::WillStartRequest() { | 
| +ExtensionNavigationThrottle::WillStartOrRedirectRequest() { | 
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 
| content::WebContents* web_contents = navigation_handle()->GetWebContents(); | 
| ExtensionRegistry* registry = | 
| @@ -153,6 +153,22 @@ ExtensionNavigationThrottle::WillStartRequest() { | 
| return content::NavigationThrottle::PROCEED; | 
| } | 
| +content::NavigationThrottle::ThrottleCheckResult | 
| +ExtensionNavigationThrottle::WillStartRequest() { | 
| + return WillStartOrRedirectRequest(); | 
| +} | 
| + | 
| +content::NavigationThrottle::ThrottleCheckResult | 
| +ExtensionNavigationThrottle::WillRedirectRequest() { | 
| + ThrottleCheckResult result = WillStartOrRedirectRequest(); | 
| + if (result == BLOCK_REQUEST) { | 
| + // BLOCK_REQUEST is on redirect does not work without PlzNavigate, so | 
| 
Devlin
2017/05/18 15:22:44
s/is on/on
Should this be a TODO?  And should we
 
ncarter (slow)
2017/05/22 22:55:59
Added a TODO.
The least risky thing to do, I thin
 | 
| + // translate these errors into CANCEL. | 
| + return CANCEL; | 
| + } | 
| + return result; | 
| +} | 
| + | 
| const char* ExtensionNavigationThrottle::GetNameForLogging() { | 
| return "ExtensionNavigationThrottle"; | 
| } |