OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 void URLRequest::Delegate::OnResponseStarted(URLRequest* request) { | 169 void URLRequest::Delegate::OnResponseStarted(URLRequest* request) { |
170 NOTREACHED(); | 170 NOTREACHED(); |
171 } | 171 } |
172 | 172 |
173 /////////////////////////////////////////////////////////////////////////////// | 173 /////////////////////////////////////////////////////////////////////////////// |
174 // URLRequest | 174 // URLRequest |
175 | 175 |
176 URLRequest::~URLRequest() { | 176 URLRequest::~URLRequest() { |
| 177 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
177 Cancel(); | 178 Cancel(); |
178 | 179 |
179 if (network_delegate_) { | 180 if (network_delegate_) { |
180 network_delegate_->NotifyURLRequestDestroyed(this); | 181 network_delegate_->NotifyURLRequestDestroyed(this); |
181 if (job_.get()) | 182 if (job_.get()) |
182 job_->NotifyURLRequestDestroyed(); | 183 job_->NotifyURLRequestDestroyed(); |
183 } | 184 } |
184 | 185 |
185 // Delete job before |this|, since subclasses may do weird things, like depend | 186 // Delete job before |this|, since subclasses may do weird things, like depend |
186 // on UserData associated with |this| and poke at it during teardown. | 187 // on UserData associated with |this| and poke at it during teardown. |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 out->clear(); | 1216 out->clear(); |
1216 } | 1217 } |
1217 | 1218 |
1218 void URLRequest::set_status(URLRequestStatus status) { | 1219 void URLRequest::set_status(URLRequestStatus status) { |
1219 DCHECK(status_.is_io_pending() || status_.is_success() || | 1220 DCHECK(status_.is_io_pending() || status_.is_success() || |
1220 (!status.is_success() && !status.is_io_pending())); | 1221 (!status.is_success() && !status.is_io_pending())); |
1221 status_ = status; | 1222 status_ = status; |
1222 } | 1223 } |
1223 | 1224 |
1224 } // namespace net | 1225 } // namespace net |
OLD | NEW |