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_TEST_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 CreateProtocolHandler(); | 131 CreateProtocolHandler(); |
132 | 132 |
133 // Job functions | 133 // Job functions |
134 void SetPriority(RequestPriority priority) override; | 134 void SetPriority(RequestPriority priority) override; |
135 void Start() override; | 135 void Start() override; |
136 int ReadRawData(IOBuffer* buf, int buf_size) override; | 136 int ReadRawData(IOBuffer* buf, int buf_size) override; |
137 void Kill() override; | 137 void Kill() override; |
138 bool GetMimeType(std::string* mime_type) const override; | 138 bool GetMimeType(std::string* mime_type) const override; |
139 void GetResponseInfo(HttpResponseInfo* info) override; | 139 void GetResponseInfo(HttpResponseInfo* info) override; |
140 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; | 140 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
141 int GetResponseCode() const override; | |
142 int64_t GetTotalReceivedBytes() const override; | 141 int64_t GetTotalReceivedBytes() const override; |
143 bool IsRedirectResponse(GURL* location, int* http_status_code) override; | 142 bool IsRedirectResponse(GURL* location, int* http_status_code) override; |
144 | 143 |
145 protected: | 144 protected: |
146 // Override to specify whether the next read done from this job will | 145 // Override to specify whether the next read done from this job will |
147 // return IO pending. This controls whether or not the WAITING state will | 146 // return IO pending. This controls whether or not the WAITING state will |
148 // transition back to WAITING or to DATA_AVAILABLE after an asynchronous | 147 // transition back to WAITING or to DATA_AVAILABLE after an asynchronous |
149 // read is processed. | 148 // read is processed. |
150 virtual bool NextReadAsync(); | 149 virtual bool NextReadAsync(); |
151 | 150 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 int response_headers_length_; | 197 int response_headers_length_; |
199 | 198 |
200 bool async_reads_; | 199 bool async_reads_; |
201 | 200 |
202 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; | 201 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; |
203 }; | 202 }; |
204 | 203 |
205 } // namespace net | 204 } // namespace net |
206 | 205 |
207 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 206 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
OLD | NEW |