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

Side by Side Diff: base/trace_event/memory_dump_session_state.cc

Issue 2582453002: [tracing] Implement polling in MemoryDumpManager (Closed)
Patch Set: doc link and fix test. 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
« no previous file with comments | « base/trace_event/memory_dump_session_state.h ('k') | tools/gn/bootstrap/bootstrap.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/trace_event/memory_dump_session_state.h" 5 #include "base/trace_event/memory_dump_session_state.h"
6 6
7 namespace base { 7 namespace base {
8 namespace trace_event { 8 namespace trace_event {
9 9
10 MemoryDumpSessionState::MemoryDumpSessionState() : is_polling_enabled_(false) {} 10 MemoryDumpSessionState::MemoryDumpSessionState() {}
11
12 MemoryDumpSessionState::~MemoryDumpSessionState() {} 11 MemoryDumpSessionState::~MemoryDumpSessionState() {}
13 12
14 void MemoryDumpSessionState::SetStackFrameDeduplicator( 13 void MemoryDumpSessionState::SetStackFrameDeduplicator(
15 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator) { 14 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator) {
16 DCHECK(!stack_frame_deduplicator_); 15 DCHECK(!stack_frame_deduplicator_);
17 stack_frame_deduplicator_ = std::move(stack_frame_deduplicator); 16 stack_frame_deduplicator_ = std::move(stack_frame_deduplicator);
18 } 17 }
19 18
20 void MemoryDumpSessionState::SetTypeNameDeduplicator( 19 void MemoryDumpSessionState::SetTypeNameDeduplicator(
21 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator) { 20 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator) {
22 DCHECK(!type_name_deduplicator_); 21 DCHECK(!type_name_deduplicator_);
23 type_name_deduplicator_ = std::move(type_name_deduplicator); 22 type_name_deduplicator_ = std::move(type_name_deduplicator);
24 } 23 }
25 24
26 void MemoryDumpSessionState::SetMemoryDumpConfig( 25 void MemoryDumpSessionState::SetAllowedDumpModes(
27 const TraceConfig::MemoryDumpConfig& config) { 26 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes) {
28 memory_dump_config_ = config; 27 allowed_dump_modes_ = allowed_dump_modes;
29 for (const auto& trigger : config.triggers) { 28 }
30 if (trigger.trigger_type == MemoryDumpType::PEAK_MEMORY_USAGE) 29
31 is_polling_enabled_ = true; 30 bool MemoryDumpSessionState::IsDumpModeAllowed(
32 } 31 MemoryDumpLevelOfDetail dump_mode) const {
32 return allowed_dump_modes_.count(dump_mode) != 0;
33 } 33 }
34 34
35 } // namespace trace_event 35 } // namespace trace_event
36 } // namespace base 36 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_session_state.h ('k') | tools/gn/bootstrap/bootstrap.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698