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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 404 |
405 void URLRequest::set_delegate(Delegate* delegate) { | 405 void URLRequest::set_delegate(Delegate* delegate) { |
406 delegate_ = delegate; | 406 delegate_ = delegate; |
407 } | 407 } |
408 | 408 |
409 void URLRequest::Start() { | 409 void URLRequest::Start() { |
410 g_url_requests_started = true; | 410 g_url_requests_started = true; |
411 response_info_.request_time = Time::Now(); | 411 response_info_.request_time = Time::Now(); |
412 | 412 |
413 // Only notify the delegate for the initial request. | 413 // Only notify the delegate for the initial request. |
414 if (context_ && context_->network_delegate()) { | 414 if (context_->network_delegate()) { |
415 int error = context_->network_delegate()->NotifyBeforeURLRequest( | 415 int error = context_->network_delegate()->NotifyBeforeURLRequest( |
416 this, before_request_callback_, &delegate_redirect_url_); | 416 this, before_request_callback_, &delegate_redirect_url_); |
417 if (error == net::ERR_IO_PENDING) { | 417 if (error == net::ERR_IO_PENDING) { |
418 // Paused on the delegate, will invoke |before_request_callback_| later. | 418 // Paused on the delegate, will invoke |before_request_callback_| later. |
419 SetBlockedOnDelegate(); | 419 SetBlockedOnDelegate(); |
420 } else { | 420 } else { |
421 BeforeRequestComplete(error); | 421 BeforeRequestComplete(error); |
422 } | 422 } |
423 return; | 423 return; |
424 } | 424 } |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 new base::debug::StackTrace(NULL, 0); | 904 new base::debug::StackTrace(NULL, 0); |
905 *stack_trace_copy = stack_trace; | 905 *stack_trace_copy = stack_trace; |
906 stack_trace_.reset(stack_trace_copy); | 906 stack_trace_.reset(stack_trace_copy); |
907 } | 907 } |
908 | 908 |
909 const base::debug::StackTrace* URLRequest::stack_trace() const { | 909 const base::debug::StackTrace* URLRequest::stack_trace() const { |
910 return stack_trace_.get(); | 910 return stack_trace_.get(); |
911 } | 911 } |
912 | 912 |
913 } // namespace net | 913 } // namespace net |
OLD | NEW |