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

Unified Diff: base/trace_event/memory_dump_manager.h

Issue 2820433005: memory-infra: Start disentangling tracing from memory-infra (Closed)
Patch Set: pass config in 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 side-by-side diff with in-line comments
Download patch
Index: base/trace_event/memory_dump_manager.h
diff --git a/base/trace_event/memory_dump_manager.h b/base/trace_event/memory_dump_manager.h
index 4e5f8a2f77d00afae4d3cffc59678a19421071e5..f0fdcf2ba3e3619af1b2c3dcc129b85b0b390990 100644
--- a/base/trace_event/memory_dump_manager.h
+++ b/base/trace_event/memory_dump_manager.h
@@ -39,6 +39,7 @@ class Thread;
namespace trace_event {
+class MemoryTracingObserver;
class MemoryDumpManagerDelegate;
class MemoryDumpProvider;
class MemoryDumpSessionState;
@@ -46,7 +47,7 @@ class MemoryDumpSessionState;
// This is the interface exposed to the rest of the codebase to deal with
// memory tracing. The main entry point for clients is represented by
// RequestDumpPoint(). The extension by Un(RegisterDumpProvider).
-class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
+class BASE_EXPORT MemoryDumpManager {
public:
static const char* const kTraceCategory;
static const char* const kLogPrefix;
@@ -119,9 +120,9 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
void RequestGlobalDump(MemoryDumpType dump_type,
MemoryDumpLevelOfDetail level_of_detail);
- // TraceLog::EnabledStateObserver implementation.
- void OnTraceLogEnabled() override;
- void OnTraceLogDisabled() override;
+ // XXX
Primiano Tucci (use gerrit) 2017/04/21 10:10:26 Can you add a comment explaining what Enable/Disab
hjd 2017/04/21 11:51:57 Done.
+ void Enable(const TraceConfig::MemoryDumpConfig&);
+ void Disable();
// Enable heap profiling if kEnableHeapProfiling is specified.
void EnableHeapProfilingIfNeeded();
@@ -167,6 +168,7 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
friend struct DefaultSingletonTraits<MemoryDumpManager>;
friend class MemoryDumpManagerDelegate;
friend class MemoryDumpManagerTest;
+ friend class MockMemoryDumpManager;
Primiano Tucci (use gerrit) 2017/04/21 10:10:26 doesn't seem to be used anymore?
hjd 2017/04/21 11:51:57 Done.
friend class memory_instrumentation::MemoryDumpManagerDelegateImplTest;
// Holds the state of a process memory dump that needs to be carried over
@@ -230,7 +232,7 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
static const char* const kSystemAllocatorPoolName;
MemoryDumpManager();
- ~MemoryDumpManager() override;
+ virtual ~MemoryDumpManager();
static void SetInstanceForTesting(MemoryDumpManager* instance);
static uint32_t GetDumpsSumKb(const std::string&, const ProcessMemoryDump*);
@@ -284,6 +286,7 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
strict_thread_check_blacklist_;
std::unique_ptr<MemoryDumpManagerDelegate> delegate_;
+ std::unique_ptr<MemoryTracingObserver> trace_log_observer_;
Primiano Tucci (use gerrit) 2017/04/21 10:10:26 I'd just call it tracing_observer_ to keep it cons
hjd 2017/04/21 11:51:57 Done.
// Protects from concurrent accesses to the |dump_providers_*| and |delegate_|
// to guard against disabling logging while dumping on another thread.

Powered by Google App Engine
This is Rietveld 408576698