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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 if (http_cache_enabled_) { | 274 if (http_cache_enabled_) { |
275 network_session_params.server_bound_cert_service = | 275 network_session_params.server_bound_cert_service = |
276 context->server_bound_cert_service(); | 276 context->server_bound_cert_service(); |
277 HttpCache::BackendFactory* http_cache_backend = NULL; | 277 HttpCache::BackendFactory* http_cache_backend = NULL; |
278 if (http_cache_params_.type == HttpCacheParams::DISK) { | 278 if (http_cache_params_.type == HttpCacheParams::DISK) { |
279 context->StartCacheThread(); | 279 context->StartCacheThread(); |
280 http_cache_backend = | 280 http_cache_backend = |
281 new HttpCache::DefaultBackend(DISK_CACHE, | 281 new HttpCache::DefaultBackend(DISK_CACHE, |
282 http_cache_params_.path, | 282 http_cache_params_.path, |
283 http_cache_params_.max_size, | 283 http_cache_params_.max_size, |
284 context->cache_message_loop_proxy()); | 284 context-> |
| 285 cache_message_loop_proxy().get()); |
285 } else { | 286 } else { |
286 http_cache_backend = | 287 http_cache_backend = |
287 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); | 288 HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size); |
288 } | 289 } |
289 | 290 |
290 http_transaction_factory = new HttpCache( | 291 http_transaction_factory = new HttpCache( |
291 network_session_params, http_cache_backend); | 292 network_session_params, http_cache_backend); |
292 } else { | 293 } else { |
293 scoped_refptr<net::HttpNetworkSession> network_session( | 294 scoped_refptr<net::HttpNetworkSession> network_session( |
294 new net::HttpNetworkSession(network_session_params)); | 295 new net::HttpNetworkSession(network_session_params)); |
295 | 296 |
296 http_transaction_factory = new HttpNetworkLayer(network_session); | 297 http_transaction_factory = new HttpNetworkLayer(network_session.get()); |
297 } | 298 } |
298 storage->set_http_transaction_factory(http_transaction_factory); | 299 storage->set_http_transaction_factory(http_transaction_factory); |
299 | 300 |
300 // TODO(willchan): Support sdch. | 301 // TODO(willchan): Support sdch. |
301 | 302 |
302 return context; | 303 return context; |
303 } | 304 } |
304 | 305 |
305 } // namespace net | 306 } // namespace net |
OLD | NEW |