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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 DBusThreadManager::~DBusThreadManager() { | 80 DBusThreadManager::~DBusThreadManager() { |
81 // PowerPolicyController's destructor depends on PowerManagerClient. | 81 // PowerPolicyController's destructor depends on PowerManagerClient. |
82 power_policy_controller_.reset(); | 82 power_policy_controller_.reset(); |
83 | 83 |
84 // Delete all D-Bus clients before shutting down the system bus. | 84 // Delete all D-Bus clients before shutting down the system bus. |
85 client_bundle_.reset(); | 85 client_bundle_.reset(); |
86 | 86 |
87 // Shut down the bus. During the browser shutdown, it's ok to shut down | 87 // Shut down the bus. During the browser shutdown, it's ok to shut down |
88 // the bus synchronously. | 88 // the bus synchronously. |
89 if (system_bus_) | 89 if (system_bus_.get()) |
90 system_bus_->ShutdownOnDBusThreadAndBlock(); | 90 system_bus_->ShutdownOnDBusThreadAndBlock(); |
91 | 91 |
92 // Stop the D-Bus thread. | 92 // Stop the D-Bus thread. |
93 if (dbus_thread_) | 93 if (dbus_thread_) |
94 dbus_thread_->Stop(); | 94 dbus_thread_->Stop(); |
95 | 95 |
96 dbus::statistics::Shutdown(); | 96 dbus::statistics::Shutdown(); |
97 | 97 |
98 if (g_dbus_thread_manager == NULL) | 98 if (g_dbus_thread_manager == NULL) |
99 return; // Called form Shutdown() or local test instance. | 99 return; // Called form Shutdown() or local test instance. |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 client.Pass(); | 631 client.Pass(); |
632 } | 632 } |
633 | 633 |
634 void DBusThreadManagerSetter::SetUpdateEngineClient( | 634 void DBusThreadManagerSetter::SetUpdateEngineClient( |
635 scoped_ptr<UpdateEngineClient> client) { | 635 scoped_ptr<UpdateEngineClient> client) { |
636 DBusThreadManager::Get()->client_bundle_->update_engine_client_ = | 636 DBusThreadManager::Get()->client_bundle_->update_engine_client_ = |
637 client.Pass(); | 637 client.Pass(); |
638 } | 638 } |
639 | 639 |
640 } // namespace chromeos | 640 } // namespace chromeos |
OLD | NEW |