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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 bool auto_advance() { return auto_advance_; } | 98 bool auto_advance() { return auto_advance_; } |
99 void set_auto_advance(bool auto_advance) { auto_advance_ = auto_advance; } | 99 void set_auto_advance(bool auto_advance) { auto_advance_ = auto_advance; } |
100 | 100 |
101 void set_load_timing_info(const LoadTimingInfo& load_timing_info) { | 101 void set_load_timing_info(const LoadTimingInfo& load_timing_info) { |
102 load_timing_info_ = load_timing_info; | 102 load_timing_info_ = load_timing_info; |
103 } | 103 } |
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 URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler(); | 108 static scoped_ptr<URLRequestJobFactory::ProtocolHandler> |
| 109 CreateProtocolHandler(); |
109 | 110 |
110 // Job functions | 111 // Job functions |
111 void SetPriority(RequestPriority priority) override; | 112 void SetPriority(RequestPriority priority) override; |
112 void Start() override; | 113 void Start() override; |
113 bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override; | 114 bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override; |
114 void Kill() override; | 115 void Kill() override; |
115 bool GetMimeType(std::string* mime_type) const override; | 116 bool GetMimeType(std::string* mime_type) const override; |
116 void GetResponseInfo(HttpResponseInfo* info) override; | 117 void GetResponseInfo(HttpResponseInfo* info) override; |
117 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; | 118 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
118 int GetResponseCode() const override; | 119 int GetResponseCode() const override; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 int async_buf_size_; | 164 int async_buf_size_; |
164 | 165 |
165 LoadTimingInfo load_timing_info_; | 166 LoadTimingInfo load_timing_info_; |
166 | 167 |
167 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; | 168 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; |
168 }; | 169 }; |
169 | 170 |
170 } // namespace net | 171 } // namespace net |
171 | 172 |
172 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 173 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
OLD | NEW |