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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // The writer will self destruct when done. | 385 // The writer will self destruct when done. |
386 writer->Write(url, expected_response_time, buf, buf_len); | 386 writer->Write(url, expected_response_time, buf, buf_len); |
387 } | 387 } |
388 | 388 |
389 void HttpCache::CloseAllConnections() { | 389 void HttpCache::CloseAllConnections() { |
390 net::HttpNetworkLayer* network = | 390 net::HttpNetworkLayer* network = |
391 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); | 391 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); |
392 HttpNetworkSession* session = network->GetSession(); | 392 HttpNetworkSession* session = network->GetSession(); |
393 if (session) | 393 if (session) |
394 session->CloseAllConnections(); | 394 session->CloseAllConnections(); |
395 } | 395 } |
396 | 396 |
397 void HttpCache::CloseIdleConnections() { | 397 void HttpCache::CloseIdleConnections() { |
398 net::HttpNetworkLayer* network = | 398 net::HttpNetworkLayer* network = |
399 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); | 399 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); |
400 HttpNetworkSession* session = network->GetSession(); | 400 HttpNetworkSession* session = network->GetSession(); |
401 if (session) | 401 if (session) |
402 session->CloseIdleConnections(); | 402 session->CloseIdleConnections(); |
403 } | 403 } |
404 | 404 |
405 void HttpCache::OnExternalCacheHit(const GURL& url, | 405 void HttpCache::OnExternalCacheHit(const GURL& url, |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 building_backend_ = false; | 1138 building_backend_ = false; |
1139 DeletePendingOp(pending_op); | 1139 DeletePendingOp(pending_op); |
1140 } | 1140 } |
1141 | 1141 |
1142 // The cache may be gone when we return from the callback. | 1142 // The cache may be gone when we return from the callback. |
1143 if (!item->DoCallback(result, disk_cache_.get())) | 1143 if (!item->DoCallback(result, disk_cache_.get())) |
1144 item->NotifyTransaction(result, NULL); | 1144 item->NotifyTransaction(result, NULL); |
1145 } | 1145 } |
1146 | 1146 |
1147 } // namespace net | 1147 } // namespace net |
OLD | NEW |