| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BUS_H_ | 5 #ifndef DBUS_BUS_H_ |
| 6 #define DBUS_BUS_H_ | 6 #define DBUS_BUS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // if (!response) | 93 // if (!response) |
| 94 // return; | 94 // return; |
| 95 // } | 95 // } |
| 96 // | 96 // |
| 97 // ... | 97 // ... |
| 98 // object_proxy.CallMethod(&method_call, timeout_ms, | 98 // object_proxy.CallMethod(&method_call, timeout_ms, |
| 99 // base::Bind(&OnResponse)); | 99 // base::Bind(&OnResponse)); |
| 100 // | 100 // |
| 101 // Exporting a method: | 101 // Exporting a method: |
| 102 // | 102 // |
| 103 // Response* Echo(dbus::MethodCall* method_call) { | 103 // void Echo(dbus::MethodCall* method_call, |
| 104 // dbus::ExportedObject::ResponseSender response_sender) { |
| 104 // // Do something with method_call. | 105 // // Do something with method_call. |
| 105 // Response* response = Response::FromMethodCall(method_call); | 106 // Response* response = Response::FromMethodCall(method_call); |
| 106 // // Build response here. | 107 // // Build response here. |
| 107 // return response; | 108 // // Can send an immediate response here to implement a synchronous service |
| 109 // // or store the response_sender and send a response later to implement an |
| 110 // // asynchronous service. |
| 111 // response_sender.Run(response); |
| 108 // } | 112 // } |
| 109 // | 113 // |
| 110 // void OnExported(const std::string& interface_name, | 114 // void OnExported(const std::string& interface_name, |
| 111 // const std::string& object_path, | 115 // const std::string& object_path, |
| 112 // bool success) { | 116 // bool success) { |
| 113 // // success is true if the method was exported successfully. | 117 // // success is true if the method was exported successfully. |
| 114 // } | 118 // } |
| 115 // | 119 // |
| 116 // ... | 120 // ... |
| 117 // dbus::ExportedObject* exported_object = | 121 // dbus::ExportedObject* exported_object = |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // OnAddTimeout()/OnRemoveTimeou() are balanced. | 479 // OnAddTimeout()/OnRemoveTimeou() are balanced. |
| 476 int num_pending_watches_; | 480 int num_pending_watches_; |
| 477 int num_pending_timeouts_; | 481 int num_pending_timeouts_; |
| 478 | 482 |
| 479 DISALLOW_COPY_AND_ASSIGN(Bus); | 483 DISALLOW_COPY_AND_ASSIGN(Bus); |
| 480 }; | 484 }; |
| 481 | 485 |
| 482 } // namespace dbus | 486 } // namespace dbus |
| 483 | 487 |
| 484 #endif // DBUS_BUS_H_ | 488 #endif // DBUS_BUS_H_ |
| OLD | NEW |