| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/loader/navigation_url_loader_impl_core.h" | 5 #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/frame_host/navigation_request_info.h" | 10 #include "content/browser/frame_host/navigation_request_info.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 NavigationURLLoaderImplCore::~NavigationURLLoaderImplCore() { | 35 NavigationURLLoaderImplCore::~NavigationURLLoaderImplCore() { |
| 36 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 36 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 37 | 37 |
| 38 if (resource_handler_) | 38 if (resource_handler_) |
| 39 resource_handler_->Cancel(); | 39 resource_handler_->Cancel(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void NavigationURLLoaderImplCore::Start( | 42 void NavigationURLLoaderImplCore::Start( |
| 43 ResourceContext* resource_context, | 43 ResourceContext* resource_context, |
| 44 ServiceWorkerNavigationHandleCore* service_worker_handle_core, | 44 ServiceWorkerNavigationHandleCore* service_worker_handle_core, |
| 45 AppCacheNavigationHandleCore* appcache_handle_core, |
| 45 std::unique_ptr<NavigationRequestInfo> request_info, | 46 std::unique_ptr<NavigationRequestInfo> request_info, |
| 46 std::unique_ptr<NavigationUIData> navigation_ui_data) { | 47 std::unique_ptr<NavigationUIData> navigation_ui_data) { |
| 47 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 48 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 48 | 49 |
| 49 BrowserThread::PostTask( | 50 BrowserThread::PostTask( |
| 50 BrowserThread::UI, FROM_HERE, | 51 BrowserThread::UI, FROM_HERE, |
| 51 base::Bind(&NavigationURLLoaderImpl::NotifyRequestStarted, loader_, | 52 base::Bind(&NavigationURLLoaderImpl::NotifyRequestStarted, loader_, |
| 52 base::TimeTicks::Now())); | 53 base::TimeTicks::Now())); |
| 53 | 54 |
| 54 // The ResourceDispatcherHostImpl can be null in unit tests. | 55 // The ResourceDispatcherHostImpl can be null in unit tests. |
| 55 if (ResourceDispatcherHostImpl::Get()) { | 56 if (ResourceDispatcherHostImpl::Get()) { |
| 56 ResourceDispatcherHostImpl::Get()->BeginNavigationRequest( | 57 ResourceDispatcherHostImpl::Get()->BeginNavigationRequest( |
| 57 resource_context, *request_info, std::move(navigation_ui_data), this, | 58 resource_context, *request_info, std::move(navigation_ui_data), this, |
| 58 service_worker_handle_core); | 59 service_worker_handle_core, appcache_handle_core); |
| 59 } | 60 } |
| 60 } | 61 } |
| 61 | 62 |
| 62 void NavigationURLLoaderImplCore::FollowRedirect() { | 63 void NavigationURLLoaderImplCore::FollowRedirect() { |
| 63 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 64 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 64 | 65 |
| 65 if (resource_handler_) | 66 if (resource_handler_) |
| 66 resource_handler_->FollowRedirect(); | 67 resource_handler_->FollowRedirect(); |
| 67 } | 68 } |
| 68 | 69 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 "&NavigationURLLoaderImplCore", this, "success", | 136 "&NavigationURLLoaderImplCore", this, "success", |
| 136 false); | 137 false); |
| 137 | 138 |
| 138 BrowserThread::PostTask( | 139 BrowserThread::PostTask( |
| 139 BrowserThread::UI, FROM_HERE, | 140 BrowserThread::UI, FROM_HERE, |
| 140 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, | 141 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, |
| 141 in_cache, net_error)); | 142 in_cache, net_error)); |
| 142 } | 143 } |
| 143 | 144 |
| 144 } // namespace content | 145 } // namespace content |
| OLD | NEW |