| Index: services/resource_coordinator/public/cpp/memory/memory_dump_manager_delegate_impl.h
|
| diff --git a/services/resource_coordinator/public/cpp/memory/memory_dump_manager_delegate_impl.h b/services/resource_coordinator/public/cpp/memory/memory_dump_manager_delegate_impl.h
|
| index 0986e22b1ab209a345875a41f018144468c3913f..117661997368983b166c9a275728e054f488a42b 100644
|
| --- a/services/resource_coordinator/public/cpp/memory/memory_dump_manager_delegate_impl.h
|
| +++ b/services/resource_coordinator/public/cpp/memory/memory_dump_manager_delegate_impl.h
|
| @@ -5,9 +5,6 @@
|
| #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_DUMP_MANAGER_DELEGATE_IMPL_H_
|
| #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_DUMP_MANAGER_DELEGATE_IMPL_H_
|
|
|
| -#include "base/lazy_instance.h"
|
| -#include "base/single_thread_task_runner.h"
|
| -#include "base/synchronization/lock.h"
|
| #include "base/trace_event/memory_dump_manager.h"
|
| #include "base/trace_event/memory_dump_request_args.h"
|
| #include "mojo/public/cpp/bindings/binding.h"
|
| @@ -21,56 +18,30 @@
|
| : public base::trace_event::MemoryDumpManagerDelegate,
|
| public mojom::ProcessLocalDumpManager {
|
| public:
|
| - static MemoryDumpManagerDelegateImpl* GetInstance();
|
| -
|
| // Use to bind to a remote coordinator.
|
| - void InitializeWithInterfaceProvider(
|
| + MemoryDumpManagerDelegateImpl(
|
| service_manager::InterfaceProvider* interface_provider);
|
|
|
| // Use to bind to a coordinator in the same process.
|
| - void InitializeWithCoordinator(
|
| - Coordinator* coordinator,
|
| - scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
| + MemoryDumpManagerDelegateImpl(Coordinator* coordinator);
|
| + ~MemoryDumpManagerDelegateImpl() override;
|
|
|
| - bool IsCoordinator() const override;
|
| + bool IsCoordinator() const;
|
|
|
| // The base::trace_event::MemoryDumpManager calls this.
|
| void RequestGlobalMemoryDump(
|
| const base::trace_event::MemoryDumpRequestArgs& args,
|
| const base::trace_event::MemoryDumpCallback& callback) override;
|
|
|
| - void SetAsNonCoordinatorForTesting();
|
| -
|
| private:
|
| - friend std::default_delete<MemoryDumpManagerDelegateImpl>; // For testing
|
| - friend class MemoryDumpManagerDelegateImplTest; // For testing
|
| - friend struct base::DefaultLazyInstanceTraits<MemoryDumpManagerDelegateImpl>;
|
| -
|
| - MemoryDumpManagerDelegateImpl();
|
| - ~MemoryDumpManagerDelegateImpl() override;
|
| -
|
| // The ProcessLocalDumpManager interface. The coordinator calls this.
|
| void RequestProcessMemoryDump(
|
| const base::trace_event::MemoryDumpRequestArgs& args,
|
| const RequestProcessMemoryDumpCallback& callback) override;
|
|
|
| - // A proxy callback for updating |pending_memory_dump_guid_|.
|
| - void MemoryDumpCallbackProxy(
|
| - const base::trace_event::MemoryDumpCallback& callback,
|
| - uint64_t dump_guid,
|
| - bool success);
|
| -
|
| - bool initialized_;
|
| + bool is_coordinator_;
|
| mojom::CoordinatorPtr coordinator_;
|
| mojo::Binding<mojom::ProcessLocalDumpManager> binding_;
|
| - scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
| - uint64_t pending_memory_dump_guid_;
|
| -
|
| - // Prevents racy access to |pending_memory_dump_guid_|.
|
| - base::Lock pending_memory_dump_guid_lock_;
|
| -
|
| - // Prevents racy access to |initialized_|.
|
| - base::Lock initialized_lock_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegateImpl);
|
| };
|
|
|