| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  150       identifier_(GenerateURLRequestIdentifier()), |  150       identifier_(GenerateURLRequestIdentifier()), | 
|  151       blocked_on_delegate_(false), |  151       blocked_on_delegate_(false), | 
|  152       ALLOW_THIS_IN_INITIALIZER_LIST(before_request_callback_( |  152       ALLOW_THIS_IN_INITIALIZER_LIST(before_request_callback_( | 
|  153           base::Bind(&URLRequest::BeforeRequestComplete, |  153           base::Bind(&URLRequest::BeforeRequestComplete, | 
|  154                      base::Unretained(this)))), |  154                      base::Unretained(this)))), | 
|  155       has_notified_completion_(false), |  155       has_notified_completion_(false), | 
|  156       creation_time_(base::TimeTicks::Now()) { |  156       creation_time_(base::TimeTicks::Now()) { | 
|  157   SIMPLE_STATS_COUNTER("URLRequestCount"); |  157   SIMPLE_STATS_COUNTER("URLRequestCount"); | 
|  158  |  158  | 
|  159   // Sanity check out environment. |  159   // Sanity check out environment. | 
|  160   DCHECK(MessageLoop::current()) << |  160   DCHECK(MessageLoop::current()) << "The current MessageLoop must exist"; | 
|  161       "The current MessageLoop must exist"; |  161  | 
|  162   DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |  162   DCHECK(MessageLoop::current()->IsType(MessageLoop::TYPE_IO)) << "" | 
|  163       "The current MessageLoop must be TYPE_IO"; |  163       "The current MessageLoop must be TYPE_IO"; | 
|  164  |  164  | 
|  165   CHECK(context); |  165   CHECK(context); | 
|  166   context->url_requests()->insert(this); |  166   context->url_requests()->insert(this); | 
|  167  |  167  | 
|  168   net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE); |  168   net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE); | 
|  169 } |  169 } | 
|  170  |  170  | 
|  171 URLRequest::~URLRequest() { |  171 URLRequest::~URLRequest() { | 
|  172   Cancel(); |  172   Cancel(); | 
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  911       new base::debug::StackTrace(NULL, 0); |  911       new base::debug::StackTrace(NULL, 0); | 
|  912   *stack_trace_copy = stack_trace; |  912   *stack_trace_copy = stack_trace; | 
|  913   stack_trace_.reset(stack_trace_copy); |  913   stack_trace_.reset(stack_trace_copy); | 
|  914 } |  914 } | 
|  915  |  915  | 
|  916 const base::debug::StackTrace* URLRequest::stack_trace() const { |  916 const base::debug::StackTrace* URLRequest::stack_trace() const { | 
|  917   return stack_trace_.get(); |  917   return stack_trace_.get(); | 
|  918 } |  918 } | 
|  919  |  919  | 
|  920 }  // namespace net |  920 }  // namespace net | 
| OLD | NEW |