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_RENDERER_HOST_RESOURCE_LOADER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/browser/renderer_host/resource_handler.h" | 10 #include "content/browser/renderer_host/resource_handler.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 net::URLRequest* request() { return request_.get(); } | 44 net::URLRequest* request() { return request_.get(); } |
45 ResourceRequestInfoImpl* GetRequestInfo(); | 45 ResourceRequestInfoImpl* GetRequestInfo(); |
46 | 46 |
47 void ClearLoginDelegate(); | 47 void ClearLoginDelegate(); |
48 void ClearSSLClientAuthHandler(); | 48 void ClearSSLClientAuthHandler(); |
49 | 49 |
50 // IPC message handlers: | 50 // IPC message handlers: |
51 void OnUploadProgressACK(); | 51 void OnUploadProgressACK(); |
52 | 52 |
| 53 uint64 upload_size() const { return upload_size_; } |
| 54 |
53 private: | 55 private: |
54 // net::URLRequest::Delegate implementation: | 56 // net::URLRequest::Delegate implementation: |
| 57 virtual void OnRequestBodyInitialized(net::URLRequest* request, |
| 58 uint64 size) OVERRIDE; |
55 virtual void OnReceivedRedirect(net::URLRequest* request, | 59 virtual void OnReceivedRedirect(net::URLRequest* request, |
56 const GURL& new_url, | 60 const GURL& new_url, |
57 bool* defer) OVERRIDE; | 61 bool* defer) OVERRIDE; |
58 virtual void OnAuthRequired(net::URLRequest* request, | 62 virtual void OnAuthRequired(net::URLRequest* request, |
59 net::AuthChallengeInfo* info) OVERRIDE; | 63 net::AuthChallengeInfo* info) OVERRIDE; |
60 virtual void OnCertificateRequested(net::URLRequest* request, | 64 virtual void OnCertificateRequested(net::URLRequest* request, |
61 net::SSLCertRequestInfo* info) OVERRIDE; | 65 net::SSLCertRequestInfo* info) OVERRIDE; |
62 virtual void OnSSLCertificateError(net::URLRequest* request, | 66 virtual void OnSSLCertificateError(net::URLRequest* request, |
63 const net::SSLInfo& info, | 67 const net::SSLInfo& info, |
64 bool fatal) OVERRIDE; | 68 bool fatal) OVERRIDE; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 }; | 101 }; |
98 DeferredStage deferred_stage_; | 102 DeferredStage deferred_stage_; |
99 | 103 |
100 scoped_ptr<net::URLRequest> request_; | 104 scoped_ptr<net::URLRequest> request_; |
101 scoped_ptr<ResourceHandler> handler_; | 105 scoped_ptr<ResourceHandler> handler_; |
102 ResourceLoaderDelegate* delegate_; | 106 ResourceLoaderDelegate* delegate_; |
103 | 107 |
104 scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_; | 108 scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_; |
105 scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_; | 109 scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_; |
106 | 110 |
| 111 uint64 upload_size_; |
107 uint64 last_upload_position_; | 112 uint64 last_upload_position_; |
108 bool waiting_for_upload_progress_ack_; | 113 bool waiting_for_upload_progress_ack_; |
109 base::TimeTicks last_upload_ticks_; | 114 base::TimeTicks last_upload_ticks_; |
110 | 115 |
111 // Indicates that we are in a state of being transferred to a new downstream | 116 // Indicates that we are in a state of being transferred to a new downstream |
112 // consumer. We are waiting for a notification to complete the transfer, at | 117 // consumer. We are waiting for a notification to complete the transfer, at |
113 // which point we'll receive a new ResourceHandler. | 118 // which point we'll receive a new ResourceHandler. |
114 bool is_transferring_; | 119 bool is_transferring_; |
115 | 120 |
116 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; | 121 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; |
117 | 122 |
118 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); | 123 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); |
119 }; | 124 }; |
120 | 125 |
121 } // namespace content | 126 } // namespace content |
122 | 127 |
123 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ | 128 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ |
OLD | NEW |