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

Side by Side Diff: services/resource_coordinator/public/cpp/memory/process_local_dump_manager_impl.h

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Buildfix after rebase Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_PROCESS_LOCAL_DUMP_MANAG ER_IMPL_H_ 5 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_PROCESS_LOCAL_DUMP_MANAG ER_IMPL_H_
6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_PROCESS_LOCAL_DUMP_MANAG ER_IMPL_H_ 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_PROCESS_LOCAL_DUMP_MANAG ER_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
11 #include "base/trace_event/memory_dump_manager.h" 11 #include "base/trace_event/memory_dump_manager.h"
12 #include "base/trace_event/memory_dump_request_args.h" 12 #include "base/trace_event/memory_dump_request_args.h"
13 #include "mojo/public/cpp/bindings/binding.h" 13 #include "mojo/public/cpp/bindings/binding.h"
14 #include "services/resource_coordinator/public/cpp/memory/coordinator.h" 14 #include "services/resource_coordinator/public/cpp/memory/coordinator.h"
15 #include "services/resource_coordinator/public/cpp/memory/memory_export.h" 15 #include "services/resource_coordinator/public/cpp/resource_coordinator_export.h "
16 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume ntation.mojom.h" 16 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume ntation.mojom.h"
17 #include "services/service_manager/public/cpp/connector.h" 17 #include "services/service_manager/public/cpp/connector.h"
18 18
19 namespace memory_instrumentation { 19 namespace memory_instrumentation {
20 20
21 // This is the bridge between MemoryDumpManager and the Coordinator service. 21 // This is the bridge between MemoryDumpManager and the Coordinator service.
22 // This indirection is needed to avoid a dependency from //base, where 22 // This indirection is needed to avoid a dependency from //base, where
23 // MemoryDumpManager lives, to //services, where the Coordinator service lives. 23 // MemoryDumpManager lives, to //services, where the Coordinator service lives.
24 // 24 //
25 // This cannot just be implemented by the Coordinator service, because there is 25 // This cannot just be implemented by the Coordinator service, because there is
26 // no Coordinator service in child processes. So, in a child process, the 26 // no Coordinator service in child processes. So, in a child process, the
27 // local dump manager remotely connects to the Coordinator service. In the 27 // local dump manager remotely connects to the Coordinator service. In the
28 // browser process, it locally connects to the Coordinator service. 28 // browser process, it locally connects to the Coordinator service.
29 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_EXPORT 29 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT
30 ProcessLocalDumpManagerImpl 30 ProcessLocalDumpManagerImpl
31 : public NON_EXPORTED_BASE(mojom::ProcessLocalDumpManager) { 31 : public NON_EXPORTED_BASE(mojom::ProcessLocalDumpManager) {
32 public: 32 public:
33 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_EXPORT Config { 33 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT Config {
34 public: 34 public:
35 Config(service_manager::Connector* connector, 35 Config(service_manager::Connector* connector,
36 const std::string& service_name) 36 const std::string& service_name)
37 : connector_(connector), 37 : connector_(connector),
38 service_name_(service_name), 38 service_name_(service_name),
39 coordinator_(nullptr) {} 39 coordinator_(nullptr) {}
40 Config(Coordinator* coordinator) 40 Config(Coordinator* coordinator)
41 : connector_(nullptr), coordinator_(coordinator) {} 41 : connector_(nullptr), coordinator_(coordinator) {}
42 ~Config(); 42 ~Config();
43 43
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 uint64_t pending_memory_dump_guid_; 90 uint64_t pending_memory_dump_guid_;
91 91
92 base::Lock pending_memory_dump_guid_lock_; 92 base::Lock pending_memory_dump_guid_lock_;
93 93
94 DISALLOW_COPY_AND_ASSIGN(ProcessLocalDumpManagerImpl); 94 DISALLOW_COPY_AND_ASSIGN(ProcessLocalDumpManagerImpl);
95 }; 95 };
96 96
97 } // namespace memory_instrumentation 97 } // namespace memory_instrumentation
98 98
99 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_PROCESS_LOCAL_DUMP_MA NAGER_IMPL_H_ 99 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_PROCESS_LOCAL_DUMP_MA NAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698