OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
8 #include "content/browser/frame_host/navigator.h" | 10 #include "content/browser/frame_host/navigator.h" |
9 #include "content/browser/frame_host/navigator_delegate.h" | 11 #include "content/browser/frame_host/navigator_delegate.h" |
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 12 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
11 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 13 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
12 #include "content/public/browser/content_browser_client.h" | 14 #include "content/public/browser/content_browser_client.h" |
13 #include "content/public/common/browser_side_navigation_policy.h" | 15 #include "content/public/common/browser_side_navigation_policy.h" |
14 #include "content/public/common/content_client.h" | 16 #include "content/public/common/content_client.h" |
15 #include "net/url_request/redirect_info.h" | 17 #include "net/url_request/redirect_info.h" |
16 | 18 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 NavigationThrottle::ThrottleCheckResult result) { | 163 NavigationThrottle::ThrottleCheckResult result) { |
162 DCHECK(state_ == DEFERRING_START || state_ == DEFERRING_REDIRECT); | 164 DCHECK(state_ == DEFERRING_START || state_ == DEFERRING_REDIRECT); |
163 DCHECK(result == NavigationThrottle::CANCEL_AND_IGNORE || | 165 DCHECK(result == NavigationThrottle::CANCEL_AND_IGNORE || |
164 result == NavigationThrottle::CANCEL); | 166 result == NavigationThrottle::CANCEL); |
165 state_ = CANCELING; | 167 state_ = CANCELING; |
166 RunCompleteCallback(result); | 168 RunCompleteCallback(result); |
167 } | 169 } |
168 | 170 |
169 void NavigationHandleImpl::RegisterThrottleForTesting( | 171 void NavigationHandleImpl::RegisterThrottleForTesting( |
170 scoped_ptr<NavigationThrottle> navigation_throttle) { | 172 scoped_ptr<NavigationThrottle> navigation_throttle) { |
171 throttles_.push_back(navigation_throttle.Pass()); | 173 throttles_.push_back(std::move(navigation_throttle)); |
172 } | 174 } |
173 | 175 |
174 NavigationThrottle::ThrottleCheckResult | 176 NavigationThrottle::ThrottleCheckResult |
175 NavigationHandleImpl::CallWillStartRequestForTesting( | 177 NavigationHandleImpl::CallWillStartRequestForTesting( |
176 bool is_post, | 178 bool is_post, |
177 const Referrer& sanitized_referrer, | 179 const Referrer& sanitized_referrer, |
178 bool has_user_gesture, | 180 bool has_user_gesture, |
179 ui::PageTransition transition, | 181 ui::PageTransition transition, |
180 bool is_external_protocol) { | 182 bool is_external_protocol) { |
181 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; | 183 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 void NavigationHandleImpl::RunCompleteCallback( | 370 void NavigationHandleImpl::RunCompleteCallback( |
369 NavigationThrottle::ThrottleCheckResult result) { | 371 NavigationThrottle::ThrottleCheckResult result) { |
370 DCHECK(result != NavigationThrottle::DEFER); | 372 DCHECK(result != NavigationThrottle::DEFER); |
371 if (!complete_callback_.is_null()) | 373 if (!complete_callback_.is_null()) |
372 complete_callback_.Run(result); | 374 complete_callback_.Run(result); |
373 | 375 |
374 complete_callback_.Reset(); | 376 complete_callback_.Reset(); |
375 } | 377 } |
376 | 378 |
377 } // namespace content | 379 } // namespace content |
OLD | NEW |