Index: services/blamer/public/cpp/blamer_interface.h |
diff --git a/services/blamer/public/cpp/blamer_interface.h b/services/blamer/public/cpp/blamer_interface.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fe59b29102b3ddca06808495c401c6ebcacdc01e |
--- /dev/null |
+++ b/services/blamer/public/cpp/blamer_interface.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SERVICES_BLAMER_PUBLIC_CPP_BLAMER_INTERFACE_H_ |
+#define SERVICES_BLAMER_PUBLIC_CPP_BLAMER_INTERFACE_H_ |
+ |
+#include "base/macros.h" |
+#include "services/service_manager/public/cpp/connector.h" |
+#include "services/blamer/public/interfaces/shared_memory_heap_registry.mojom.h" |
+ |
+namespace blamer { |
+ |
+class SharedMemoryHeap; |
+ |
+class BlamerInterface { |
+ public: |
+ ~BlamerInterface(); |
+ |
+ // Creates an instance of this service in the current process. If an instance |
+ // already exists then returns the existing one. |
+ BlamerInterface* CreateForProcess(service_manager::Connector* connector); |
+ |
+ // Returns a singleton instance of this service in the current process. |
+ BlamerInterface* GetForProcess(); |
+ |
+ // Returns the shared memory heap associated with this instance of the |
+ // service. |
+ SharedMemoryHeap* shared_memory_heap() const { |
+ return shared_memory_heap_.get(); |
+ } |
+ |
+ private: |
+ BlamerInterface(service_manager::Connector* connector); |
+ |
+ std::unique_ptr<SharedMemoryHeap> shared_memory_heap_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BlamerInterface); |
+}; |
+ |
+} // namespace blamer |
+ |
+#endif // SERVICES_BLAMER_PUBLIC_CPP_BLAMER_INTERFACE_H_ |