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

Side by Side Diff: third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp

Issue 2830093003: Replace uses of hash_map in //base (Closed)
Patch Set: WebKit callers Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/heap/BlinkGCMemoryDumpProvider.h" 5 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
6 6
7 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" 7 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
8 #include "base/trace_event/heap_profiler_allocation_register.h" 8 #include "base/trace_event/heap_profiler_allocation_register.h"
9 #include "base/trace_event/memory_allocator_dump.h" 9 #include "base/trace_event/memory_allocator_dump.h"
10 #include "base/trace_event/process_memory_dump.h" 10 #include "base/trace_event/process_memory_dump.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // more detailed stats. 60 // more detailed stats.
61 if (level_of_detail == MemoryDumpLevelOfDetail::DETAILED) 61 if (level_of_detail == MemoryDumpLevelOfDetail::DETAILED)
62 ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack, 62 ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
63 BlinkGC::kTakeSnapshot, 63 BlinkGC::kTakeSnapshot,
64 BlinkGC::kForcedGC); 64 BlinkGC::kForcedGC);
65 DumpMemoryTotals(memory_dump); 65 DumpMemoryTotals(memory_dump);
66 66
67 if (is_heap_profiling_enabled_) { 67 if (is_heap_profiling_enabled_) {
68 // Overhead should always be reported, regardless of light vs. heavy. 68 // Overhead should always be reported, regardless of light vs. heavy.
69 base::trace_event::TraceEventMemoryOverhead overhead; 69 base::trace_event::TraceEventMemoryOverhead overhead;
70 base::hash_map<base::trace_event::AllocationContext, 70 std::unordered_map<base::trace_event::AllocationContext,
Łukasz Anforowicz 2017/04/24 18:46:10 IWYU: #include <unordered_map>?
71 base::trace_event::AllocationMetrics> 71 base::trace_event::AllocationMetrics>
72 metrics_by_context; 72 metrics_by_context;
73 { 73 {
74 MutexLocker locker(allocation_register_mutex_); 74 MutexLocker locker(allocation_register_mutex_);
75 if (level_of_detail == MemoryDumpLevelOfDetail::DETAILED) { 75 if (level_of_detail == MemoryDumpLevelOfDetail::DETAILED) {
76 for (const auto& alloc_size : *allocation_register_) { 76 for (const auto& alloc_size : *allocation_register_) {
77 base::trace_event::AllocationMetrics& metrics = 77 base::trace_event::AllocationMetrics& metrics =
78 metrics_by_context[alloc_size.context]; 78 metrics_by_context[alloc_size.context];
79 metrics.size += alloc_size.size; 79 metrics.size += alloc_size.size;
80 metrics.count++; 80 metrics.count++;
81 } 81 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 allocation_register_->Insert(address, size, context); 139 allocation_register_->Insert(address, size, context);
140 } 140 }
141 141
142 void BlinkGCMemoryDumpProvider::Remove(Address address) { 142 void BlinkGCMemoryDumpProvider::Remove(Address address) {
143 MutexLocker locker(allocation_register_mutex_); 143 MutexLocker locker(allocation_register_mutex_);
144 if (allocation_register_) 144 if (allocation_register_)
145 allocation_register_->Remove(address); 145 allocation_register_->Remove(address);
146 } 146 }
147 147
148 } // namespace blink 148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698