OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 int last_error() const { return last_error_; } | 184 int last_error() const { return last_error_; } |
185 int error_count() const { return error_count_; } | 185 int error_count() const { return error_count_; } |
186 int created_requests() const { return created_requests_; } | 186 int created_requests() const { return created_requests_; } |
187 int destroyed_requests() const { return destroyed_requests_; } | 187 int destroyed_requests() const { return destroyed_requests_; } |
188 int completed_requests() const { return completed_requests_; } | 188 int completed_requests() const { return completed_requests_; } |
189 | 189 |
190 protected: | 190 protected: |
191 // net::NetworkDelegate: | 191 // net::NetworkDelegate: |
192 virtual int OnBeforeURLRequest(net::URLRequest* request, | 192 virtual int OnBeforeURLRequest(net::URLRequest* request, |
193 net::OldCompletionCallback* callback, | 193 const net::CompletionCallback& callback, |
194 GURL* new_url) OVERRIDE; | 194 GURL* new_url) OVERRIDE; |
195 virtual int OnBeforeSendHeaders(net::URLRequest* request, | 195 virtual int OnBeforeSendHeaders(net::URLRequest* request, |
196 net::OldCompletionCallback* callback, | 196 const net::CompletionCallback& callback, |
197 net::HttpRequestHeaders* headers) OVERRIDE; | 197 net::HttpRequestHeaders* headers) OVERRIDE; |
198 virtual void OnSendHeaders(net::URLRequest* request, | 198 virtual void OnSendHeaders(net::URLRequest* request, |
199 const net::HttpRequestHeaders& headers) OVERRIDE; | 199 const net::HttpRequestHeaders& headers) OVERRIDE; |
200 virtual int OnHeadersReceived( | 200 virtual int OnHeadersReceived( |
201 net::URLRequest* request, | 201 net::URLRequest* request, |
202 net::OldCompletionCallback* callback, | 202 const net::CompletionCallback& callback, |
203 net::HttpResponseHeaders* original_response_headers, | 203 net::HttpResponseHeaders* original_response_headers, |
204 scoped_refptr<net::HttpResponseHeaders>* override_response_headers) | 204 scoped_refptr<net::HttpResponseHeaders>* override_response_headers) |
205 OVERRIDE; | 205 OVERRIDE; |
206 virtual void OnBeforeRedirect(net::URLRequest* request, | 206 virtual void OnBeforeRedirect(net::URLRequest* request, |
207 const GURL& new_location) OVERRIDE; | 207 const GURL& new_location) OVERRIDE; |
208 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 208 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
209 virtual void OnRawBytesRead(const net::URLRequest& request, | 209 virtual void OnRawBytesRead(const net::URLRequest& request, |
210 int bytes_read) OVERRIDE; | 210 int bytes_read) OVERRIDE; |
211 virtual void OnCompleted(net::URLRequest* request) OVERRIDE; | 211 virtual void OnCompleted(net::URLRequest* request) OVERRIDE; |
212 virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; | 212 virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
231 // This bit-set indicates for each request id (key) what events may be sent | 231 // This bit-set indicates for each request id (key) what events may be sent |
232 // next. | 232 // next. |
233 std::map<int, int> next_states_; | 233 std::map<int, int> next_states_; |
234 | 234 |
235 // A log that records for each request id (key) the order in which On... | 235 // A log that records for each request id (key) the order in which On... |
236 // functions were called. | 236 // functions were called. |
237 std::map<int, std::string> event_order_; | 237 std::map<int, std::string> event_order_; |
238 }; | 238 }; |
239 | 239 |
240 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 240 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
OLD | NEW |