| 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_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 ProxyConfigService* proxy_config_service) { | 189 ProxyConfigService* proxy_config_service) { |
| 190 proxy_config_service_.reset(proxy_config_service); | 190 proxy_config_service_.reset(proxy_config_service); |
| 191 } | 191 } |
| 192 #endif // defined(OS_LINUX) || defined(OS_ANDROID) | 192 #endif // defined(OS_LINUX) || defined(OS_ANDROID) |
| 193 | 193 |
| 194 URLRequestContext* URLRequestContextBuilder::Build() { | 194 URLRequestContext* URLRequestContextBuilder::Build() { |
| 195 BasicURLRequestContext* context = new BasicURLRequestContext; | 195 BasicURLRequestContext* context = new BasicURLRequestContext; |
| 196 URLRequestContextStorage* storage = context->storage(); | 196 URLRequestContextStorage* storage = context->storage(); |
| 197 | 197 |
| 198 storage->set_http_user_agent_settings(new StaticHttpUserAgentSettings( | 198 storage->set_http_user_agent_settings(new StaticHttpUserAgentSettings( |
| 199 accept_language_, accept_charset_, user_agent_)); | 199 accept_language_, user_agent_)); |
| 200 | 200 |
| 201 if (!network_delegate_) | 201 if (!network_delegate_) |
| 202 network_delegate_.reset(new BasicNetworkDelegate); | 202 network_delegate_.reset(new BasicNetworkDelegate); |
| 203 NetworkDelegate* network_delegate = network_delegate_.release(); | 203 NetworkDelegate* network_delegate = network_delegate_.release(); |
| 204 storage->set_network_delegate(network_delegate); | 204 storage->set_network_delegate(network_delegate); |
| 205 | 205 |
| 206 storage->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); | 206 storage->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); |
| 207 | 207 |
| 208 if (ftp_enabled_) { | 208 if (ftp_enabled_) { |
| 209 storage->set_ftp_transaction_factory( | 209 storage->set_ftp_transaction_factory( |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 http_transaction_factory = new HttpNetworkLayer(network_session); | 289 http_transaction_factory = new HttpNetworkLayer(network_session); |
| 290 } | 290 } |
| 291 storage->set_http_transaction_factory(http_transaction_factory); | 291 storage->set_http_transaction_factory(http_transaction_factory); |
| 292 | 292 |
| 293 // TODO(willchan): Support sdch. | 293 // TODO(willchan): Support sdch. |
| 294 | 294 |
| 295 return context; | 295 return context; |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace net | 298 } // namespace net |
| OLD | NEW |