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

Side by Side Diff: chromeos/dbus/dbus_thread_manager.cc

Issue 181413006: Replace misc. network stub flags with more flexible ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/fake_dbus_thread_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
472 shill_stub_helper::SetupDefaultEnvironment(); 471 fake_dbus_thread_manager->SetupDefaultEnvironment();
473 VLOG(1) << "DBusThreadManager initialized with stub implementation"; 472 VLOG(1) << "DBusThreadManager initialized with stub implementation";
474 } 473 }
475 474
476 // static 475 // static
477 bool DBusThreadManager::IsInitialized() { 476 bool DBusThreadManager::IsInitialized() {
478 return g_dbus_thread_manager != NULL; 477 return g_dbus_thread_manager != NULL;
479 } 478 }
480 479
481 // static 480 // static
482 void DBusThreadManager::Shutdown() { 481 void DBusThreadManager::Shutdown() {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 g_dbus_thread_manager->GetSystemBus()->GetManagedObjects(); 564 g_dbus_thread_manager->GetSystemBus()->GetManagedObjects();
566 } 565 }
567 566
568 // static 567 // static
569 void DBusThreadManager::InitClient(DBusClient* client) { 568 void DBusThreadManager::InitClient(DBusClient* client) {
570 if (client) 569 if (client)
571 client->Init(g_dbus_thread_manager->GetSystemBus()); 570 client->Init(g_dbus_thread_manager->GetSystemBus());
572 } 571 }
573 572
574 } // namespace chromeos 573 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/fake_dbus_thread_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698