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

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

Issue 6373002: URLRequest::PrepareToRestart() call job_->Kill() and OrphanJob().... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 11 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 | « no previous file | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/stats_counters.h" 9 #include "base/metrics/stats_counters.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 job_->ContinueDespiteLastError(); 483 job_->ContinueDespiteLastError();
484 } 484 }
485 485
486 void URLRequest::PrepareToRestart() { 486 void URLRequest::PrepareToRestart() {
487 DCHECK(job_); 487 DCHECK(job_);
488 488
489 // Close the current URL_REQUEST_START_JOB, since we will be starting a new 489 // Close the current URL_REQUEST_START_JOB, since we will be starting a new
490 // one. 490 // one.
491 net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START_JOB, NULL); 491 net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START_JOB, NULL);
492 492
493 job_->Kill();
494 OrphanJob(); 493 OrphanJob();
495 494
496 response_info_ = net::HttpResponseInfo(); 495 response_info_ = net::HttpResponseInfo();
497 status_ = URLRequestStatus(); 496 status_ = URLRequestStatus();
498 is_pending_ = false; 497 is_pending_ = false;
499 } 498 }
500 499
501 void URLRequest::OrphanJob() { 500 void URLRequest::OrphanJob() {
502 job_->Kill(); 501 job_->Kill();
503 job_->DetachRequest(); // ensures that the job will not call us again 502 job_->DetachRequest(); // ensures that the job will not call us again
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 if (found != user_data_.end()) 595 if (found != user_data_.end())
597 return found->second.get(); 596 return found->second.get();
598 return NULL; 597 return NULL;
599 } 598 }
600 599
601 void URLRequest::SetUserData(const void* key, UserData* data) { 600 void URLRequest::SetUserData(const void* key, UserData* data) {
602 user_data_[key] = linked_ptr<UserData>(data); 601 user_data_[key] = linked_ptr<UserData>(data);
603 } 602 }
604 603
605 } // namespace net 604 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698