| 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 #include "dbus/object_proxy.h" | 5 #include "dbus/object_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 OnPendingCallIsCompleteData* data = | 281 OnPendingCallIsCompleteData* data = |
| 282 new OnPendingCallIsCompleteData(this, response_callback, error_callback, | 282 new OnPendingCallIsCompleteData(this, response_callback, error_callback, |
| 283 start_time); | 283 start_time); |
| 284 | 284 |
| 285 // This returns false only when unable to allocate memory. | 285 // This returns false only when unable to allocate memory. |
| 286 const bool success = dbus_pending_call_set_notify( | 286 const bool success = dbus_pending_call_set_notify( |
| 287 pending_call, | 287 pending_call, |
| 288 &ObjectProxy::OnPendingCallIsCompleteThunk, | 288 &ObjectProxy::OnPendingCallIsCompleteThunk, |
| 289 data, | 289 data, |
| 290 &DeleteVoidPointer<OnPendingCallIsCompleteData>); | 290 &DeleteVoidPointer<OnPendingCallIsCompleteData>); |
| 291 CHECK(success) << "Unable to allocate memory"; | 291 // Unable to allocate memory |
| 292 CHECK(success); |
| 292 pending_calls_.insert(pending_call); | 293 pending_calls_.insert(pending_call); |
| 293 | 294 |
| 294 // It's now safe to unref the request message. | 295 // It's now safe to unref the request message. |
| 295 dbus_message_unref(request_message); | 296 dbus_message_unref(request_message); |
| 296 } | 297 } |
| 297 | 298 |
| 298 void ObjectProxy::OnPendingCallIsComplete(DBusPendingCall* pending_call, | 299 void ObjectProxy::OnPendingCallIsComplete(DBusPendingCall* pending_call, |
| 299 ResponseCallback response_callback, | 300 ResponseCallback response_callback, |
| 300 ErrorCallback error_callback, | 301 ErrorCallback error_callback, |
| 301 base::TimeTicks start_time) { | 302 base::TimeTicks start_time) { |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 bool service_is_available) { | 709 bool service_is_available) { |
| 709 bus_->AssertOnOriginThread(); | 710 bus_->AssertOnOriginThread(); |
| 710 | 711 |
| 711 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 712 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
| 712 callbacks.swap(wait_for_service_to_be_available_callbacks_); | 713 callbacks.swap(wait_for_service_to_be_available_callbacks_); |
| 713 for (size_t i = 0; i < callbacks.size(); ++i) | 714 for (size_t i = 0; i < callbacks.size(); ++i) |
| 714 callbacks[i].Run(service_is_available); | 715 callbacks[i].Run(service_is_available); |
| 715 } | 716 } |
| 716 | 717 |
| 717 } // namespace dbus | 718 } // namespace dbus |
| OLD | NEW |