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

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

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_cache.h ('k') | net/net.gyp » ('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) 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 HttpCache* HttpCache::GetCache() { 454 HttpCache* HttpCache::GetCache() {
455 return this; 455 return this;
456 } 456 }
457 457
458 HttpNetworkSession* HttpCache::GetSession() { 458 HttpNetworkSession* HttpCache::GetSession() {
459 net::HttpNetworkLayer* network = 459 net::HttpNetworkLayer* network =
460 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); 460 static_cast<net::HttpNetworkLayer*>(network_layer_.get());
461 return network->GetSession(); 461 return network->GetSession();
462 } 462 }
463 463
464 scoped_ptr<HttpTransactionFactory>
465 HttpCache::SetHttpNetworkTransactionFactoryForTesting(
466 scoped_ptr<HttpTransactionFactory> new_network_layer) {
467 scoped_ptr<HttpTransactionFactory> old_network_layer(network_layer_.Pass());
468 network_layer_ = new_network_layer.Pass();
469 return old_network_layer.Pass();
470 }
471
464 //----------------------------------------------------------------------------- 472 //-----------------------------------------------------------------------------
465 473
466 int HttpCache::CreateBackend(disk_cache::Backend** backend, 474 int HttpCache::CreateBackend(disk_cache::Backend** backend,
467 const net::CompletionCallback& callback) { 475 const net::CompletionCallback& callback) {
468 if (!backend_factory_.get()) 476 if (!backend_factory_.get())
469 return ERR_FAILED; 477 return ERR_FAILED;
470 478
471 building_backend_ = true; 479 building_backend_ = true;
472 480
473 scoped_ptr<WorkItem> item(new WorkItem(WI_CREATE_BACKEND, NULL, callback, 481 scoped_ptr<WorkItem> item(new WorkItem(WI_CREATE_BACKEND, NULL, callback,
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 building_backend_ = false; 1167 building_backend_ = false;
1160 DeletePendingOp(pending_op); 1168 DeletePendingOp(pending_op);
1161 } 1169 }
1162 1170
1163 // The cache may be gone when we return from the callback. 1171 // The cache may be gone when we return from the callback.
1164 if (!item->DoCallback(result, disk_cache_.get())) 1172 if (!item->DoCallback(result, disk_cache_.get()))
1165 item->NotifyTransaction(result, NULL); 1173 item->NotifyTransaction(result, NULL);
1166 } 1174 }
1167 1175
1168 } // namespace net 1176 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_cache.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698