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/chromeos/chromeos_version.h" | 9 #include "base/chromeos/chromeos_version.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 client_type_override_(client_type) { | 60 client_type_override_(client_type) { |
61 // If --dbus-stub was requested, pass STUB to specific components; | 61 // If --dbus-stub was requested, pass STUB to specific components; |
62 // Many components like login are not useful with a stub implementation. | 62 // Many components like login are not useful with a stub implementation. |
63 if (CommandLine::ForCurrentProcess()->HasSwitch( | 63 if (CommandLine::ForCurrentProcess()->HasSwitch( |
64 chromeos::switches::kDbusStub)) { | 64 chromeos::switches::kDbusStub)) { |
65 client_type_override_ = STUB_DBUS_CLIENT_IMPLEMENTATION; | 65 client_type_override_ = STUB_DBUS_CLIENT_IMPLEMENTATION; |
66 } | 66 } |
67 | 67 |
68 // Create the D-Bus thread. | 68 // Create the D-Bus thread. |
69 base::Thread::Options thread_options; | 69 base::Thread::Options thread_options; |
70 thread_options.message_loop_type = MessageLoop::TYPE_IO; | 70 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; |
71 dbus_thread_.reset(new base::Thread("D-Bus thread")); | 71 dbus_thread_.reset(new base::Thread("D-Bus thread")); |
72 dbus_thread_->StartWithOptions(thread_options); | 72 dbus_thread_->StartWithOptions(thread_options); |
73 | 73 |
74 // Create the connection to the system bus. | 74 // Create the connection to the system bus. |
75 dbus::Bus::Options system_bus_options; | 75 dbus::Bus::Options system_bus_options; |
76 system_bus_options.bus_type = dbus::Bus::SYSTEM; | 76 system_bus_options.bus_type = dbus::Bus::SYSTEM; |
77 system_bus_options.connection_type = dbus::Bus::PRIVATE; | 77 system_bus_options.connection_type = dbus::Bus::PRIVATE; |
78 system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy(); | 78 system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy(); |
79 system_bus_ = new dbus::Bus(system_bus_options); | 79 system_bus_ = new dbus::Bus(system_bus_options); |
80 } | 80 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 } | 510 } |
511 | 511 |
512 // static | 512 // static |
513 DBusThreadManager* DBusThreadManager::Get() { | 513 DBusThreadManager* DBusThreadManager::Get() { |
514 CHECK(g_dbus_thread_manager) | 514 CHECK(g_dbus_thread_manager) |
515 << "DBusThreadManager::Get() called before Initialize()"; | 515 << "DBusThreadManager::Get() called before Initialize()"; |
516 return g_dbus_thread_manager; | 516 return g_dbus_thread_manager; |
517 } | 517 } |
518 | 518 |
519 } // namespace chromeos | 519 } // namespace chromeos |
OLD | NEW |