OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_BASE_ASYNC_DNS_LOOKUP_H_ |
| 6 #define CHROME_BROWSER_SYNC_NOTIFIER_BASE_ASYNC_DNS_LOOKUP_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/scoped_ptr.h" |
| 11 #include "talk/base/signalthread.h" |
| 12 |
| 13 namespace talk_base { |
| 14 class SocketAddress; |
| 15 class Task; |
| 16 } |
| 17 |
| 18 namespace notifier { |
| 19 |
| 20 class AsyncDNSLookup : public talk_base::SignalThread { |
| 21 public: |
| 22 explicit AsyncDNSLookup(const talk_base::SocketAddress& server); |
| 23 virtual ~AsyncDNSLookup(); |
| 24 |
| 25 const int error() const { |
| 26 return error_; |
| 27 } |
| 28 |
| 29 const std::vector<uint32>& ip_list() const { |
| 30 return ip_list_; |
| 31 } |
| 32 |
| 33 protected: |
| 34 // SignalThread Interface |
| 35 virtual void DoWork(); |
| 36 virtual void OnMessage(talk_base::Message* message); |
| 37 |
| 38 private: |
| 39 void OnTimeout(); |
| 40 |
| 41 scoped_ptr<talk_base::SocketAddress> server_; |
| 42 talk_base::CriticalSection cs_; |
| 43 int error_; |
| 44 std::vector<uint32> ip_list_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(AsyncDNSLookup); |
| 47 }; |
| 48 } // namespace notifier |
| 49 #endif // CHROME_BROWSER_SYNC_NOTIFIER_BASE_ASYNC_DNS_LOOKUP_H_ |
OLD | NEW |