Chromium Code Reviews| Index: content/browser/loader/navigation_resource_throttle.cc |
| diff --git a/content/browser/loader/navigation_resource_throttle.cc b/content/browser/loader/navigation_resource_throttle.cc |
| index e8f9e6ed25b47782c18c8d174c31ec3cc3f92e7e..41476b9e8af3b6394633005a8fff78dd396f5318 100644 |
| --- a/content/browser/loader/navigation_resource_throttle.cc |
| +++ b/content/browser/loader/navigation_resource_throttle.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/bind.h" |
| #include "base/callback.h" |
| +#include "base/callback_helpers.h" |
| #include "base/location.h" |
| #include "base/logging.h" |
| #include "base/memory/ref_counted.h" |
| @@ -179,12 +180,14 @@ void WillProcessResponseOnUIThread( |
| NavigationResourceThrottle::NavigationResourceThrottle( |
| net::URLRequest* request, |
| ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate, |
| - RequestContextType request_context_type) |
| + RequestContextType request_context_type, |
| + const TransferCallback& on_transfer) |
| : request_(request), |
| resource_dispatcher_host_delegate_(resource_dispatcher_host_delegate), |
| request_context_type_(request_context_type), |
| in_cross_site_transition_(false), |
| on_transfer_done_result_(NavigationThrottle::DEFER), |
| + on_transfer_(on_transfer), |
| weak_ptr_factory_(this) {} |
| NavigationResourceThrottle::~NavigationResourceThrottle() {} |
| @@ -362,11 +365,18 @@ void NavigationResourceThrottle::InitiateTransfer() { |
| weak_ptr_factory_.GetWeakPtr())); |
| } |
| -void NavigationResourceThrottle::OnTransferComplete() { |
| +void NavigationResourceThrottle::OnTransferComplete( |
| + mojom::URLLoaderAssociatedRequest mojo_request, |
| + mojom::URLLoaderClientAssociatedPtr url_loader_client) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| DCHECK(in_cross_site_transition_); |
| in_cross_site_transition_ = false; |
| + if (on_transfer_) { |
|
clamy
2016/11/21 17:55:54
Could you dcheck this only happens when loading wi
|
| + base::ResetAndReturn(&on_transfer_) |
| + .Run(std::move(mojo_request), std::move(url_loader_client)); |
| + } |
| + |
| // If the results of the checks on the UI thread are known, unblock the |
| // navigation. Otherwise, wait until the callback has executed. |
| if (on_transfer_done_result_ != NavigationThrottle::DEFER) { |