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 27 matching lines...) Expand all Loading... |
38 #include "chromeos/dbus/image_burner_client.h" | 38 #include "chromeos/dbus/image_burner_client.h" |
39 #include "chromeos/dbus/introspectable_client.h" | 39 #include "chromeos/dbus/introspectable_client.h" |
40 #include "chromeos/dbus/modem_messaging_client.h" | 40 #include "chromeos/dbus/modem_messaging_client.h" |
41 #include "chromeos/dbus/permission_broker_client.h" | 41 #include "chromeos/dbus/permission_broker_client.h" |
42 #include "chromeos/dbus/power_manager_client.h" | 42 #include "chromeos/dbus/power_manager_client.h" |
43 #include "chromeos/dbus/session_manager_client.h" | 43 #include "chromeos/dbus/session_manager_client.h" |
44 #include "chromeos/dbus/sms_client.h" | 44 #include "chromeos/dbus/sms_client.h" |
45 #include "chromeos/dbus/speech_synthesizer_client.h" | 45 #include "chromeos/dbus/speech_synthesizer_client.h" |
46 #include "chromeos/dbus/update_engine_client.h" | 46 #include "chromeos/dbus/update_engine_client.h" |
47 #include "dbus/bus.h" | 47 #include "dbus/bus.h" |
| 48 #include "dbus/dbus_statistics.h" |
48 | 49 |
49 namespace chromeos { | 50 namespace chromeos { |
50 | 51 |
51 static DBusThreadManager* g_dbus_thread_manager = NULL; | 52 static DBusThreadManager* g_dbus_thread_manager = NULL; |
52 static bool g_dbus_thread_manager_set_for_testing = false; | 53 static bool g_dbus_thread_manager_set_for_testing = false; |
53 | 54 |
54 // The DBusThreadManager implementation used in production. | 55 // The DBusThreadManager implementation used in production. |
55 class DBusThreadManagerImpl : public DBusThreadManager { | 56 class DBusThreadManagerImpl : public DBusThreadManager { |
56 public: | 57 public: |
57 explicit DBusThreadManagerImpl(DBusClientImplementationType client_type) { | 58 explicit DBusThreadManagerImpl(DBusClientImplementationType client_type) { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 void DBusThreadManager::Shutdown() { | 498 void DBusThreadManager::Shutdown() { |
498 // If we called InitializeForTesting, this may get called more than once. | 499 // If we called InitializeForTesting, this may get called more than once. |
499 // Ensure that we only shutdown DBusThreadManager once. | 500 // Ensure that we only shutdown DBusThreadManager once. |
500 CHECK(g_dbus_thread_manager || g_dbus_thread_manager_set_for_testing); | 501 CHECK(g_dbus_thread_manager || g_dbus_thread_manager_set_for_testing); |
501 delete g_dbus_thread_manager; | 502 delete g_dbus_thread_manager; |
502 g_dbus_thread_manager = NULL; | 503 g_dbus_thread_manager = NULL; |
503 VLOG(1) << "DBusThreadManager Shutdown completed"; | 504 VLOG(1) << "DBusThreadManager Shutdown completed"; |
504 } | 505 } |
505 | 506 |
506 DBusThreadManager::DBusThreadManager() { | 507 DBusThreadManager::DBusThreadManager() { |
| 508 dbus::statistics::Initialize(); |
507 } | 509 } |
508 | 510 |
509 DBusThreadManager::~DBusThreadManager() { | 511 DBusThreadManager::~DBusThreadManager() { |
| 512 dbus::statistics::Shutdown(); |
510 } | 513 } |
511 | 514 |
512 // static | 515 // static |
513 DBusThreadManager* DBusThreadManager::Get() { | 516 DBusThreadManager* DBusThreadManager::Get() { |
514 CHECK(g_dbus_thread_manager) | 517 CHECK(g_dbus_thread_manager) |
515 << "DBusThreadManager::Get() called before Initialize()"; | 518 << "DBusThreadManager::Get() called before Initialize()"; |
516 return g_dbus_thread_manager; | 519 return g_dbus_thread_manager; |
517 } | 520 } |
518 | 521 |
519 } // namespace chromeos | 522 } // namespace chromeos |
OLD | NEW |