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

Unified Diff: services/blamer/public/cpp/blamer_interface.h

Issue 2885363004: [Hacky prototype] Create a shared-memory high-performance reporting service.
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698