OLD | NEW |
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_MEMORY_COORDINATOR_COORDINATOR_IMPL_H_ | 5 #ifndef SERVICES_RESOURCE_COORDINATOR_MEMORY_COORDINATOR_COORDINATOR_IMPL_H_ |
6 #define SERVICES_RESOURCE_COORDINATOR_MEMORY_COORDINATOR_COORDINATOR_IMPL_H_ | 6 #define SERVICES_RESOURCE_COORDINATOR_MEMORY_COORDINATOR_COORDINATOR_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <unordered_map> | 10 #include <unordered_map> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "base/trace_event/memory_dump_request_args.h" | 14 #include "base/trace_event/memory_dump_request_args.h" |
15 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
16 #include "mojo/public/cpp/bindings/binding_set.h" | 16 #include "mojo/public/cpp/bindings/binding_set.h" |
17 #include "services/resource_coordinator/public/cpp/memory/coordinator.h" | 17 #include "services/resource_coordinator/public/cpp/memory/coordinator.h" |
18 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" | 18 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" |
19 | 19 |
20 namespace memory_instrumentation { | 20 namespace memory_instrumentation { |
21 | 21 |
22 class CoordinatorImpl : public Coordinator, public mojom::Coordinator { | 22 class CoordinatorImpl : public Coordinator, public mojom::Coordinator { |
23 public: | 23 public: |
24 // The getter of the unique instance. | 24 // The getter of the unique instance. |
25 static CoordinatorImpl* GetInstance(); | 25 static CoordinatorImpl* GetInstance(); |
26 | 26 |
27 explicit CoordinatorImpl(bool initialize_memory_dump_manager); | 27 explicit CoordinatorImpl(bool initialize_memory_dump_manager); |
28 | 28 |
29 // Coordinator | 29 // Coordinator |
30 void BindCoordinatorRequest(mojom::CoordinatorRequest) override; | 30 void BindCoordinatorRequest( |
| 31 const service_manager::BindSourceInfo& source_info, |
| 32 mojom::CoordinatorRequest) override; |
31 | 33 |
32 bool initialize_memory_dump_manager() const { | 34 bool initialize_memory_dump_manager() const { |
33 return initialize_memory_dump_manager_; | 35 return initialize_memory_dump_manager_; |
34 } | 36 } |
35 | 37 |
36 private: | 38 private: |
37 friend std::default_delete<CoordinatorImpl>; // For testing | 39 friend std::default_delete<CoordinatorImpl>; // For testing |
38 friend class CoordinatorImplTest; // For testing | 40 friend class CoordinatorImplTest; // For testing |
39 | 41 |
40 struct QueuedMemoryDumpRequest { | 42 struct QueuedMemoryDumpRequest { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 89 |
88 const bool initialize_memory_dump_manager_; | 90 const bool initialize_memory_dump_manager_; |
89 | 91 |
90 base::ThreadChecker thread_checker_; | 92 base::ThreadChecker thread_checker_; |
91 | 93 |
92 DISALLOW_COPY_AND_ASSIGN(CoordinatorImpl); | 94 DISALLOW_COPY_AND_ASSIGN(CoordinatorImpl); |
93 }; | 95 }; |
94 | 96 |
95 } // namespace memory_instrumentation | 97 } // namespace memory_instrumentation |
96 #endif // SERVICES_RESOURCE_COORDINATOR_MEMORY_COORDINATOR_COORDINATOR_IMPL_H_ | 98 #endif // SERVICES_RESOURCE_COORDINATOR_MEMORY_COORDINATOR_COORDINATOR_IMPL_H_ |
OLD | NEW |