Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: net/http/http_cache.cc

Issue 2647003: Do not attempt to reuse active sockets after a socket pool flush (usually a network change). (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Address eroman comments. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_network_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698