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

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

Issue 1465503002: Revert of CHECK that URLRequestJobs are not orphaned while blocked by extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make git do the revert Created 5 years, 1 month 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
« no previous file with comments | « net/base/network_delegate_impl.cc ('k') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 load_timing_info_ = LoadTimingInfo(); 872 load_timing_info_ = LoadTimingInfo();
873 load_timing_info_.request_start_time = response_info_.request_time; 873 load_timing_info_.request_start_time = response_info_.request_time;
874 load_timing_info_.request_start = base::TimeTicks::Now(); 874 load_timing_info_.request_start = base::TimeTicks::Now();
875 875
876 status_ = URLRequestStatus(); 876 status_ = URLRequestStatus();
877 is_pending_ = false; 877 is_pending_ = false;
878 proxy_server_ = HostPortPair(); 878 proxy_server_ = HostPortPair();
879 } 879 }
880 880
881 void URLRequest::OrphanJob() { 881 void URLRequest::OrphanJob() {
882 if (network_delegate_)
883 network_delegate_->NotifyURLRequestJobOrphaned(this);
884
885 // When calling this function, please check that URLRequestHttpJob is 882 // When calling this function, please check that URLRequestHttpJob is
886 // not in between calling NetworkDelegate::NotifyHeadersReceived receiving 883 // not in between calling NetworkDelegate::NotifyHeadersReceived receiving
887 // the call back. This is currently guaranteed by the following strategies: 884 // the call back. This is currently guaranteed by the following strategies:
888 // - OrphanJob is called on JobRestart, in this case the URLRequestJob cannot 885 // - OrphanJob is called on JobRestart, in this case the URLRequestJob cannot
889 // be receiving any headers at that time. 886 // be receiving any headers at that time.
890 // - OrphanJob is called in ~URLRequest, in this case 887 // - OrphanJob is called in ~URLRequest, in this case
891 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate 888 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate
892 // that the callback becomes invalid. 889 // that the callback becomes invalid.
893 job_->Kill(); 890 job_->Kill();
894 job_->DetachRequest(); // ensures that the job will not call us again 891 job_->DetachRequest(); // ensures that the job will not call us again
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 } 1195 }
1199 1196
1200 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { 1197 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const {
1201 if (job_) 1198 if (job_)
1202 job_->GetConnectionAttempts(out); 1199 job_->GetConnectionAttempts(out);
1203 else 1200 else
1204 out->clear(); 1201 out->clear();
1205 } 1202 }
1206 1203
1207 } // namespace net 1204 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_delegate_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698