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/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // FTPAuthCache is unique per context. | 58 // FTPAuthCache is unique per context. |
59 set_accept_language(other->accept_language_); | 59 set_accept_language(other->accept_language_); |
60 set_accept_charset(other->accept_charset_); | 60 set_accept_charset(other->accept_charset_); |
61 set_referrer_charset(other->referrer_charset_); | 61 set_referrer_charset(other->referrer_charset_); |
62 set_http_transaction_factory(other->http_transaction_factory_); | 62 set_http_transaction_factory(other->http_transaction_factory_); |
63 set_ftp_transaction_factory(other->ftp_transaction_factory_); | 63 set_ftp_transaction_factory(other->ftp_transaction_factory_); |
64 set_job_factory(other->job_factory_); | 64 set_job_factory(other->job_factory_); |
65 set_throttler_manager(other->throttler_manager_); | 65 set_throttler_manager(other->throttler_manager_); |
66 } | 66 } |
67 | 67 |
| 68 const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams( |
| 69 ) const { |
| 70 HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
| 71 if (!transaction_factory) |
| 72 return NULL; |
| 73 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
| 74 if (!network_session) |
| 75 return NULL; |
| 76 return &network_session->params(); |
| 77 } |
| 78 |
68 URLRequest* URLRequestContext::CreateRequest( | 79 URLRequest* URLRequestContext::CreateRequest( |
69 const GURL& url, URLRequest::Delegate* delegate) const { | 80 const GURL& url, URLRequest::Delegate* delegate) const { |
70 return new URLRequest(url, delegate, this, network_delegate_); | 81 return new URLRequest(url, delegate, this, network_delegate_); |
71 } | 82 } |
72 | 83 |
73 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 84 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
74 cookie_store_ = cookie_store; | 85 cookie_store_ = cookie_store; |
75 } | 86 } |
76 | 87 |
77 const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { | 88 const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { |
(...skipping 17 matching lines...) Expand all Loading... |
95 base::debug::Alias(&num_requests); | 106 base::debug::Alias(&num_requests); |
96 base::debug::Alias(&has_delegate); | 107 base::debug::Alias(&has_delegate); |
97 base::debug::Alias(&load_flags); | 108 base::debug::Alias(&load_flags); |
98 base::debug::Alias(&stack_trace); | 109 base::debug::Alias(&stack_trace); |
99 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 110 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
100 << request->url().spec().c_str() << "."; | 111 << request->url().spec().c_str() << "."; |
101 } | 112 } |
102 } | 113 } |
103 | 114 |
104 } // namespace net | 115 } // namespace net |
OLD | NEW |