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 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_LIVENESS_SERVICE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_LIVENESS_SERVICE_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_LIVENESS_SERVICE_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DBUS_LIVENESS_SERVICE_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // | 34 // |
35 // (An empty response should be returned.) | 35 // (An empty response should be returned.) |
36 class LivenessServiceProvider | 36 class LivenessServiceProvider |
37 : public CrosDBusService::ServiceProviderInterface { | 37 : public CrosDBusService::ServiceProviderInterface { |
38 public: | 38 public: |
39 LivenessServiceProvider(); | 39 LivenessServiceProvider(); |
40 virtual ~LivenessServiceProvider(); | 40 virtual ~LivenessServiceProvider(); |
41 | 41 |
42 // CrosDBusService::ServiceProviderInterface overrides: | 42 // CrosDBusService::ServiceProviderInterface overrides: |
43 virtual void Start( | 43 virtual void Start( |
44 scoped_refptr<dbus::ExportedObject> exported_object) OVERRIDE; | 44 scoped_refptr<dbus::ExportedObject> exported_object) override; |
45 | 45 |
46 private: | 46 private: |
47 // Called from ExportedObject when CheckLiveness() is exported as a D-Bus | 47 // Called from ExportedObject when CheckLiveness() is exported as a D-Bus |
48 // method or failed to be exported. | 48 // method or failed to be exported. |
49 void OnExported(const std::string& interface_name, | 49 void OnExported(const std::string& interface_name, |
50 const std::string& method_name, | 50 const std::string& method_name, |
51 bool success); | 51 bool success); |
52 | 52 |
53 // Called on UI thread in response to a D-Bus request. | 53 // Called on UI thread in response to a D-Bus request. |
54 void CheckLiveness(dbus::MethodCall* method_call, | 54 void CheckLiveness(dbus::MethodCall* method_call, |
55 dbus::ExportedObject::ResponseSender response_sender); | 55 dbus::ExportedObject::ResponseSender response_sender); |
56 | 56 |
57 // Keep this last so that all weak pointers will be invalidated at the | 57 // Keep this last so that all weak pointers will be invalidated at the |
58 // beginning of destruction. | 58 // beginning of destruction. |
59 base::WeakPtrFactory<LivenessServiceProvider> weak_ptr_factory_; | 59 base::WeakPtrFactory<LivenessServiceProvider> weak_ptr_factory_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(LivenessServiceProvider); | 61 DISALLOW_COPY_AND_ASSIGN(LivenessServiceProvider); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace chromeos | 64 } // namespace chromeos |
65 | 65 |
66 #endif // CHROME_BROWSER_CHROMEOS_DBUS_LIVENESS_SERVICE_PROVIDER_H_ | 66 #endif // CHROME_BROWSER_CHROMEOS_DBUS_LIVENESS_SERVICE_PROVIDER_H_ |
OLD | NEW |