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

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

Issue 169014: Remove URLRequest::Restart() because it is only referenced by unit tests (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 11 years, 4 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
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/process_util.h" 8 #include "base/process_util.h"
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/stats_counters.h" 10 #include "base/stats_counters.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 response_info_.request_time = Time::Now(); 259 response_info_.request_time = Time::Now();
260 response_info_.was_cached = false; 260 response_info_.was_cached = false;
261 261
262 // Don't allow errors to be sent from within Start(). 262 // Don't allow errors to be sent from within Start().
263 // TODO(brettw) this may cause NotifyDone to be sent synchronously, 263 // TODO(brettw) this may cause NotifyDone to be sent synchronously,
264 // we probably don't want this: they should be sent asynchronously so 264 // we probably don't want this: they should be sent asynchronously so
265 // the caller does not get reentered. 265 // the caller does not get reentered.
266 job_->Start(); 266 job_->Start();
267 } 267 }
268 268
269 void URLRequest::Restart() {
270 // Should only be called if the original job didn't make any progress.
271 DCHECK(job_ && !job_->has_response_started());
272 RestartWithJob(GetJobManager()->CreateJob(this));
273 }
274
275 void URLRequest::RestartWithJob(URLRequestJob *job) { 269 void URLRequest::RestartWithJob(URLRequestJob *job) {
276 DCHECK(job->request() == this); 270 DCHECK(job->request() == this);
277 PrepareToRestart(); 271 PrepareToRestart();
278 StartJob(job); 272 StartJob(job);
279 } 273 }
280 274
281 void URLRequest::Cancel() { 275 void URLRequest::Cancel() {
282 DoCancel(net::ERR_ABORTED, net::SSLInfo()); 276 DoCancel(net::ERR_ABORTED, net::SSLInfo());
283 } 277 }
284 278
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 487 }
494 488
495 #ifndef NDEBUG 489 #ifndef NDEBUG
496 490
497 URLRequestMetrics::~URLRequestMetrics() { 491 URLRequestMetrics::~URLRequestMetrics() {
498 DLOG_IF(WARNING, object_count != 0) << 492 DLOG_IF(WARNING, object_count != 0) <<
499 "Leaking " << object_count << " URLRequest object(s)"; 493 "Leaking " << object_count << " URLRequest object(s)";
500 } 494 }
501 495
502 #endif 496 #endif
OLDNEW
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698