OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_manager.h" | 5 #include "dbus/object_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 // Handle the message only if it is a signal. | 257 // Handle the message only if it is a signal. |
258 // Note that the match rule in SetupMatchRuleAndFilter() is configured to | 258 // Note that the match rule in SetupMatchRuleAndFilter() is configured to |
259 // only accept signals, but we check here just in case. | 259 // only accept signals, but we check here just in case. |
260 if (dbus_message_get_type(raw_message) != DBUS_MESSAGE_TYPE_SIGNAL) | 260 if (dbus_message_get_type(raw_message) != DBUS_MESSAGE_TYPE_SIGNAL) |
261 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 261 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
262 | 262 |
263 // raw_message will be unrefed on exit of the function. Increment the | 263 // raw_message will be unrefed on exit of the function. Increment the |
264 // reference so we can use it in Signal. | 264 // reference so we can use it in Signal. |
265 dbus_message_ref(raw_message); | 265 dbus_message_ref(raw_message); |
266 scoped_ptr<Signal> signal( | 266 std::unique_ptr<Signal> signal(Signal::FromRawMessage(raw_message)); |
267 Signal::FromRawMessage(raw_message)); | |
268 | 267 |
269 const std::string interface = signal->GetInterface(); | 268 const std::string interface = signal->GetInterface(); |
270 const std::string member = signal->GetMember(); | 269 const std::string member = signal->GetMember(); |
271 | 270 |
272 statistics::AddReceivedSignal(service_name_, interface, member); | 271 statistics::AddReceivedSignal(service_name_, interface, member); |
273 | 272 |
274 // Handle the signal only if it is PropertiesChanged. | 273 // Handle the signal only if it is PropertiesChanged. |
275 // Note that the match rule in SetupMatchRuleAndFilter() is configured to | 274 // Note that the match rule in SetupMatchRuleAndFilter() is configured to |
276 // only accept PropertiesChanged signals, but we check here just in case. | 275 // only accept PropertiesChanged signals, but we check here just in case. |
277 const std::string absolute_signal_name = | 276 const std::string absolute_signal_name = |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 RemoveInterface(object_path, *iiter); | 526 RemoveInterface(object_path, *iiter); |
528 } | 527 } |
529 | 528 |
530 } | 529 } |
531 | 530 |
532 if (!new_owner.empty()) | 531 if (!new_owner.empty()) |
533 GetManagedObjects(); | 532 GetManagedObjects(); |
534 } | 533 } |
535 | 534 |
536 } // namespace dbus | 535 } // namespace dbus |
OLD | NEW |