| 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 #ifndef NET_DNS_NOTIFY_WATCHER_MAC_H_ | 5 #ifndef NET_DNS_NOTIFY_WATCHER_MAC_H_ |
| 6 #define NET_DNS_NOTIFY_WATCHER_MAC_H_ | 6 #define NET_DNS_NOTIFY_WATCHER_MAC_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 10 | 11 |
| 11 namespace net { | 12 namespace net { |
| 12 | 13 |
| 13 // Watches for notifications from Libnotify and delivers them to a Callback. | 14 // Watches for notifications from Libnotify and delivers them to a Callback. |
| 14 // After failure the watch is cancelled and will have to be restarted. | 15 // After failure the watch is cancelled and will have to be restarted. |
| 15 class NotifyWatcherMac : public base::MessageLoopForIO::Watcher { | 16 class NotifyWatcherMac : public base::MessageLoopForIO::Watcher { |
| 16 public: | 17 public: |
| 17 // Called on received notification with true on success and false on error. | 18 // Called on received notification with true on success and false on error. |
| 18 typedef base::Callback<void(bool succeeded)> CallbackType; | 19 typedef base::Callback<void(bool succeeded)> CallbackType; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 int notify_token_; | 39 int notify_token_; |
| 39 CallbackType callback_; | 40 CallbackType callback_; |
| 40 base::MessageLoopForIO::FileDescriptorWatcher watcher_; | 41 base::MessageLoopForIO::FileDescriptorWatcher watcher_; |
| 41 | 42 |
| 42 DISALLOW_COPY_AND_ASSIGN(NotifyWatcherMac); | 43 DISALLOW_COPY_AND_ASSIGN(NotifyWatcherMac); |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace net | 46 } // namespace net |
| 46 | 47 |
| 47 #endif // NET_DNS_NOTIFY_WATCHER_MAC_H_ | 48 #endif // NET_DNS_NOTIFY_WATCHER_MAC_H_ |
| OLD | NEW |