OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 HttpCache* HttpCache::GetCache() { | 471 HttpCache* HttpCache::GetCache() { |
472 return this; | 472 return this; |
473 } | 473 } |
474 | 474 |
475 HttpNetworkSession* HttpCache::GetSession() { | 475 HttpNetworkSession* HttpCache::GetSession() { |
476 net::HttpNetworkLayer* network = | 476 net::HttpNetworkLayer* network = |
477 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); | 477 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); |
478 return network->GetSession(); | 478 return network->GetSession(); |
479 } | 479 } |
480 | 480 |
481 void HttpCache::Suspend(bool suspend) { | |
482 network_layer_->Suspend(suspend); | |
483 } | |
484 | |
485 //----------------------------------------------------------------------------- | 481 //----------------------------------------------------------------------------- |
486 | 482 |
487 int HttpCache::CreateBackend(disk_cache::Backend** backend, | 483 int HttpCache::CreateBackend(disk_cache::Backend** backend, |
488 CompletionCallback* callback) { | 484 CompletionCallback* callback) { |
489 if (!backend_factory_.get()) | 485 if (!backend_factory_.get()) |
490 return ERR_FAILED; | 486 return ERR_FAILED; |
491 | 487 |
492 building_backend_ = true; | 488 building_backend_ = true; |
493 | 489 |
494 scoped_ptr<WorkItem> item(new WorkItem(WI_CREATE_BACKEND, NULL, callback, | 490 scoped_ptr<WorkItem> item(new WorkItem(WI_CREATE_BACKEND, NULL, callback, |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 building_backend_ = false; | 1129 building_backend_ = false; |
1134 DeletePendingOp(pending_op); | 1130 DeletePendingOp(pending_op); |
1135 } | 1131 } |
1136 | 1132 |
1137 // The cache may be gone when we return from the callback. | 1133 // The cache may be gone when we return from the callback. |
1138 if (!item->DoCallback(result, backend)) | 1134 if (!item->DoCallback(result, backend)) |
1139 item->NotifyTransaction(result, NULL); | 1135 item->NotifyTransaction(result, NULL); |
1140 } | 1136 } |
1141 | 1137 |
1142 } // namespace net | 1138 } // namespace net |
OLD | NEW |