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 // void Echo(dbus::MethodCall* method_call, | 103 // Response* Echo(dbus::MethodCall* method_call) { |
104 // dbus::ExportedObject::ResponseSender response_sender) { | |
105 // // Do something with method_call. | 104 // // Do something with method_call. |
106 // Response* response = Response::FromMethodCall(method_call); | 105 // Response* response = Response::FromMethodCall(method_call); |
107 // // Build response here. | 106 // // Build response here. |
108 // // Can send an immediate response here to implement a synchronous service | 107 // return response; |
109 // // or store the response_sender and send a response later to implement an | |
110 // // asynchronous service. | |
111 // response_sender.Run(response); | |
112 // } | 108 // } |
113 // | 109 // |
114 // void OnExported(const std::string& interface_name, | 110 // void OnExported(const std::string& interface_name, |
115 // const std::string& object_path, | 111 // const std::string& object_path, |
116 // bool success) { | 112 // bool success) { |
117 // // success is true if the method was exported successfully. | 113 // // success is true if the method was exported successfully. |
118 // } | 114 // } |
119 // | 115 // |
120 // ... | 116 // ... |
121 // dbus::ExportedObject* exported_object = | 117 // dbus::ExportedObject* exported_object = |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // OnAddTimeout()/OnRemoveTimeou() are balanced. | 475 // OnAddTimeout()/OnRemoveTimeou() are balanced. |
480 int num_pending_watches_; | 476 int num_pending_watches_; |
481 int num_pending_timeouts_; | 477 int num_pending_timeouts_; |
482 | 478 |
483 DISALLOW_COPY_AND_ASSIGN(Bus); | 479 DISALLOW_COPY_AND_ASSIGN(Bus); |
484 }; | 480 }; |
485 | 481 |
486 } // namespace dbus | 482 } // namespace dbus |
487 | 483 |
488 #endif // DBUS_BUS_H_ | 484 #endif // DBUS_BUS_H_ |
OLD | NEW |