Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 474 | 474 |
| 475 std::unique_ptr<HttpTransactionFactory> | 475 std::unique_ptr<HttpTransactionFactory> |
| 476 HttpCache::SetHttpNetworkTransactionFactoryForTesting( | 476 HttpCache::SetHttpNetworkTransactionFactoryForTesting( |
| 477 std::unique_ptr<HttpTransactionFactory> new_network_layer) { | 477 std::unique_ptr<HttpTransactionFactory> new_network_layer) { |
| 478 std::unique_ptr<HttpTransactionFactory> old_network_layer( | 478 std::unique_ptr<HttpTransactionFactory> old_network_layer( |
| 479 std::move(network_layer_)); | 479 std::move(network_layer_)); |
| 480 network_layer_ = std::move(new_network_layer); | 480 network_layer_ = std::move(new_network_layer); |
| 481 return old_network_layer; | 481 return old_network_layer; |
| 482 } | 482 } |
| 483 | 483 |
| 484 void HttpCache::DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, | |
| 485 const std::string& parent_absolute_name) const { | |
| 486 if (disk_cache_) | |
| 487 disk_cache_->DumpMemoryStats(pmd, parent_absolute_name); | |
|
ssid
2017/01/31 22:24:19
Are the other members here insignificant? like act
xunjieli
2017/02/01 01:15:52
I don't know. I haven't seen those in traces that
| |
| 488 } | |
| 489 | |
| 484 //----------------------------------------------------------------------------- | 490 //----------------------------------------------------------------------------- |
| 485 | 491 |
| 486 int HttpCache::CreateBackend(disk_cache::Backend** backend, | 492 int HttpCache::CreateBackend(disk_cache::Backend** backend, |
| 487 const CompletionCallback& callback) { | 493 const CompletionCallback& callback) { |
| 488 if (!backend_factory_.get()) | 494 if (!backend_factory_.get()) |
| 489 return ERR_FAILED; | 495 return ERR_FAILED; |
| 490 | 496 |
| 491 building_backend_ = true; | 497 building_backend_ = true; |
| 492 | 498 |
| 493 std::unique_ptr<WorkItem> item = | 499 std::unique_ptr<WorkItem> item = |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1154 building_backend_ = false; | 1160 building_backend_ = false; |
| 1155 DeletePendingOp(pending_op); | 1161 DeletePendingOp(pending_op); |
| 1156 } | 1162 } |
| 1157 | 1163 |
| 1158 // The cache may be gone when we return from the callback. | 1164 // The cache may be gone when we return from the callback. |
| 1159 if (!item->DoCallback(result, disk_cache_.get())) | 1165 if (!item->DoCallback(result, disk_cache_.get())) |
| 1160 item->NotifyTransaction(result, NULL); | 1166 item->NotifyTransaction(result, NULL); |
| 1161 } | 1167 } |
| 1162 | 1168 |
| 1163 } // namespace net | 1169 } // namespace net |
| OLD | NEW |