Chromium Code Reviews| 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_OBJECT_PROXY_H_ | 5 #ifndef DBUS_OBJECT_PROXY_H_ |
| 6 #define DBUS_OBJECT_PROXY_H_ | 6 #define DBUS_OBJECT_PROXY_H_ |
| 7 | 7 |
| 8 #include <dbus/dbus.h> | 8 #include <dbus/dbus.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 const base::StringPiece& method_name, | 229 const base::StringPiece& method_name, |
| 230 const base::StringPiece& error_name, | 230 const base::StringPiece& error_name, |
| 231 const base::StringPiece& error_message) const; | 231 const base::StringPiece& error_message) const; |
| 232 | 232 |
| 233 // Used as ErrorCallback by CallMethod(). | 233 // Used as ErrorCallback by CallMethod(). |
| 234 void OnCallMethodError(const std::string& interface_name, | 234 void OnCallMethodError(const std::string& interface_name, |
| 235 const std::string& method_name, | 235 const std::string& method_name, |
| 236 ResponseCallback response_callback, | 236 ResponseCallback response_callback, |
| 237 ErrorResponse* error_response); | 237 ErrorResponse* error_response); |
| 238 | 238 |
| 239 // Add the match rule to the bus and associate the callback with the signal. | |
|
satorux1
2012/10/22 04:50:42
Adds
Haruki Sato
2012/10/24 08:28:05
Done.
| |
| 240 bool AddMatchRuleAndCallback(std::string match_rule, | |
|
satorux1
2012/10/22 04:50:42
Please use const std::string& for function paramet
Haruki Sato
2012/10/24 08:28:05
Done.
Thanks.
| |
| 241 std::string absolute_signal_name, | |
|
satorux1
2012/10/22 04:50:42
indentation is off
Haruki Sato
2012/10/24 08:28:05
Done.
Thanks.
| |
| 242 SignalCallback signal_callback); | |
| 243 | |
| 244 | |
| 245 // Add the match rule to the bus so that HandleMessage can see the signal. | |
| 246 bool AddMatchRuleWithoutCallback(std::string match_rule, | |
| 247 std::string absolute_signal_name); | |
|
satorux1
2012/10/22 05:23:32
indentation is off.
Haruki Sato
2012/10/24 08:28:05
Done.
| |
| 248 | |
| 249 // Handle NameOwnerChanged signal from D-Bus's special message bus | |
| 250 DBusHandlerResult HandleNameOwnerChanged(dbus::Signal* signal); | |
| 251 | |
| 252 // Call D-Bus's GetNameOwner method and update the owner of |service_name_|. | |
| 253 bool UpdateNameOwner(); | |
| 254 | |
| 239 scoped_refptr<Bus> bus_; | 255 scoped_refptr<Bus> bus_; |
| 240 std::string service_name_; | 256 std::string service_name_; |
| 241 ObjectPath object_path_; | 257 ObjectPath object_path_; |
| 242 | 258 |
| 243 // True if the message filter was added. | 259 // True if the message filter was added. |
| 244 bool filter_added_; | 260 bool filter_added_; |
| 245 | 261 |
| 246 // The method table where keys are absolute signal names (i.e. interface | 262 // The method table where keys are absolute signal names (i.e. interface |
| 247 // name + signal name), and values are the corresponding callbacks. | 263 // name + signal name), and values are the corresponding callbacks. |
| 248 typedef std::map<std::string, SignalCallback> MethodTable; | 264 typedef std::map<std::string, SignalCallback> MethodTable; |
| 249 MethodTable method_table_; | 265 MethodTable method_table_; |
| 250 | 266 |
| 251 std::set<std::string> match_rules_; | 267 std::set<std::string> match_rules_; |
| 252 | 268 |
| 253 const bool ignore_service_unknown_errors_; | 269 const bool ignore_service_unknown_errors_; |
| 254 | 270 |
| 271 std::string service_name_owner_; | |
| 272 | |
| 255 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 273 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
| 256 }; | 274 }; |
| 257 | 275 |
| 258 } // namespace dbus | 276 } // namespace dbus |
| 259 | 277 |
| 260 #endif // DBUS_OBJECT_PROXY_H_ | 278 #endif // DBUS_OBJECT_PROXY_H_ |
| OLD | NEW |