OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_BLAMER_SHARED_MEMORY_HEAP_REGISTRY_H_ |
| 6 #define SERVICES_BLAMER_SHARED_MEMORY_HEAP_REGISTRY_H_ |
| 7 |
| 8 #include "mojo/public/cpp/bindings/interface_request.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 #include "services/blamer/public/interfaces/shared_memory_heap_registry.mojom.h" |
| 11 #include "services/service_manager/public/cpp/connection.h" |
| 12 #include "services/service_manager/public/cpp/service_context_ref.h" |
| 13 |
| 14 namespace blamer { |
| 15 |
| 16 // This is the implementation of a SharedMemoryHeap that lives in the process |
| 17 // hosting the blamer service. It receives notifications of shared memory slabs |
| 18 // allocated by remote blamer heaps. |
| 19 class SharedMemoryHeapRegistry : public mojom::SharedMemoryHeapRegistry { |
| 20 public: |
| 21 SharedMemoryHeapRegistry( |
| 22 service_manager::ServiceContextRefFactory* service_ref_factory); |
| 23 ~SharedMemoryHeapRegistry() override; |
| 24 |
| 25 static void Create( |
| 26 service_manager::ServiceContextRefFactory* service_ref_factory, |
| 27 blamer::mojom::SharedMemoryHeapRegistryRequest request); |
| 28 void RegisterSlab(mojom::SharedMemoryHeapSlabPtr slab) override; |
| 29 |
| 30 private: |
| 31 service_manager::ServiceContextRefFactory* service_ref_factory_; |
| 32 std::unique_ptr<service_manager::ServiceContextRef> service_ref_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(SharedMemoryHeapRegistry); |
| 35 }; |
| 36 |
| 37 } // namespace blamer |
| 38 |
| 39 #endif // SERVICES_BLAMER_SHARED_MEMORY_HEAP_REGISTRY_H_ |
OLD | NEW |