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

Unified Diff: components/arc/arc_service_manager.h

Issue 1496193002: arc: Add ArcServiceManager to own all future ARC services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: readded file Created 5 years 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
« no previous file with comments | « components/arc/arc_bridge_service.cc ('k') | components/arc/arc_service_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_service_manager.h
diff --git a/components/arc/arc_service_manager.h b/components/arc/arc_service_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..f86d6bed02db7592bece8c0221c20d294a3ed937
--- /dev/null
+++ b/components/arc/arc_service_manager.h
@@ -0,0 +1,49 @@
+// Copyright 2015 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 COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_
+#define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+
+class SequencedTaskRunner;
+class SingleThreadTaskRunner;
+
+} // namespace base
+
+namespace arc {
+
+class ArcBridgeService;
+
+// Manages creation and destruction of services that communicate with the ARC
+// instance via the ArcBridgeService.
+class ArcServiceManager {
+ public:
+ ArcServiceManager(
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
+ const scoped_refptr<base::SequencedTaskRunner>& file_task_runner);
+ virtual ~ArcServiceManager();
+
+ // |arc_bridge_service| can only be accessed on the thread that this
+ // class was created on.
+ ArcBridgeService* arc_bridge_service();
+
+ // Gets the global instance of the ARC Service Manager. This can only be
+ // called on the thread that this class was created on.
+ static ArcServiceManager* Get();
+
+ private:
+ scoped_refptr<base::SequencedTaskRunner> origin_task_runner_;
+ scoped_ptr<ArcBridgeService> arc_bridge_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcServiceManager);
+};
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_
« no previous file with comments | « components/arc/arc_bridge_service.cc ('k') | components/arc/arc_service_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698