| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 CHECK(success) << "Unable to allocate memory"; | 77 CHECK(success) << "Unable to allocate memory"; |
| 78 } | 78 } |
| 79 | 79 |
| 80 // Stops watching the underlying file descriptor. | 80 // Stops watching the underlying file descriptor. |
| 81 void StopWatching() { | 81 void StopWatching() { |
| 82 file_descriptor_watcher_.StopWatchingFileDescriptor(); | 82 file_descriptor_watcher_.StopWatchingFileDescriptor(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 // Implement MessagePumpLibevent::Watcher. | 86 // Implement MessagePumpLibevent::Watcher. |
| 87 virtual void OnFileCanReadWithoutBlocking(int file_descriptor) OVERRIDE { | 87 virtual void OnFileCanReadWithoutBlocking(int file_descriptor) override { |
| 88 const bool success = dbus_watch_handle(raw_watch_, DBUS_WATCH_READABLE); | 88 const bool success = dbus_watch_handle(raw_watch_, DBUS_WATCH_READABLE); |
| 89 CHECK(success) << "Unable to allocate memory"; | 89 CHECK(success) << "Unable to allocate memory"; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Implement MessagePumpLibevent::Watcher. | 92 // Implement MessagePumpLibevent::Watcher. |
| 93 virtual void OnFileCanWriteWithoutBlocking(int file_descriptor) OVERRIDE { | 93 virtual void OnFileCanWriteWithoutBlocking(int file_descriptor) override { |
| 94 const bool success = dbus_watch_handle(raw_watch_, DBUS_WATCH_WRITABLE); | 94 const bool success = dbus_watch_handle(raw_watch_, DBUS_WATCH_WRITABLE); |
| 95 CHECK(success) << "Unable to allocate memory"; | 95 CHECK(success) << "Unable to allocate memory"; |
| 96 } | 96 } |
| 97 | 97 |
| 98 DBusWatch* raw_watch_; | 98 DBusWatch* raw_watch_; |
| 99 base::MessagePumpLibevent::FileDescriptorWatcher file_descriptor_watcher_; | 99 base::MessagePumpLibevent::FileDescriptorWatcher file_descriptor_watcher_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 // The class is used for monitoring the timeout used for D-Bus method | 102 // The class is used for monitoring the timeout used for D-Bus method |
| 103 // calls. | 103 // calls. |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 kNameOwnerChangedSignal)) { | 1232 kNameOwnerChangedSignal)) { |
| 1233 Bus* self = static_cast<Bus*>(data); | 1233 Bus* self = static_cast<Bus*>(data); |
| 1234 self->OnServiceOwnerChanged(message); | 1234 self->OnServiceOwnerChanged(message); |
| 1235 } | 1235 } |
| 1236 // Always return unhandled to let others, e.g. ObjectProxies, handle the same | 1236 // Always return unhandled to let others, e.g. ObjectProxies, handle the same |
| 1237 // signal. | 1237 // signal. |
| 1238 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 1238 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 } // namespace dbus | 1241 } // namespace dbus |
| OLD | NEW |