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)), | |
294 network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))) { | 293 network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))) { |
295 HttpNetworkSession* session = network_layer_->GetSession(); | 294 if (params.enable_quic_persist_server_info) { |
296 session->quic_stream_factory()->set_quic_server_info_factory( | 295 quic_server_info_factory_.reset(new QuicServerInfoFactoryAdaptor(this)); |
Ryan Hamilton
2014/03/01 00:38:27
nit: if you wanted to make quic_server_info_factor
ramant (doing other things)
2014/03/01 01:22:22
Done.
| |
297 quic_server_info_factory_.get()); | 296 HttpNetworkSession* session = network_layer_->GetSession(); |
297 session->quic_stream_factory()->set_quic_server_info_factory( | |
298 quic_server_info_factory_.get()); | |
299 } | |
298 } | 300 } |
299 | 301 |
300 | 302 |
301 // This call doesn't change the shared |session|'s QuicServerInfoFactory because | 303 // This call doesn't change the shared |session|'s QuicServerInfoFactory because |
302 // |session| is shared. | 304 // |session| is shared. |
303 HttpCache::HttpCache(HttpNetworkSession* session, | 305 HttpCache::HttpCache(HttpNetworkSession* session, |
304 BackendFactory* backend_factory) | 306 BackendFactory* backend_factory) |
305 : net_log_(session->net_log()), | 307 : net_log_(session->net_log()), |
306 backend_factory_(backend_factory), | 308 backend_factory_(backend_factory), |
307 building_backend_(false), | 309 building_backend_(false), |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1171 building_backend_ = false; | 1173 building_backend_ = false; |
1172 DeletePendingOp(pending_op); | 1174 DeletePendingOp(pending_op); |
1173 } | 1175 } |
1174 | 1176 |
1175 // The cache may be gone when we return from the callback. | 1177 // The cache may be gone when we return from the callback. |
1176 if (!item->DoCallback(result, disk_cache_.get())) | 1178 if (!item->DoCallback(result, disk_cache_.get())) |
1177 item->NotifyTransaction(result, NULL); | 1179 item->NotifyTransaction(result, NULL); |
1178 } | 1180 } |
1179 | 1181 |
1180 } // namespace net | 1182 } // namespace net |
OLD | NEW |