| 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_context.h" | 5 #include "net/url_request/url_request_context.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/debug/alias.h" | 8 #include "base/debug/alias.h" |
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return NULL; | 66 return NULL; |
| 67 HttpNetworkSession* network_session = transaction_factory->GetSession(); | 67 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
| 68 if (!network_session) | 68 if (!network_session) |
| 69 return NULL; | 69 return NULL; |
| 70 return &network_session->params(); | 70 return &network_session->params(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 scoped_ptr<URLRequest> URLRequestContext::CreateRequest( | 73 scoped_ptr<URLRequest> URLRequestContext::CreateRequest( |
| 74 const GURL& url, | 74 const GURL& url, |
| 75 RequestPriority priority, | 75 RequestPriority priority, |
| 76 URLRequest::Delegate* delegate, | 76 URLRequest::Delegate* delegate) const { |
| 77 CookieStore* cookie_store) const { | 77 return scoped_ptr<URLRequest>(new URLRequest(url, priority, delegate, this)); |
| 78 return scoped_ptr<URLRequest>( | |
| 79 new URLRequest(url, priority, delegate, this, cookie_store)); | |
| 80 } | 78 } |
| 81 | 79 |
| 82 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 80 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
| 83 cookie_store_ = cookie_store; | 81 cookie_store_ = cookie_store; |
| 84 } | 82 } |
| 85 | 83 |
| 86 void URLRequestContext::AssertNoURLRequests() const { | 84 void URLRequestContext::AssertNoURLRequests() const { |
| 87 int num_requests = url_requests_->size(); | 85 int num_requests = url_requests_->size(); |
| 88 if (num_requests != 0) { | 86 if (num_requests != 0) { |
| 89 // We're leaking URLRequests :( Dump the URL of the first one and record how | 87 // We're leaking URLRequests :( Dump the URL of the first one and record how |
| (...skipping 10 matching lines...) Expand all Loading... |
| 100 base::debug::Alias(&num_requests); | 98 base::debug::Alias(&num_requests); |
| 101 base::debug::Alias(&has_delegate); | 99 base::debug::Alias(&has_delegate); |
| 102 base::debug::Alias(&load_flags); | 100 base::debug::Alias(&load_flags); |
| 103 base::debug::Alias(&stack_trace); | 101 base::debug::Alias(&stack_trace); |
| 104 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 102 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
| 105 << request->url().spec().c_str() << "."; | 103 << request->url().spec().c_str() << "."; |
| 106 } | 104 } |
| 107 } | 105 } |
| 108 | 106 |
| 109 } // namespace net | 107 } // namespace net |
| OLD | NEW |