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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 MethodTable::const_iterator iter = method_table_.find(absolute_signal_name); | 496 MethodTable::const_iterator iter = method_table_.find(absolute_signal_name); |
497 if (iter == method_table_.end()) { | 497 if (iter == method_table_.end()) { |
498 // Don't know about the signal. | 498 // Don't know about the signal. |
499 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 499 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
500 } | 500 } |
501 VLOG(1) << "Signal received: " << signal->ToString(); | 501 VLOG(1) << "Signal received: " << signal->ToString(); |
502 | 502 |
503 std::string sender = signal->GetSender(); | 503 std::string sender = signal->GetSender(); |
504 if (service_name_owner_ != sender) { | 504 if (service_name_owner_ != sender) { |
505 LOG(ERROR) << "Rejecting a message from a wrong sender."; | 505 LOG(ERROR) << "Rejecting a message from a wrong sender."; |
506 UMA_HISTOGRAM_COUNTS("DBus.RejectedSignalCount", 1); | |
507 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 506 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
508 } | 507 } |
509 | 508 |
510 const base::TimeTicks start_time = base::TimeTicks::Now(); | 509 const base::TimeTicks start_time = base::TimeTicks::Now(); |
511 if (bus_->HasDBusThread()) { | 510 if (bus_->HasDBusThread()) { |
512 // Post a task to run the method in the origin thread. | 511 // Post a task to run the method in the origin thread. |
513 // Transfer the ownership of |signal| to RunMethod(). | 512 // Transfer the ownership of |signal| to RunMethod(). |
514 // |released_signal| will be deleted in RunMethod(). | 513 // |released_signal| will be deleted in RunMethod(). |
515 Signal* released_signal = signal.release(); | 514 Signal* released_signal = signal.release(); |
516 bus_->GetOriginTaskRunner()->PostTask(FROM_HERE, | 515 bus_->GetOriginTaskRunner()->PostTask(FROM_HERE, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 bool service_is_available) { | 707 bool service_is_available) { |
709 bus_->AssertOnOriginThread(); | 708 bus_->AssertOnOriginThread(); |
710 | 709 |
711 std::vector<WaitForServiceToBeAvailableCallback> callbacks; | 710 std::vector<WaitForServiceToBeAvailableCallback> callbacks; |
712 callbacks.swap(wait_for_service_to_be_available_callbacks_); | 711 callbacks.swap(wait_for_service_to_be_available_callbacks_); |
713 for (size_t i = 0; i < callbacks.size(); ++i) | 712 for (size_t i = 0; i < callbacks.size(); ++i) |
714 callbacks[i].Run(service_is_available); | 713 callbacks[i].Run(service_is_available); |
715 } | 714 } |
716 | 715 |
717 } // namespace dbus | 716 } // namespace dbus |
OLD | NEW |