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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 RequestPriority priority() const { return priority_; } | 105 RequestPriority priority() const { return priority_; } |
106 | 106 |
107 // Create a protocol handler for callers that don't subclass. | 107 // Create a protocol handler for callers that don't subclass. |
108 static scoped_ptr<URLRequestJobFactory::ProtocolHandler> | 108 static scoped_ptr<URLRequestJobFactory::ProtocolHandler> |
109 CreateProtocolHandler(); | 109 CreateProtocolHandler(); |
110 | 110 |
111 // Job functions | 111 // Job functions |
112 void SetPriority(RequestPriority priority) override; | 112 void SetPriority(RequestPriority priority) override; |
113 void Start() override; | 113 void Start() override; |
114 bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override; | 114 int ReadRawData(IOBuffer* buf, int buf_size) override; |
115 void Kill() override; | 115 void Kill() override; |
116 bool GetMimeType(std::string* mime_type) const override; | 116 bool GetMimeType(std::string* mime_type) const override; |
117 void GetResponseInfo(HttpResponseInfo* info) override; | 117 void GetResponseInfo(HttpResponseInfo* info) override; |
118 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; | 118 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
119 int GetResponseCode() const override; | 119 int GetResponseCode() const override; |
120 bool IsRedirectResponse(GURL* location, int* http_status_code) override; | 120 bool IsRedirectResponse(GURL* location, int* http_status_code) override; |
121 | 121 |
122 protected: | 122 protected: |
123 // Override to specify whether the next read done from this job will | 123 // Override to specify whether the next read done from this job will |
124 // return IO pending. This controls whether or not the WAITING state will | 124 // return IO pending. This controls whether or not the WAITING state will |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 int async_buf_size_; | 164 int async_buf_size_; |
165 | 165 |
166 LoadTimingInfo load_timing_info_; | 166 LoadTimingInfo load_timing_info_; |
167 | 167 |
168 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; | 168 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; |
169 }; | 169 }; |
170 | 170 |
171 } // namespace net | 171 } // namespace net |
172 | 172 |
173 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 173 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
OLD | NEW |