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); | |
| 488 // TODO(xunjieli): Track other member allocations. | |
|
ssid
2017/02/01 02:45:48
I think TODOs are generally followed by bug number
xunjieli
2017/02/01 14:55:18
Done. Removed the TODO and added tracking for othe
| |
| 489 } | |
| 490 | |
| 484 //----------------------------------------------------------------------------- | 491 //----------------------------------------------------------------------------- |
| 485 | 492 |
| 486 int HttpCache::CreateBackend(disk_cache::Backend** backend, | 493 int HttpCache::CreateBackend(disk_cache::Backend** backend, |
| 487 const CompletionCallback& callback) { | 494 const CompletionCallback& callback) { |
| 488 if (!backend_factory_.get()) | 495 if (!backend_factory_.get()) |
| 489 return ERR_FAILED; | 496 return ERR_FAILED; |
| 490 | 497 |
| 491 building_backend_ = true; | 498 building_backend_ = true; |
| 492 | 499 |
| 493 std::unique_ptr<WorkItem> item = | 500 std::unique_ptr<WorkItem> item = |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1154 building_backend_ = false; | 1161 building_backend_ = false; |
| 1155 DeletePendingOp(pending_op); | 1162 DeletePendingOp(pending_op); |
| 1156 } | 1163 } |
| 1157 | 1164 |
| 1158 // The cache may be gone when we return from the callback. | 1165 // The cache may be gone when we return from the callback. |
| 1159 if (!item->DoCallback(result, disk_cache_.get())) | 1166 if (!item->DoCallback(result, disk_cache_.get())) |
| 1160 item->NotifyTransaction(result, NULL); | 1167 item->NotifyTransaction(result, NULL); |
| 1161 } | 1168 } |
| 1162 | 1169 |
| 1163 } // namespace net | 1170 } // namespace net |
| OLD | NEW |