Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: net/url_request/url_request_test_util.cc

Issue 7043007: Kill URLRequestJobTracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "net/url_request/url_request_test_util.h" 5 #include "net/url_request/url_request_test_util.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 TestNetworkDelegate::TestNetworkDelegate() 241 TestNetworkDelegate::TestNetworkDelegate()
242 : last_os_error_(0), 242 : last_os_error_(0),
243 error_count_(0), 243 error_count_(0),
244 created_requests_(0), 244 created_requests_(0),
245 destroyed_requests_(0) { 245 destroyed_requests_(0) {
246 } 246 }
247 247
248 TestNetworkDelegate::~TestNetworkDelegate() {} 248 TestNetworkDelegate::~TestNetworkDelegate() {}
249 249
250 int TestNetworkDelegate::OnBeforeURLRequest( 250 int TestNetworkDelegate::OnBeforeURLRequest(
251 net::URLRequest* request, 251 net::URLRequest* /* request */,
252 net::CompletionCallback* callback, 252 net::CompletionCallback* /* callback */,
253 GURL* new_url) { 253 GURL* /* new_url */) {
254 created_requests_++; 254 created_requests_++;
255 return net::OK; 255 return net::OK;
256 } 256 }
257 257
258 int TestNetworkDelegate::OnBeforeSendHeaders( 258 int TestNetworkDelegate::OnBeforeSendHeaders(
259 uint64 request_id, 259 uint64 /* request_id */,
260 net::CompletionCallback* callback, 260 net::CompletionCallback* /* callback */,
261 net::HttpRequestHeaders* headers) { 261 net::HttpRequestHeaders* /* headers */) {
262 return net::OK; 262 return net::OK;
263 } 263 }
264 264
265 void TestNetworkDelegate::OnRequestSent( 265 void TestNetworkDelegate::OnRequestSent(
266 uint64 request_id, 266 uint64 /* request_id */,
267 const net::HostPortPair& socket_address, 267 const net::HostPortPair& /* socket_address */,
268 const net::HttpRequestHeaders& headers) { 268 const net::HttpRequestHeaders& /* headers */) {
269 } 269 }
270 270
271 void TestNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, 271 void TestNetworkDelegate::OnBeforeRedirect(net::URLRequest* /* request */,
272 const GURL& new_location) { 272 const GURL& /* new_location */) {
273 } 273 }
274 274
275 void TestNetworkDelegate::OnResponseStarted(net::URLRequest* request) { 275 void TestNetworkDelegate::OnResponseStarted(net::URLRequest* request) {
276 if (request->status().status() == net::URLRequestStatus::FAILED) { 276 if (request->status().status() == net::URLRequestStatus::FAILED) {
277 error_count_++; 277 error_count_++;
278 last_os_error_ = request->status().os_error(); 278 last_os_error_ = request->status().os_error();
279 } 279 }
280 } 280 }
281 281
282 void TestNetworkDelegate::OnRawBytesRead(const net::URLRequest& /* request */,
283 int /* bytes_read */) {
284 }
285
282 void TestNetworkDelegate::OnCompleted(net::URLRequest* request) { 286 void TestNetworkDelegate::OnCompleted(net::URLRequest* request) {
283 if (request->status().status() == net::URLRequestStatus::FAILED) { 287 if (request->status().status() == net::URLRequestStatus::FAILED) {
284 error_count_++; 288 error_count_++;
285 last_os_error_ = request->status().os_error(); 289 last_os_error_ = request->status().os_error();
286 } 290 }
287 } 291 }
288 292
289 void TestNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { 293 void TestNetworkDelegate::OnURLRequestDestroyed(
294 net::URLRequest* /* request */) {
290 destroyed_requests_++; 295 destroyed_requests_++;
291 } 296 }
292 297
293 void TestNetworkDelegate::OnHttpTransactionDestroyed(uint64 request_id) { 298 void TestNetworkDelegate::OnHttpTransactionDestroyed(uint64 /* request_id */) {
294 } 299 }
295 300
296 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( 301 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob(
297 net::URLRequest* request) { 302 net::URLRequest* /* request */) {
298 return NULL; 303 return NULL;
299 } 304 }
300 305
301 void TestNetworkDelegate::OnPACScriptError(int line_number, 306 void TestNetworkDelegate::OnPACScriptError(int /* line_number */,
302 const string16& error) { 307 const string16& /* error */) {
303 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698