| 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 "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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate | 895 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate |
| 896 // that the callback becomes invalid. | 896 // that the callback becomes invalid. |
| 897 job_->Kill(); | 897 job_->Kill(); |
| 898 job_->DetachRequest(); // ensures that the job will not call us again | 898 job_->DetachRequest(); // ensures that the job will not call us again |
| 899 job_ = NULL; | 899 job_ = NULL; |
| 900 } | 900 } |
| 901 | 901 |
| 902 int URLRequest::Redirect(const RedirectInfo& redirect_info) { | 902 int URLRequest::Redirect(const RedirectInfo& redirect_info) { |
| 903 // Matches call in NotifyReceivedRedirect. | 903 // Matches call in NotifyReceivedRedirect. |
| 904 OnCallToDelegateComplete(); | 904 OnCallToDelegateComplete(); |
| 905 if (net_log_.IsLogging()) { | 905 if (net_log_.GetCaptureMode().enabled()) { |
| 906 net_log_.AddEvent( | 906 net_log_.AddEvent( |
| 907 NetLog::TYPE_URL_REQUEST_REDIRECTED, | 907 NetLog::TYPE_URL_REQUEST_REDIRECTED, |
| 908 NetLog::StringCallback("location", | 908 NetLog::StringCallback("location", |
| 909 &redirect_info.new_url.possibly_invalid_spec())); | 909 &redirect_info.new_url.possibly_invalid_spec())); |
| 910 } | 910 } |
| 911 | 911 |
| 912 // TODO(davidben): Pass the full RedirectInfo to the NetworkDelegate. | 912 // TODO(davidben): Pass the full RedirectInfo to the NetworkDelegate. |
| 913 if (network_delegate_) | 913 if (network_delegate_) |
| 914 network_delegate_->NotifyBeforeRedirect(this, redirect_info.new_url); | 914 network_delegate_->NotifyBeforeRedirect(this, redirect_info.new_url); |
| 915 | 915 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 new base::debug::StackTrace(NULL, 0); | 1215 new base::debug::StackTrace(NULL, 0); |
| 1216 *stack_trace_copy = stack_trace; | 1216 *stack_trace_copy = stack_trace; |
| 1217 stack_trace_.reset(stack_trace_copy); | 1217 stack_trace_.reset(stack_trace_copy); |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1220 const base::debug::StackTrace* URLRequest::stack_trace() const { |
| 1221 return stack_trace_.get(); | 1221 return stack_trace_.get(); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 } // namespace net | 1224 } // namespace net |
| OLD | NEW |