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

Side by Side Diff: content/browser/indexed_db/leveldb/leveldb_database.cc

Issue 2880973002: memory-infra: skip IndexedDB file name in BACKGROUND dumps (Closed)
Patch Set: add comment Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/indexed_db/leveldb/leveldb_database.h" 5 #include "content/browser/indexed_db/leveldb/leveldb_database.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cerrno> 10 #include <cerrno>
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 std::string value; 474 std::string value;
475 uint64_t size; 475 uint64_t size;
476 bool res = db_->GetProperty("leveldb.approximate-memory-usage", &value); 476 bool res = db_->GetProperty("leveldb.approximate-memory-usage", &value);
477 DCHECK(res); 477 DCHECK(res);
478 base::StringToUint64(value, &size); 478 base::StringToUint64(value, &size);
479 479
480 auto* dump = pmd->CreateAllocatorDump(base::StringPrintf( 480 auto* dump = pmd->CreateAllocatorDump(base::StringPrintf(
481 "leveldb/index_db/0x%" PRIXPTR, reinterpret_cast<uintptr_t>(db_.get()))); 481 "leveldb/index_db/0x%" PRIXPTR, reinterpret_cast<uintptr_t>(db_.get())));
482 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, 482 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
483 base::trace_event::MemoryAllocatorDump::kUnitsBytes, size); 483 base::trace_event::MemoryAllocatorDump::kUnitsBytes, size);
484
485 // Dumps in BACKGROUND mode cannot have strings or edges in order to minimize
486 // trace size and instrumentation overhead.
487 if (args.level_of_detail ==
488 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) {
489 return true;
490 }
491
484 dump->AddString("file_name", "", file_name_for_tracing); 492 dump->AddString("file_name", "", file_name_for_tracing);
485 493
486 // Memory is allocated from system allocator (malloc). 494 // Memory is allocated from system allocator (malloc).
487 pmd->AddSuballocation(dump->guid(), 495 pmd->AddSuballocation(dump->guid(),
488 base::trace_event::MemoryDumpManager::GetInstance() 496 base::trace_event::MemoryDumpManager::GetInstance()
489 ->system_allocator_pool_name()); 497 ->system_allocator_pool_name());
490 return true; 498 return true;
491 } 499 }
492 500
493 std::unique_ptr<leveldb::Iterator> LevelDBDatabase::CreateLevelDBIterator( 501 std::unique_ptr<leveldb::Iterator> LevelDBDatabase::CreateLevelDBIterator(
(...skipping 20 matching lines...) Expand all
514 void LevelDBDatabase::OnIteratorDestroyed(LevelDBIterator* iter) { 522 void LevelDBDatabase::OnIteratorDestroyed(LevelDBIterator* iter) {
515 DCHECK_GT(num_iterators_, 0u); 523 DCHECK_GT(num_iterators_, 0u);
516 --num_iterators_; 524 --num_iterators_;
517 auto it = iterator_lru_.Peek(iter); 525 auto it = iterator_lru_.Peek(iter);
518 if (it == iterator_lru_.end()) 526 if (it == iterator_lru_.end())
519 return; 527 return;
520 iterator_lru_.Erase(it); 528 iterator_lru_.Erase(it);
521 } 529 }
522 530
523 } // namespace content 531 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698