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 DBUS_TEST_SERVICE_H_ | 5 #ifndef DBUS_TEST_SERVICE_H_ |
6 #define DBUS_TEST_SERVICE_H_ | 6 #define DBUS_TEST_SERVICE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Returns true if the bus has the D-Bus thread. | 58 // Returns true if the bus has the D-Bus thread. |
59 bool HasDBusThread(); | 59 bool HasDBusThread(); |
60 | 60 |
61 // Sends "Test" signal with the given message from the exported object. | 61 // Sends "Test" signal with the given message from the exported object. |
62 void SendTestSignal(const std::string& message); | 62 void SendTestSignal(const std::string& message); |
63 | 63 |
64 // Sends "Test" signal with the given message from the root object ("/"). | 64 // Sends "Test" signal with the given message from the root object ("/"). |
65 // This function emulates dbus-send's behavior. | 65 // This function emulates dbus-send's behavior. |
66 void SendTestSignalFromRoot(const std::string& message); | 66 void SendTestSignalFromRoot(const std::string& message); |
67 | 67 |
| 68 // Request the ownership of a well-known name "TestService". |
| 69 void RequestOwnership(); |
| 70 |
68 private: | 71 private: |
69 // Helper function for SendTestSignal(). | 72 // Helper function for SendTestSignal(). |
70 void SendTestSignalInternal(const std::string& message); | 73 void SendTestSignalInternal(const std::string& message); |
71 | 74 |
72 // Helper function for SendTestSignalFromRoot. | 75 // Helper function for SendTestSignalFromRoot. |
73 void SendTestSignalFromRootInternal(const std::string& message); | 76 void SendTestSignalFromRootInternal(const std::string& message); |
74 | 77 |
75 // Helper function for ShutdownAndBlock(). | 78 // Helper function for ShutdownAndBlock(). |
76 void ShutdownAndBlockInternal(); | 79 void ShutdownAndBlockInternal(); |
77 | 80 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Allows the name property to be changed, errors otherwise. | 123 // Allows the name property to be changed, errors otherwise. |
121 void SetProperty(MethodCall* method_call, | 124 void SetProperty(MethodCall* method_call, |
122 dbus::ExportedObject::ResponseSender response_sender); | 125 dbus::ExportedObject::ResponseSender response_sender); |
123 | 126 |
124 // Sends a property changed signal for the name property. | 127 // Sends a property changed signal for the name property. |
125 void SendPropertyChangedSignal(const std::string& name); | 128 void SendPropertyChangedSignal(const std::string& name); |
126 | 129 |
127 // Helper function for SendPropertyChangedSignal(). | 130 // Helper function for SendPropertyChangedSignal(). |
128 void SendPropertyChangedSignalInternal(const std::string& name); | 131 void SendPropertyChangedSignalInternal(const std::string& name); |
129 | 132 |
| 133 // Helper function for RequestOwnership(). |
| 134 void RequestOwnershipInternal(); |
| 135 |
130 scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_; | 136 scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_; |
131 base::WaitableEvent on_all_methods_exported_; | 137 base::WaitableEvent on_all_methods_exported_; |
132 // The number of methods actually exported. | 138 // The number of methods actually exported. |
133 int num_exported_methods_; | 139 int num_exported_methods_; |
134 | 140 |
135 scoped_refptr<Bus> bus_; | 141 scoped_refptr<Bus> bus_; |
136 ExportedObject* exported_object_; | 142 ExportedObject* exported_object_; |
137 }; | 143 }; |
138 | 144 |
139 } // namespace dbus | 145 } // namespace dbus |
140 | 146 |
141 #endif // DBUS_TEST_SERVICE_H_ | 147 #endif // DBUS_TEST_SERVICE_H_ |
OLD | NEW |