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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return NULL; | 71 return NULL; |
72 return &network_session->params(); | 72 return &network_session->params(); |
73 } | 73 } |
74 | 74 |
75 scoped_ptr<URLRequest> URLRequestContext::CreateRequest( | 75 scoped_ptr<URLRequest> URLRequestContext::CreateRequest( |
76 const GURL& url, | 76 const GURL& url, |
77 RequestPriority priority, | 77 RequestPriority priority, |
78 URLRequest::Delegate* delegate, | 78 URLRequest::Delegate* delegate, |
79 CookieStore* cookie_store) const { | 79 CookieStore* cookie_store) const { |
80 return scoped_ptr<URLRequest>( | 80 return scoped_ptr<URLRequest>( |
81 new URLRequest(url, priority, delegate, this, cookie_store)); | 81 new URLRequest(url, priority, delegate, this, cookie_store, |
| 82 network_delegate_)); |
82 } | 83 } |
83 | 84 |
84 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 85 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
85 cookie_store_ = cookie_store; | 86 cookie_store_ = cookie_store; |
86 } | 87 } |
87 | 88 |
88 void URLRequestContext::AssertNoURLRequests() const { | 89 void URLRequestContext::AssertNoURLRequests() const { |
89 int num_requests = url_requests_->size(); | 90 int num_requests = url_requests_->size(); |
90 if (num_requests != 0) { | 91 if (num_requests != 0) { |
91 // We're leaking URLRequests :( Dump the URL of the first one and record how | 92 // We're leaking URLRequests :( Dump the URL of the first one and record how |
(...skipping 10 matching lines...) Expand all Loading... |
102 base::debug::Alias(&num_requests); | 103 base::debug::Alias(&num_requests); |
103 base::debug::Alias(&has_delegate); | 104 base::debug::Alias(&has_delegate); |
104 base::debug::Alias(&load_flags); | 105 base::debug::Alias(&load_flags); |
105 base::debug::Alias(&stack_trace); | 106 base::debug::Alias(&stack_trace); |
106 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 107 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
107 << request->url().spec().c_str() << "."; | 108 << request->url().spec().c_str() << "."; |
108 } | 109 } |
109 } | 110 } |
110 | 111 |
111 } // namespace net | 112 } // namespace net |
OLD | NEW |