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

Side by Side Diff: chromeos/dbus/dbus_clients_common.h

Issue 2343993003: chromeos: Refactor D-Bus client creation for ash and browser processes (Closed)
Patch Set: rebase Created 4 years, 3 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
« no previous file with comments | « chromeos/dbus/dbus_clients_browser.cc ('k') | chromeos/dbus/dbus_clients_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_DBUS_DBUS_CLIENTS_COMMON_H_
6 #define CHROMEOS_DBUS_DBUS_CLIENTS_COMMON_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_client_types.h"
14
15 namespace dbus {
16 class Bus;
17 }
18
19 namespace chromeos {
20
21 class CrasAudioClient;
22 class CryptohomeClient;
23 class GsmSMSClient;
24 class ModemMessagingClient;
25 class PermissionBrokerClient;
26 class PowerManagerClient;
27 class SessionManagerClient;
28 class ShillDeviceClient;
29 class ShillIPConfigClient;
30 class ShillManagerClient;
31 class ShillProfileClient;
32 class ShillServiceClient;
33 class ShillThirdPartyVpnDriverClient;
34 class SMSClient;
35 class SystemClockClient;
36 class UpdateEngineClient;
37
38 // D-Bus clients used in multiple processes (e.g. ash, browser, mus).
39 class CHROMEOS_EXPORT DBusClientsCommon {
40 public:
41 // Creates real implementations for |real_client_mask| and fakes for all
42 // others. Fakes are used when running on Linux desktop and in tests.
43 explicit DBusClientsCommon(DBusClientTypeMask real_client_mask);
44 ~DBusClientsCommon();
45
46 // Returns true if |client| has a real (non-fake) client implementation.
47 bool IsUsingReal(DBusClientType client) const;
48
49 // Initialize proper runtime environment for its dbus clients.
50 void Initialize(dbus::Bus* system_bus);
51
52 private:
53 friend class DBusThreadManager;
54 friend class DBusThreadManagerSetter;
55
56 // Bitmask for clients with real implementations.
57 const DBusClientTypeMask real_client_mask_;
58
59 std::unique_ptr<CrasAudioClient> cras_audio_client_;
60 std::unique_ptr<CryptohomeClient> cryptohome_client_;
61 std::unique_ptr<GsmSMSClient> gsm_sms_client_;
62 std::unique_ptr<ModemMessagingClient> modem_messaging_client_;
63 std::unique_ptr<ShillDeviceClient> shill_device_client_;
64 std::unique_ptr<ShillIPConfigClient> shill_ipconfig_client_;
65 std::unique_ptr<ShillManagerClient> shill_manager_client_;
66 std::unique_ptr<ShillServiceClient> shill_service_client_;
67 std::unique_ptr<ShillProfileClient> shill_profile_client_;
68 std::unique_ptr<ShillThirdPartyVpnDriverClient>
69 shill_third_party_vpn_driver_client_;
70 std::unique_ptr<PermissionBrokerClient> permission_broker_client_;
71 std::unique_ptr<SMSClient> sms_client_;
72 std::unique_ptr<SystemClockClient> system_clock_client_;
73 std::unique_ptr<PowerManagerClient> power_manager_client_;
74 std::unique_ptr<SessionManagerClient> session_manager_client_;
75 std::unique_ptr<UpdateEngineClient> update_engine_client_;
76
77 DISALLOW_COPY_AND_ASSIGN(DBusClientsCommon);
78 };
79
80 } // namespace chromeos
81
82 #endif // CHROMEOS_DBUS_DBUS_CLIENTS_COMMON_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/dbus_clients_browser.cc ('k') | chromeos/dbus/dbus_clients_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698