| 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 61d1dd085da9c0d027516a5f68b63b4269bf5df4..baf294ed75d80a3ead6ed5675d23df89648939d2 100644
|
| --- a/base/trace_event/memory_dump_manager.h
|
| +++ b/base/trace_event/memory_dump_manager.h
|
| @@ -54,13 +54,10 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
|
| // On the other side, the MemoryDumpManager will not be fully operational
|
| // (i.e. will NACK any RequestGlobalMemoryDump()) until initialized.
|
| // Arguments:
|
| - // is_coordinator: if true this MemoryDumpManager instance will act as a
|
| - // coordinator and schedule periodic dumps (if enabled via TraceConfig);
|
| - // false when the MemoryDumpManager is initialized in a slave process.
|
| // delegate: inversion-of-control interface for embedder-specific behaviors
|
| // (multiprocess handshaking). See the lifetime and thread-safety
|
| // requirements in the |MemoryDumpManagerDelegate| docstring.
|
| - void Initialize(MemoryDumpManagerDelegate* delegate, bool is_coordinator);
|
| + void Initialize(std::unique_ptr<MemoryDumpManagerDelegate> delegate);
|
|
|
| // (Un)Registers a MemoryDumpProvider instance.
|
| // Args:
|
| @@ -371,10 +368,7 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
|
| std::unordered_set<StringPiece, StringPieceHash>
|
| strict_thread_check_blacklist_;
|
|
|
| - MemoryDumpManagerDelegate* delegate_; // Not owned.
|
| -
|
| - // When true, this instance is in charge of coordinating periodic dumps.
|
| - bool is_coordinator_;
|
| + std::unique_ptr<MemoryDumpManagerDelegate> delegate_;
|
|
|
| // Protects from concurrent accesses to the |dump_providers_*| and |delegate_|
|
| // to guard against disabling logging while dumping on another thread.
|
| @@ -411,11 +405,15 @@ class BASE_EXPORT MemoryDumpManagerDelegate {
|
| virtual void RequestGlobalMemoryDump(const MemoryDumpRequestArgs& args,
|
| const MemoryDumpCallback& callback) = 0;
|
|
|
| + virtual bool IsCoordinator() const = 0;
|
| +
|
| // Returns tracing process id of the current process. This is used by
|
| // MemoryDumpManager::GetTracingProcessId.
|
| virtual uint64_t GetTracingProcessId() const = 0;
|
|
|
| protected:
|
| + friend std::default_delete<MemoryDumpManagerDelegate>;
|
| +
|
| MemoryDumpManagerDelegate() {}
|
| virtual ~MemoryDumpManagerDelegate() {}
|
|
|
|
|