Chromium Code Reviews| Index: content/browser/frame_host/navigation_handle_impl.cc |
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc |
| index de17b3247fe2833c2391349fcde9bb32c57d688e..b9a646ef300003fc0564027d4e3b9974532ec6af 100644 |
| --- a/content/browser/frame_host/navigation_handle_impl.cc |
| +++ b/content/browser/frame_host/navigation_handle_impl.cc |
| @@ -6,6 +6,7 @@ |
| #include <utility> |
| +#include "content/browser/frame_host/ancestor_throttle.h" |
| #include "content/browser/frame_host/frame_tree_node.h" |
| #include "content/browser/frame_host/navigator.h" |
| #include "content/browser/frame_host/navigator_delegate.h" |
| @@ -233,10 +234,13 @@ void NavigationHandleImpl::WillStartRequest( |
| state_ = WILL_SEND_REQUEST; |
| complete_callback_ = callback; |
| - // Register the navigation throttles. The ScopedVector returned by |
| - // GetNavigationThrottles is not assigned to throttles_ directly because it |
| - // would overwrite any throttle previously added with |
| - // RegisterThrottleForTesting. |
| + // Register the platform's navigation throttles. |
| + scoped_ptr<content::NavigationThrottle> ancestor_throttle = |
| + AncestorThrottle::MaybeCreateThrottleFor(this); |
| + if (ancestor_throttle) |
| + throttles_.push_back(std::move(ancestor_throttle)); |
| + |
| + // Register the embedder's navigation throttles. |
| ScopedVector<NavigationThrottle> throttles_to_register = |
| GetContentClient()->browser()->CreateThrottlesForNavigation(this); |
| if (throttles_to_register.size() > 0) { |
| @@ -343,7 +347,7 @@ NavigationHandleImpl::CheckWillStartRequest() { |
| next_index_ = i + 1; |
| return result; |
| - default: |
| + case NavigationThrottle::BLOCK_RESPONSE: |
|
nasko
2016/02/12 23:21:40
Why did we lose the default?
Mike West
2016/04/12 20:13:30
Because this completely enumerates all the options
|
| NOTREACHED(); |
| } |
| } |
| @@ -374,7 +378,7 @@ NavigationHandleImpl::CheckWillRedirectRequest() { |
| next_index_ = i + 1; |
| return result; |
| - default: |
| + case NavigationThrottle::BLOCK_RESPONSE: |
| NOTREACHED(); |
| } |
| } |
| @@ -393,6 +397,7 @@ NavigationHandleImpl::CheckWillProcessResponse() { |
| case NavigationThrottle::PROCEED: |
| continue; |
| + case NavigationThrottle::BLOCK_RESPONSE: |
| case NavigationThrottle::CANCEL: |
| case NavigationThrottle::CANCEL_AND_IGNORE: |
| state_ = CANCELING; |