OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |