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

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: Incorporated rest of Matt's comments. 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
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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 HttpCache* HttpCache::GetCache() { 460 HttpCache* HttpCache::GetCache() {
461 return this; 461 return this;
462 } 462 }
463 463
464 HttpNetworkSession* HttpCache::GetSession() { 464 HttpNetworkSession* HttpCache::GetSession() {
465 net::HttpNetworkLayer* network = 465 net::HttpNetworkLayer* network =
466 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); 466 static_cast<net::HttpNetworkLayer*>(network_layer_.get());
467 return network->GetSession(); 467 return network->GetSession();
468 } 468 }
469 469
470 scoped_ptr<HttpTransactionFactory>
471 HttpCache::SetHttpNetworkTransactionFactoryForTesting(
472 scoped_ptr<HttpTransactionFactory> new_network_layer) {
473 scoped_ptr<HttpTransactionFactory> old_network_layer(network_layer_.Pass());
474 network_layer_ = new_network_layer.Pass();
475 return old_network_layer.Pass();
476 }
477
470 //----------------------------------------------------------------------------- 478 //-----------------------------------------------------------------------------
471 479
472 int HttpCache::CreateBackend(disk_cache::Backend** backend, 480 int HttpCache::CreateBackend(disk_cache::Backend** backend,
473 const net::CompletionCallback& callback) { 481 const net::CompletionCallback& callback) {
474 if (!backend_factory_.get()) 482 if (!backend_factory_.get())
475 return ERR_FAILED; 483 return ERR_FAILED;
476 484
477 building_backend_ = true; 485 building_backend_ = true;
478 486
479 scoped_ptr<WorkItem> item(new WorkItem(WI_CREATE_BACKEND, NULL, callback, 487 scoped_ptr<WorkItem> item(new WorkItem(WI_CREATE_BACKEND, NULL, callback,
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 building_backend_ = false; 1173 building_backend_ = false;
1166 DeletePendingOp(pending_op); 1174 DeletePendingOp(pending_op);
1167 } 1175 }
1168 1176
1169 // The cache may be gone when we return from the callback. 1177 // The cache may be gone when we return from the callback.
1170 if (!item->DoCallback(result, disk_cache_.get())) 1178 if (!item->DoCallback(result, disk_cache_.get()))
1171 item->NotifyTransaction(result, NULL); 1179 item->NotifyTransaction(result, NULL);
1172 } 1180 }
1173 1181
1174 } // namespace net 1182 } // namespace net
OLDNEW
« content/test/content_browser_test.cc ('K') | « net/http/http_cache.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698