| 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/exported_object.h" | 5 #include "dbus/exported_object.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 interface_name, | 83 interface_name, |
| 84 method_name, | 84 method_name, |
| 85 method_call_callback, | 85 method_call_callback, |
| 86 on_exported_calback); | 86 on_exported_calback); |
| 87 bus_->PostTaskToDBusThread(FROM_HERE, task); | 87 bus_->PostTaskToDBusThread(FROM_HERE, task); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ExportedObject::SendSignal(Signal* signal) { | 90 void ExportedObject::SendSignal(Signal* signal) { |
| 91 // For signals, the object path should be set to the path to the sender | 91 // For signals, the object path should be set to the path to the sender |
| 92 // object, which is this exported object here. | 92 // object, which is this exported object here. |
| 93 signal->SetPath(object_path_); | 93 CHECK(signal->SetPath(object_path_)); |
| 94 | 94 |
| 95 // Increment the reference count so we can safely reference the | 95 // Increment the reference count so we can safely reference the |
| 96 // underlying signal message until the signal sending is complete. This | 96 // underlying signal message until the signal sending is complete. This |
| 97 // will be unref'ed in SendSignalInternal(). | 97 // will be unref'ed in SendSignalInternal(). |
| 98 DBusMessage* signal_message = signal->raw_message(); | 98 DBusMessage* signal_message = signal->raw_message(); |
| 99 dbus_message_ref(signal_message); | 99 dbus_message_ref(signal_message); |
| 100 | 100 |
| 101 const base::TimeTicks start_time = base::TimeTicks::Now(); | 101 const base::TimeTicks start_time = base::TimeTicks::Now(); |
| 102 bus_->PostTaskToDBusThread(FROM_HERE, | 102 bus_->PostTaskToDBusThread(FROM_HERE, |
| 103 base::Bind(&ExportedObject::SendSignalInternal, | 103 base::Bind(&ExportedObject::SendSignalInternal, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return self->HandleMessage(connection, raw_message); | 309 return self->HandleMessage(connection, raw_message); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void ExportedObject::OnUnregisteredThunk(DBusConnection *connection, | 312 void ExportedObject::OnUnregisteredThunk(DBusConnection *connection, |
| 313 void* user_data) { | 313 void* user_data) { |
| 314 ExportedObject* self = reinterpret_cast<ExportedObject*>(user_data); | 314 ExportedObject* self = reinterpret_cast<ExportedObject*>(user_data); |
| 315 return self->OnUnregistered(connection); | 315 return self->OnUnregistered(connection); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace dbus | 318 } // namespace dbus |
| OLD | NEW |