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

Unified Diff: ash/common/dbus_thread_manager_ash.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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
« no previous file with comments | « ash/common/dbus_thread_manager_ash.h ('k') | ash/common/system/chromeos/audio/tray_audio_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/dbus_thread_manager_ash.cc
diff --git a/ash/common/dbus_thread_manager_ash.cc b/ash/common/dbus_thread_manager_ash.cc
new file mode 100644
index 0000000000000000000000000000000000000000..34bb857c7fe109aec943f8836359b48e07c678fa
--- /dev/null
+++ b/ash/common/dbus_thread_manager_ash.cc
@@ -0,0 +1,47 @@
+#include "ash/common/dbus_thread_manager_ash.h"
+
+#include "chromeos/dbus/dbus_thread_manager.h"
+
+namespace ash {
+namespace {
+
+DBusThreadManagerAsh* g_instance = nullptr;
+
+} // namespace
+
+// static
+DBusThreadManagerAsh* DBusThreadManagerAsh::Get() {
+ CHECK(g_instance);
+ return g_instance;
+}
+
+DBusThreadManagerAsh::DBusThreadManagerAsh() {
+ DCHECK(!g_instance);
+ g_instance = this;
+
+ // Ensure the services we need are initialized.
+ chromeos::DBusThreadManager* manager = chromeos::DBusThreadManager::Get();
+ DCHECK(manager->GetPowerManagerClient());
+ DCHECK(manager->GetSessionManagerClient());
+ DCHECK(manager->GetSystemClockClient());
+}
+
+DBusThreadManagerAsh::~DBusThreadManagerAsh() {
+ DCHECK_EQ(this, g_instance);
+ g_instance = nullptr;
+}
+
+//JAMES for now, just forward
+chromeos::PowerManagerClient* DBusThreadManagerAsh::GetPowerManagerClient() {
+ return chromeos::DBusThreadManager::Get()->GetPowerManagerClient();
+}
+
+chromeos::SessionManagerClient* DBusThreadManagerAsh::GetSessionManagerClient() {
+ return chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
+}
+
+chromeos::SystemClockClient* DBusThreadManagerAsh::GetSystemClockClient() {
+ return chromeos::DBusThreadManager::Get()->GetSystemClockClient();
+}
+
+} // namespace ash
« no previous file with comments | « ash/common/dbus_thread_manager_ash.h ('k') | ash/common/system/chromeos/audio/tray_audio_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698