OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 | 408 |
409 // The writer will self destruct when done. | 409 // The writer will self destruct when done. |
410 writer->Write(url, expected_response_time, buf, buf_len); | 410 writer->Write(url, expected_response_time, buf, buf_len); |
411 } | 411 } |
412 | 412 |
413 void HttpCache::CloseCurrentConnections() { | 413 void HttpCache::CloseCurrentConnections() { |
414 net::HttpNetworkLayer* network = | 414 net::HttpNetworkLayer* network = |
415 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); | 415 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); |
416 HttpNetworkSession* session = network->GetSession(); | 416 HttpNetworkSession* session = network->GetSession(); |
417 if (session) { | 417 if (session) { |
418 session->tcp_socket_pool()->CloseIdleSockets(); | 418 session->tcp_socket_pool()->Flush(); |
419 if (session->spdy_session_pool()) | 419 if (session->spdy_session_pool()) |
420 session->spdy_session_pool()->CloseAllSessions(); | 420 session->spdy_session_pool()->CloseAllSessions(); |
421 session->ReplaceTCPSocketPool(); | |
422 } | 421 } |
423 } | 422 } |
424 | 423 |
425 //----------------------------------------------------------------------------- | 424 //----------------------------------------------------------------------------- |
426 | 425 |
427 int HttpCache::CreateBackend(disk_cache::Backend** backend, | 426 int HttpCache::CreateBackend(disk_cache::Backend** backend, |
428 CompletionCallback* callback) { | 427 CompletionCallback* callback) { |
429 if (!backend_factory_.get()) | 428 if (!backend_factory_.get()) |
430 return ERR_FAILED; | 429 return ERR_FAILED; |
431 | 430 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 // This could be an external caller or a transaction waiting on Start(). | 1042 // This could be an external caller or a transaction waiting on Start(). |
1044 pending_item->DoCallback(result, temp_backend_); | 1043 pending_item->DoCallback(result, temp_backend_); |
1045 pending_item->NotifyTransaction(result, NULL); | 1044 pending_item->NotifyTransaction(result, NULL); |
1046 } | 1045 } |
1047 | 1046 |
1048 DeletePendingOp(pending_op); | 1047 DeletePendingOp(pending_op); |
1049 building_backend_ = false; | 1048 building_backend_ = false; |
1050 } | 1049 } |
1051 | 1050 |
1052 } // namespace net | 1051 } // namespace net |
OLD | NEW |