| 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.h" | 5 #include "content/browser/loader/navigation_url_loader_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 12 #include "content/browser/frame_host/navigation_request_info.h" | 12 #include "content/browser/frame_host/navigation_request_info.h" |
| 13 #include "content/browser/loader/navigation_url_loader_delegate.h" | 13 #include "content/browser/loader/navigation_url_loader_delegate.h" |
| 14 #include "content/browser/loader/navigation_url_loader_impl_core.h" | 14 #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| 15 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 15 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
| 16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/global_request_id.h" |
| 18 #include "content/public/browser/navigation_data.h" | 19 #include "content/public/browser/navigation_data.h" |
| 19 #include "content/public/browser/navigation_ui_data.h" | 20 #include "content/public/browser/navigation_ui_data.h" |
| 20 #include "content/public/browser/stream_handle.h" | 21 #include "content/public/browser/stream_handle.h" |
| 21 | 22 |
| 22 namespace content { | 23 namespace content { |
| 23 | 24 |
| 24 NavigationURLLoaderImpl::NavigationURLLoaderImpl( | 25 NavigationURLLoaderImpl::NavigationURLLoaderImpl( |
| 25 BrowserContext* browser_context, | 26 BrowserContext* browser_context, |
| 26 std::unique_ptr<NavigationRequestInfo> request_info, | 27 std::unique_ptr<NavigationRequestInfo> request_info, |
| 27 std::unique_ptr<NavigationUIData> navigation_ui_data, | 28 std::unique_ptr<NavigationUIData> navigation_ui_data, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const scoped_refptr<ResourceResponse>& response) { | 81 const scoped_refptr<ResourceResponse>& response) { |
| 81 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 82 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 82 | 83 |
| 83 delegate_->OnRequestRedirected(redirect_info, response); | 84 delegate_->OnRequestRedirected(redirect_info, response); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void NavigationURLLoaderImpl::NotifyResponseStarted( | 87 void NavigationURLLoaderImpl::NotifyResponseStarted( |
| 87 const scoped_refptr<ResourceResponse>& response, | 88 const scoped_refptr<ResourceResponse>& response, |
| 88 std::unique_ptr<StreamHandle> body, | 89 std::unique_ptr<StreamHandle> body, |
| 89 const SSLStatus& ssl_status, | 90 const SSLStatus& ssl_status, |
| 90 std::unique_ptr<NavigationData> navigation_data) { | 91 std::unique_ptr<NavigationData> navigation_data, |
| 92 const GlobalRequestID& request_id, |
| 93 bool is_download, |
| 94 bool is_stream) { |
| 91 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 95 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 92 | 96 |
| 93 delegate_->OnResponseStarted(response, std::move(body), ssl_status, | 97 delegate_->OnResponseStarted(response, std::move(body), ssl_status, |
| 94 std::move(navigation_data)); | 98 std::move(navigation_data), request_id, |
| 99 is_download, is_stream); |
| 95 } | 100 } |
| 96 | 101 |
| 97 void NavigationURLLoaderImpl::NotifyRequestFailed(bool in_cache, | 102 void NavigationURLLoaderImpl::NotifyRequestFailed(bool in_cache, |
| 98 int net_error) { | 103 int net_error) { |
| 99 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 104 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 100 | 105 |
| 101 delegate_->OnRequestFailed(in_cache, net_error); | 106 delegate_->OnRequestFailed(in_cache, net_error); |
| 102 } | 107 } |
| 103 | 108 |
| 104 void NavigationURLLoaderImpl::NotifyRequestStarted(base::TimeTicks timestamp) { | 109 void NavigationURLLoaderImpl::NotifyRequestStarted(base::TimeTicks timestamp) { |
| 105 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 110 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 106 | 111 |
| 107 delegate_->OnRequestStarted(timestamp); | 112 delegate_->OnRequestStarted(timestamp); |
| 108 } | 113 } |
| 109 | 114 |
| 110 } // namespace content | 115 } // namespace content |
| OLD | NEW |