Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROMEOS_DBUS_UPSTART_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_UPSTART_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_UPSTART_CLIENT_H_ | 6 #define CHROMEOS_DBUS_UPSTART_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 8 #include "chromeos/chromeos_export.h" | 10 #include "chromeos/chromeos_export.h" |
| 9 #include "chromeos/dbus/dbus_client.h" | 11 #include "chromeos/dbus/dbus_client.h" |
| 10 | 12 |
| 11 namespace chromeos { | 13 namespace chromeos { |
| 12 | 14 |
| 13 // UpstartClient is used to communicate with the com.ubuntu.Upstart | 15 // UpstartClient is used to communicate with the com.ubuntu.Upstart |
| 14 // sevice. All methods should be called from the origin thread (UI thread) which | 16 // sevice. All methods should be called from the origin thread (UI thread) which |
| 15 // initializes the DBusThreadManager instance. | 17 // initializes the DBusThreadManager instance. |
| 16 class CHROMEOS_EXPORT UpstartClient : public DBusClient { | 18 class CHROMEOS_EXPORT UpstartClient : public DBusClient { |
| 17 public: | 19 public: |
| 18 ~UpstartClient() override; | 20 ~UpstartClient() override; |
| 19 | 21 |
| 22 using UpstartCallback = base::Callback<void(bool succeeded)>; | |
| 20 // Factory function, creates a new instance and returns ownership. | 23 // Factory function, creates a new instance and returns ownership. |
| 21 // For normal usage, access the singleton via DBusThreadManager::Get(). | 24 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 22 static UpstartClient* Create(); | 25 static UpstartClient* Create(); |
| 23 | 26 |
| 24 // Starts authpolicyd. | 27 // Starts authpolicyd. |
| 25 virtual void StartAuthPolicyService() = 0; | 28 virtual void StartAuthPolicyService() = 0; |
| 26 | 29 |
| 27 // Restarts authpolicyd. | 30 // Restarts authpolicyd. |
| 28 virtual void RestartAuthPolicyService() = 0; | 31 virtual void RestartAuthPolicyService() = 0; |
| 29 | 32 |
| 33 // Starts the separate media analytics process. | |
|
tbarzic
2017/05/11 18:49:57
nit: it's unclear to what separate refers. I'd jus
Luke Sorenson
2017/05/11 22:01:56
Done.
| |
| 34 virtual void StartMediaAnalytics(const UpstartCallback& callback) = 0; | |
| 35 | |
| 36 // Stops the media analytics process. | |
| 37 virtual void StopMediaAnalytics() = 0; | |
| 38 | |
| 30 protected: | 39 protected: |
| 31 // Create() should be used instead. | 40 // Create() should be used instead. |
| 32 UpstartClient(); | 41 UpstartClient(); |
| 33 | 42 |
| 34 private: | 43 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(UpstartClient); | 44 DISALLOW_COPY_AND_ASSIGN(UpstartClient); |
| 36 }; | 45 }; |
| 37 | 46 |
| 38 } // namespace chromeos | 47 } // namespace chromeos |
| 39 | 48 |
| 40 #endif // CHROMEOS_DBUS_UPSTART_CLIENT_H_ | 49 #endif // CHROMEOS_DBUS_UPSTART_CLIENT_H_ |
| OLD | NEW |