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/bus.h" | 5 #include "dbus/bus.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 async_operations_set_up_(false), | 194 async_operations_set_up_(false), |
195 shutdown_completed_(false), | 195 shutdown_completed_(false), |
196 num_pending_watches_(0), | 196 num_pending_watches_(0), |
197 num_pending_timeouts_(0), | 197 num_pending_timeouts_(0), |
198 address_(options.address) { | 198 address_(options.address) { |
199 // This is safe to call multiple times. | 199 // This is safe to call multiple times. |
200 dbus_threads_init_default(); | 200 dbus_threads_init_default(); |
201 // The origin message loop is unnecessary if the client uses synchronous | 201 // The origin message loop is unnecessary if the client uses synchronous |
202 // functions only. | 202 // functions only. |
203 if (base::MessageLoop::current()) | 203 if (base::MessageLoop::current()) |
204 origin_task_runner_ = base::MessageLoop::current()->message_loop_proxy(); | 204 origin_task_runner_ = base::MessageLoop::current()->task_runner(); |
205 } | 205 } |
206 | 206 |
207 Bus::~Bus() { | 207 Bus::~Bus() { |
208 DCHECK(!connection_); | 208 DCHECK(!connection_); |
209 DCHECK(owned_service_names_.empty()); | 209 DCHECK(owned_service_names_.empty()); |
210 DCHECK(match_rules_added_.empty()); | 210 DCHECK(match_rules_added_.empty()); |
211 DCHECK(filter_functions_added_.empty()); | 211 DCHECK(filter_functions_added_.empty()); |
212 DCHECK(registered_object_paths_.empty()); | 212 DCHECK(registered_object_paths_.empty()); |
213 DCHECK_EQ(0, num_pending_watches_); | 213 DCHECK_EQ(0, num_pending_watches_); |
214 // TODO(satorux): This check fails occasionally in browser_tests for tests | 214 // TODO(satorux): This check fails occasionally in browser_tests for tests |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 kNameOwnerChangedSignal)) { | 1206 kNameOwnerChangedSignal)) { |
1207 Bus* self = static_cast<Bus*>(data); | 1207 Bus* self = static_cast<Bus*>(data); |
1208 self->OnServiceOwnerChanged(message); | 1208 self->OnServiceOwnerChanged(message); |
1209 } | 1209 } |
1210 // Always return unhandled to let others, e.g. ObjectProxies, handle the same | 1210 // Always return unhandled to let others, e.g. ObjectProxies, handle the same |
1211 // signal. | 1211 // signal. |
1212 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 1212 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
1213 } | 1213 } |
1214 | 1214 |
1215 } // namespace dbus | 1215 } // namespace dbus |
OLD | NEW |