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 bool URLRequestContext::GetReferenceParams( |
| 69 HttpNetworkSession::Params* params) const { |
| 70 HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
| 71 if (!transaction_factory) |
| 72 return false; |
| 73 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
| 74 if (!network_session) |
| 75 return false; |
| 76 *params = network_session->params(); |
| 77 return true; |
| 78 } |
| 79 |
68 URLRequest* URLRequestContext::CreateRequest( | 80 URLRequest* URLRequestContext::CreateRequest( |
69 const GURL& url, URLRequest::Delegate* delegate) const { | 81 const GURL& url, URLRequest::Delegate* delegate) const { |
70 return new URLRequest(url, delegate, this, network_delegate_); | 82 return new URLRequest(url, delegate, this, network_delegate_); |
71 } | 83 } |
72 | 84 |
73 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 85 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
74 cookie_store_ = cookie_store; | 86 cookie_store_ = cookie_store; |
75 } | 87 } |
76 | 88 |
77 const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { | 89 const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { |
(...skipping 16 matching lines...) Expand all Loading... |
94 base::debug::Alias(url_buf); | 106 base::debug::Alias(url_buf); |
95 base::debug::Alias(&num_requests); | 107 base::debug::Alias(&num_requests); |
96 base::debug::Alias(&has_delegate); | 108 base::debug::Alias(&has_delegate); |
97 base::debug::Alias(&load_flags); | 109 base::debug::Alias(&load_flags); |
98 base::debug::Alias(&stack_trace); | 110 base::debug::Alias(&stack_trace); |
99 CHECK(false); | 111 CHECK(false); |
100 } | 112 } |
101 } | 113 } |
102 | 114 |
103 } // namespace net | 115 } // namespace net |
OLD | NEW |