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 NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/power_monitor/power_observer.h" | 16 #include "base/power_monitor/power_observer.h" |
17 #include "net/base/host_port_pair.h" | 17 #include "net/base/host_port_pair.h" |
18 #include "net/base/load_states.h" | 18 #include "net/base/load_states.h" |
19 #include "net/base/net_error_details.h" | 19 #include "net/base/net_error_details.h" |
20 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
21 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
22 #include "net/base/upload_progress.h" | |
23 #include "net/cookies/canonical_cookie.h" | 22 #include "net/cookies/canonical_cookie.h" |
24 #include "net/socket/connection_attempts.h" | 23 #include "net/socket/connection_attempts.h" |
25 #include "net/url_request/redirect_info.h" | 24 #include "net/url_request/redirect_info.h" |
26 #include "net/url_request/url_request.h" | 25 #include "net/url_request/url_request.h" |
27 #include "url/gurl.h" | 26 #include "url/gurl.h" |
28 | 27 |
29 namespace net { | 28 namespace net { |
30 | 29 |
31 class AuthChallengeInfo; | 30 class AuthChallengeInfo; |
32 class AuthCredentials; | 31 class AuthCredentials; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // will never decrease over the lifetime of the URLRequestJob. | 109 // will never decrease over the lifetime of the URLRequestJob. |
111 virtual int64_t GetTotalReceivedBytes() const; | 110 virtual int64_t GetTotalReceivedBytes() const; |
112 | 111 |
113 // Get the number of bytes sent over the network. The values returned by this | 112 // Get the number of bytes sent over the network. The values returned by this |
114 // will never decrease over the lifetime of the URLRequestJob. | 113 // will never decrease over the lifetime of the URLRequestJob. |
115 virtual int64_t GetTotalSentBytes() const; | 114 virtual int64_t GetTotalSentBytes() const; |
116 | 115 |
117 // Called to fetch the current load state for the job. | 116 // Called to fetch the current load state for the job. |
118 virtual LoadState GetLoadState() const; | 117 virtual LoadState GetLoadState() const; |
119 | 118 |
120 // Called to get the upload progress in bytes. | |
121 virtual UploadProgress GetUploadProgress() const; | |
122 | |
123 // Called to fetch the charset for this request. Only makes sense for some | 119 // Called to fetch the charset for this request. Only makes sense for some |
124 // types of requests. Returns true on success. Calling this on a type that | 120 // types of requests. Returns true on success. Calling this on a type that |
125 // doesn't have a charset will return false. | 121 // doesn't have a charset will return false. |
126 virtual bool GetCharset(std::string* charset); | 122 virtual bool GetCharset(std::string* charset); |
127 | 123 |
128 // Called to get response info. | 124 // Called to get response info. |
129 virtual void GetResponseInfo(HttpResponseInfo* info); | 125 virtual void GetResponseInfo(HttpResponseInfo* info); |
130 | 126 |
131 // This returns the times when events actually occurred, rather than the time | 127 // This returns the times when events actually occurred, rather than the time |
132 // each event blocked the request. See FixupLoadTimingInfo in url_request.h | 128 // each event blocked the request. See FixupLoadTimingInfo in url_request.h |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 int64_t last_notified_total_sent_bytes_; | 455 int64_t last_notified_total_sent_bytes_; |
460 | 456 |
461 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 457 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
462 | 458 |
463 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 459 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
464 }; | 460 }; |
465 | 461 |
466 } // namespace net | 462 } // namespace net |
467 | 463 |
468 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 464 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |