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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 network_session_params.trusted_spdy_proxy = | 267 network_session_params.trusted_spdy_proxy = |
268 http_network_session_params_.trusted_spdy_proxy; | 268 http_network_session_params_.trusted_spdy_proxy; |
269 | 269 |
270 HttpTransactionFactory* http_transaction_factory = NULL; | 270 HttpTransactionFactory* http_transaction_factory = NULL; |
271 if (http_cache_enabled_) { | 271 if (http_cache_enabled_) { |
272 network_session_params.server_bound_cert_service = | 272 network_session_params.server_bound_cert_service = |
273 context->server_bound_cert_service(); | 273 context->server_bound_cert_service(); |
274 HttpCache::BackendFactory* http_cache_backend = NULL; | 274 HttpCache::BackendFactory* http_cache_backend = NULL; |
275 if (http_cache_params_.type == HttpCacheParams::DISK) { | 275 if (http_cache_params_.type == HttpCacheParams::DISK) { |
276 context->StartCacheThread(); | 276 context->StartCacheThread(); |
277 http_cache_backend = | 277 http_cache_backend = new HttpCache::DefaultBackend( |
278 new HttpCache::DefaultBackend(DISK_CACHE, | 278 DISK_CACHE, |
279 net::CACHE_BACKEND_DEFAULT, | 279 net::CACHE_BACKEND_DEFAULT, |
280 http_cache_params_.path, | 280 http_cache_params_.path, |
281 http_cache_params_.max_size, | 281 http_cache_params_.max_size, |
282 context->cache_message_loop_proxy()); | 282 context->cache_message_loop_proxy().get()); |
283 } else { | 283 } else { |
284 http_cache_backend = | 284 http_cache_backend = |
285 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); | 285 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); |
286 } | 286 } |
287 | 287 |
288 http_transaction_factory = new HttpCache( | 288 http_transaction_factory = new HttpCache( |
289 network_session_params, http_cache_backend); | 289 network_session_params, http_cache_backend); |
290 } else { | 290 } else { |
291 scoped_refptr<net::HttpNetworkSession> network_session( | 291 scoped_refptr<net::HttpNetworkSession> network_session( |
292 new net::HttpNetworkSession(network_session_params)); | 292 new net::HttpNetworkSession(network_session_params)); |
(...skipping 16 matching lines...) Expand all Loading... |
309 } | 309 } |
310 #endif | 310 #endif |
311 storage->set_job_factory(job_factory); | 311 storage->set_job_factory(job_factory); |
312 | 312 |
313 // TODO(willchan): Support sdch. | 313 // TODO(willchan): Support sdch. |
314 | 314 |
315 return context; | 315 return context; |
316 } | 316 } |
317 | 317 |
318 } // namespace net | 318 } // namespace net |
OLD | NEW |