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

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

Issue 23710059: Release the cache entry on deferred redirect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/data/url_request_unittest/redirect-test.html.mock-http-headers ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698