| 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/http/http_cache.h" | 5 #include "net/http/http_cache.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 HttpCache* const http_cache_; | 283 HttpCache* const http_cache_; |
| 284 }; | 284 }; |
| 285 | 285 |
| 286 //----------------------------------------------------------------------------- | 286 //----------------------------------------------------------------------------- |
| 287 HttpCache::HttpCache(const net::HttpNetworkSession::Params& params, | 287 HttpCache::HttpCache(const net::HttpNetworkSession::Params& params, |
| 288 BackendFactory* backend_factory) | 288 BackendFactory* backend_factory) |
| 289 : net_log_(params.net_log), | 289 : net_log_(params.net_log), |
| 290 backend_factory_(backend_factory), | 290 backend_factory_(backend_factory), |
| 291 building_backend_(false), | 291 building_backend_(false), |
| 292 mode_(NORMAL), | 292 mode_(NORMAL), |
| 293 quic_server_info_factory_(new QuicServerInfoFactoryAdaptor(this)), | 293 quic_server_info_factory_(params.enable_quic_persist_server_info ? |
| 294 new QuicServerInfoFactoryAdaptor(this) : NULL), |
| 294 network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))) { | 295 network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))) { |
| 295 HttpNetworkSession* session = network_layer_->GetSession(); | 296 HttpNetworkSession* session = network_layer_->GetSession(); |
| 296 session->quic_stream_factory()->set_quic_server_info_factory( | 297 session->quic_stream_factory()->set_quic_server_info_factory( |
| 297 quic_server_info_factory_.get()); | 298 quic_server_info_factory_.get()); |
| 298 } | 299 } |
| 299 | 300 |
| 300 | 301 |
| 301 // This call doesn't change the shared |session|'s QuicServerInfoFactory because | 302 // This call doesn't change the shared |session|'s QuicServerInfoFactory because |
| 302 // |session| is shared. | 303 // |session| is shared. |
| 303 HttpCache::HttpCache(HttpNetworkSession* session, | 304 HttpCache::HttpCache(HttpNetworkSession* session, |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 building_backend_ = false; | 1172 building_backend_ = false; |
| 1172 DeletePendingOp(pending_op); | 1173 DeletePendingOp(pending_op); |
| 1173 } | 1174 } |
| 1174 | 1175 |
| 1175 // The cache may be gone when we return from the callback. | 1176 // The cache may be gone when we return from the callback. |
| 1176 if (!item->DoCallback(result, disk_cache_.get())) | 1177 if (!item->DoCallback(result, disk_cache_.get())) |
| 1177 item->NotifyTransaction(result, NULL); | 1178 item->NotifyTransaction(result, NULL); |
| 1178 } | 1179 } |
| 1179 | 1180 |
| 1180 } // namespace net | 1181 } // namespace net |
| OLD | NEW |