OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
6 #define CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 public: | 36 public: |
37 ResourceLoader(std::unique_ptr<net::URLRequest> request, | 37 ResourceLoader(std::unique_ptr<net::URLRequest> request, |
38 std::unique_ptr<ResourceHandler> handler, | 38 std::unique_ptr<ResourceHandler> handler, |
39 ResourceLoaderDelegate* delegate); | 39 ResourceLoaderDelegate* delegate); |
40 ~ResourceLoader() override; | 40 ~ResourceLoader() override; |
41 | 41 |
42 void StartRequest(); | 42 void StartRequest(); |
43 void CancelRequest(bool from_renderer); | 43 void CancelRequest(bool from_renderer); |
44 | 44 |
45 bool is_transferring() const { return is_transferring_; } | 45 bool is_transferring() const { return is_transferring_; } |
46 void MarkAsTransferring(const scoped_refptr<ResourceResponse>& response); | 46 void MarkAsTransferring(const base::Closure& on_transfer_complete_callback); |
47 void CompleteTransfer(); | 47 void CompleteTransfer(); |
48 | 48 |
49 net::URLRequest* request() { return request_.get(); } | 49 net::URLRequest* request() { return request_.get(); } |
50 ResourceRequestInfoImpl* GetRequestInfo(); | 50 ResourceRequestInfoImpl* GetRequestInfo(); |
51 | 51 |
52 void ClearLoginDelegate(); | 52 void ClearLoginDelegate(); |
53 | 53 |
54 private: | 54 private: |
55 // net::URLRequest::Delegate implementation: | 55 // net::URLRequest::Delegate implementation: |
56 void OnReceivedRedirect(net::URLRequest* request, | 56 void OnReceivedRedirect(net::URLRequest* request, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_; | 123 scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_; |
124 std::unique_ptr<SSLClientAuthHandler> ssl_client_auth_handler_; | 124 std::unique_ptr<SSLClientAuthHandler> ssl_client_auth_handler_; |
125 | 125 |
126 base::TimeTicks read_deferral_start_time_; | 126 base::TimeTicks read_deferral_start_time_; |
127 | 127 |
128 // Indicates that we are in a state of being transferred to a new downstream | 128 // Indicates that we are in a state of being transferred to a new downstream |
129 // consumer. We are waiting for a notification to complete the transfer, at | 129 // consumer. We are waiting for a notification to complete the transfer, at |
130 // which point we'll receive a new ResourceHandler. | 130 // which point we'll receive a new ResourceHandler. |
131 bool is_transferring_; | 131 bool is_transferring_; |
132 | 132 |
133 // Called when a navigation has finished transfer. | |
134 base::Closure on_transfer_complete_; | |
Charlie Reis
2016/09/16 21:19:26
nit: on_transfer_complete_callback_
clamy
2016/09/20 15:57:22
Done.
| |
135 | |
133 // Instrumentation add to investigate http://crbug.com/503306. | 136 // Instrumentation add to investigate http://crbug.com/503306. |
134 // TODO(mmenke): Remove once bug is fixed. | 137 // TODO(mmenke): Remove once bug is fixed. |
135 int times_cancelled_before_request_start_; | 138 int times_cancelled_before_request_start_; |
136 bool started_request_; | 139 bool started_request_; |
137 int times_cancelled_after_request_start_; | 140 int times_cancelled_after_request_start_; |
138 | 141 |
139 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; | 142 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; |
140 | 143 |
141 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); | 144 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); |
142 }; | 145 }; |
143 | 146 |
144 } // namespace content | 147 } // namespace content |
145 | 148 |
146 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ | 149 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
OLD | NEW |