| 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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate | 874 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate |
| 875 // that the callback becomes invalid. | 875 // that the callback becomes invalid. |
| 876 job_->Kill(); | 876 job_->Kill(); |
| 877 job_->DetachRequest(); // ensures that the job will not call us again | 877 job_->DetachRequest(); // ensures that the job will not call us again |
| 878 job_ = NULL; | 878 job_ = NULL; |
| 879 } | 879 } |
| 880 | 880 |
| 881 int URLRequest::Redirect(const RedirectInfo& redirect_info) { | 881 int URLRequest::Redirect(const RedirectInfo& redirect_info) { |
| 882 // Matches call in NotifyReceivedRedirect. | 882 // Matches call in NotifyReceivedRedirect. |
| 883 OnCallToDelegateComplete(); | 883 OnCallToDelegateComplete(); |
| 884 if (net_log_.IsLogging()) { | 884 if (net_log_.GetCaptureMode().enabled()) { |
| 885 net_log_.AddEvent( | 885 net_log_.AddEvent( |
| 886 NetLog::TYPE_URL_REQUEST_REDIRECTED, | 886 NetLog::TYPE_URL_REQUEST_REDIRECTED, |
| 887 NetLog::StringCallback("location", | 887 NetLog::StringCallback("location", |
| 888 &redirect_info.new_url.possibly_invalid_spec())); | 888 &redirect_info.new_url.possibly_invalid_spec())); |
| 889 } | 889 } |
| 890 | 890 |
| 891 // TODO(davidben): Pass the full RedirectInfo to the NetworkDelegate. | 891 // TODO(davidben): Pass the full RedirectInfo to the NetworkDelegate. |
| 892 if (network_delegate_) | 892 if (network_delegate_) |
| 893 network_delegate_->NotifyBeforeRedirect(this, redirect_info.new_url); | 893 network_delegate_->NotifyBeforeRedirect(this, redirect_info.new_url); |
| 894 | 894 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 new base::debug::StackTrace(NULL, 0); | 1173 new base::debug::StackTrace(NULL, 0); |
| 1174 *stack_trace_copy = stack_trace; | 1174 *stack_trace_copy = stack_trace; |
| 1175 stack_trace_.reset(stack_trace_copy); | 1175 stack_trace_.reset(stack_trace_copy); |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1178 const base::debug::StackTrace* URLRequest::stack_trace() const { |
| 1179 return stack_trace_.get(); | 1179 return stack_trace_.get(); |
| 1180 } | 1180 } |
| 1181 | 1181 |
| 1182 } // namespace net | 1182 } // namespace net |
| OLD | NEW |