Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/dbus_thread_manager.h" | 5 #include "chromeos/dbus/dbus_thread_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 #include "chromeos/dbus/nfc_tag_client.h" | 34 #include "chromeos/dbus/nfc_tag_client.h" |
| 35 #include "chromeos/dbus/permission_broker_client.h" | 35 #include "chromeos/dbus/permission_broker_client.h" |
| 36 #include "chromeos/dbus/power_manager_client.h" | 36 #include "chromeos/dbus/power_manager_client.h" |
| 37 #include "chromeos/dbus/power_policy_controller.h" | 37 #include "chromeos/dbus/power_policy_controller.h" |
| 38 #include "chromeos/dbus/session_manager_client.h" | 38 #include "chromeos/dbus/session_manager_client.h" |
| 39 #include "chromeos/dbus/shill_device_client.h" | 39 #include "chromeos/dbus/shill_device_client.h" |
| 40 #include "chromeos/dbus/shill_ipconfig_client.h" | 40 #include "chromeos/dbus/shill_ipconfig_client.h" |
| 41 #include "chromeos/dbus/shill_manager_client.h" | 41 #include "chromeos/dbus/shill_manager_client.h" |
| 42 #include "chromeos/dbus/shill_profile_client.h" | 42 #include "chromeos/dbus/shill_profile_client.h" |
| 43 #include "chromeos/dbus/shill_service_client.h" | 43 #include "chromeos/dbus/shill_service_client.h" |
| 44 #include "chromeos/dbus/shill_stub_helper.h" | |
| 45 #include "chromeos/dbus/sms_client.h" | 44 #include "chromeos/dbus/sms_client.h" |
| 46 #include "chromeos/dbus/system_clock_client.h" | 45 #include "chromeos/dbus/system_clock_client.h" |
| 47 #include "chromeos/dbus/update_engine_client.h" | 46 #include "chromeos/dbus/update_engine_client.h" |
| 48 #include "dbus/bus.h" | 47 #include "dbus/bus.h" |
| 49 #include "dbus/dbus_statistics.h" | 48 #include "dbus/dbus_statistics.h" |
| 50 | 49 |
| 51 namespace chromeos { | 50 namespace chromeos { |
| 52 | 51 |
| 53 static DBusThreadManager* g_dbus_thread_manager = NULL; | 52 static DBusThreadManager* g_dbus_thread_manager = NULL; |
| 54 static DBusThreadManager* g_dbus_thread_manager_for_testing = NULL; | 53 static DBusThreadManager* g_dbus_thread_manager_for_testing = NULL; |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 } | 460 } |
| 462 | 461 |
| 463 // static | 462 // static |
| 464 void DBusThreadManager::InitializeWithStub() { | 463 void DBusThreadManager::InitializeWithStub() { |
| 465 // If we initialize DBusThreadManager twice we may also be shutting it down | 464 // If we initialize DBusThreadManager twice we may also be shutting it down |
| 466 // early; do not allow that. | 465 // early; do not allow that. |
| 467 CHECK(g_dbus_thread_manager == NULL); | 466 CHECK(g_dbus_thread_manager == NULL); |
| 468 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager; | 467 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager; |
| 469 fake_dbus_thread_manager->SetFakeClients(); | 468 fake_dbus_thread_manager->SetFakeClients(); |
| 470 g_dbus_thread_manager = fake_dbus_thread_manager; | 469 g_dbus_thread_manager = fake_dbus_thread_manager; |
| 471 InitializeClients(); | 470 InitializeClients(); |
|
pneubeck (no reviews)
2014/02/28 09:37:59
please make the SetupDefaultEnvironment explicit a
stevenjb
2014/02/28 17:43:06
Constructing the Fake manger client twice doesn't
| |
| 472 shill_stub_helper::SetupDefaultEnvironment(); | |
| 473 VLOG(1) << "DBusThreadManager initialized with stub implementation"; | 471 VLOG(1) << "DBusThreadManager initialized with stub implementation"; |
| 474 } | 472 } |
| 475 | 473 |
| 476 // static | 474 // static |
| 477 bool DBusThreadManager::IsInitialized() { | 475 bool DBusThreadManager::IsInitialized() { |
| 478 return g_dbus_thread_manager != NULL; | 476 return g_dbus_thread_manager != NULL; |
| 479 } | 477 } |
| 480 | 478 |
| 481 // static | 479 // static |
| 482 void DBusThreadManager::Shutdown() { | 480 void DBusThreadManager::Shutdown() { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 g_dbus_thread_manager->GetSystemBus()->GetManagedObjects(); | 563 g_dbus_thread_manager->GetSystemBus()->GetManagedObjects(); |
| 566 } | 564 } |
| 567 | 565 |
| 568 // static | 566 // static |
| 569 void DBusThreadManager::InitClient(DBusClient* client) { | 567 void DBusThreadManager::InitClient(DBusClient* client) { |
| 570 if (client) | 568 if (client) |
| 571 client->Init(g_dbus_thread_manager->GetSystemBus()); | 569 client->Init(g_dbus_thread_manager->GetSystemBus()); |
| 572 } | 570 } |
| 573 | 571 |
| 574 } // namespace chromeos | 572 } // namespace chromeos |
| OLD | NEW |