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

Unified Diff: components/arc/arc_bridge_service_factory.cc

Issue 1412863004: arc-bridge: Add the ARC Bridge Service (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Added Pref names and separated file I/O to the correct thread Created 5 years, 2 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: components/arc/arc_bridge_service_factory.cc
diff --git a/components/arc/arc_bridge_service_factory.cc b/components/arc/arc_bridge_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..035d7539461a8cf7c9a774f5e5d8aa04efb660cd
--- /dev/null
+++ b/components/arc/arc_bridge_service_factory.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 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.
+
+#include "components/arc/arc_bridge_service_factory.h"
+
+#include "components/arc/arc_bridge_service.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace arc {
+
+// static
+ArcBridgeService* ArcBridgeServiceFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<ArcBridgeService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+ArcBridgeServiceFactory* ArcBridgeServiceFactory::GetInstance() {
+ return base::Singleton<ArcBridgeServiceFactory>::get();
+}
+
+ArcBridgeServiceFactory::ArcBridgeServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ArcBridgeService",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+ArcBridgeServiceFactory::~ArcBridgeServiceFactory() {}
+
+KeyedService* ArcBridgeServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new ArcBridgeService(
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::FILE));
+}
+
+bool ArcBridgeServiceFactory::ServiceIsCreatedWithBrowserContext() const {
+ return true;
+}
+
+} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698