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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate | 885 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate |
886 // that the callback becomes invalid. | 886 // that the callback becomes invalid. |
887 job_->Kill(); | 887 job_->Kill(); |
888 job_->DetachRequest(); // ensures that the job will not call us again | 888 job_->DetachRequest(); // ensures that the job will not call us again |
889 job_ = NULL; | 889 job_ = NULL; |
890 } | 890 } |
891 | 891 |
892 int URLRequest::Redirect(const RedirectInfo& redirect_info) { | 892 int URLRequest::Redirect(const RedirectInfo& redirect_info) { |
893 // Matches call in NotifyReceivedRedirect. | 893 // Matches call in NotifyReceivedRedirect. |
894 OnCallToDelegateComplete(); | 894 OnCallToDelegateComplete(); |
895 if (net_log_.GetCaptureMode().enabled()) { | 895 if (net_log_.IsCapturing()) { |
896 net_log_.AddEvent( | 896 net_log_.AddEvent( |
897 NetLog::TYPE_URL_REQUEST_REDIRECTED, | 897 NetLog::TYPE_URL_REQUEST_REDIRECTED, |
898 NetLog::StringCallback("location", | 898 NetLog::StringCallback("location", |
899 &redirect_info.new_url.possibly_invalid_spec())); | 899 &redirect_info.new_url.possibly_invalid_spec())); |
900 } | 900 } |
901 | 901 |
902 // TODO(davidben): Pass the full RedirectInfo to the NetworkDelegate. | 902 // TODO(davidben): Pass the full RedirectInfo to the NetworkDelegate. |
903 if (network_delegate_) | 903 if (network_delegate_) |
904 network_delegate_->NotifyBeforeRedirect(this, redirect_info.new_url); | 904 network_delegate_->NotifyBeforeRedirect(this, redirect_info.new_url); |
905 | 905 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 new base::debug::StackTrace(NULL, 0); | 1184 new base::debug::StackTrace(NULL, 0); |
1185 *stack_trace_copy = stack_trace; | 1185 *stack_trace_copy = stack_trace; |
1186 stack_trace_.reset(stack_trace_copy); | 1186 stack_trace_.reset(stack_trace_copy); |
1187 } | 1187 } |
1188 | 1188 |
1189 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1189 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1190 return stack_trace_.get(); | 1190 return stack_trace_.get(); |
1191 } | 1191 } |
1192 | 1192 |
1193 } // namespace net | 1193 } // namespace net |
OLD | NEW |