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

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

Issue 2661333002: Track SimpleCache memory usage in net/ MemoryDumpProvider (Closed)
Patch Set: Address ssid comments Created 3 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
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 #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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698