| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_RENDERER_P2P_HOST_ADDRESS_REQUEST_H_ | 5 #ifndef CONTENT_RENDERER_P2P_HOST_ADDRESS_REQUEST_H_ |
| 6 #define CONTENT_RENDERER_P2P_HOST_ADDRESS_REQUEST_H_ | 6 #define CONTENT_RENDERER_P2P_HOST_ADDRESS_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class MessageLoopProxy; | 15 class MessageLoopProxy; |
| 16 } // namespace base | 16 } // namespace base |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class P2PSocketDispatcher; | 20 class P2PSocketDispatcher; |
| 21 | 21 |
| 22 // P2PHostAddressRequest performs DNS hostname resolution. It's used |
| 23 // to resolve addresses of STUN and relay servers. |
| 24 // |
| 25 // TODO(sergeyu): Name of this class may be confusing. Rename it to |
| 26 // something else, e.g. P2PHostnameResolver. |
| 22 class P2PHostAddressRequest : | 27 class P2PHostAddressRequest : |
| 23 public base::RefCountedThreadSafe<P2PHostAddressRequest> { | 28 public base::RefCountedThreadSafe<P2PHostAddressRequest> { |
| 24 public: | 29 public: |
| 25 typedef base::Callback<void(const net::IPAddressNumber&)> DoneCallback; | 30 typedef base::Callback<void(const net::IPAddressNumber&)> DoneCallback; |
| 26 | 31 |
| 27 P2PHostAddressRequest(P2PSocketDispatcher* dispatcher); | 32 P2PHostAddressRequest(P2PSocketDispatcher* dispatcher); |
| 28 | 33 |
| 29 // Sends host address request. | 34 // Sends host address request. |
| 30 void Request(const std::string& host_name, | 35 void Request(const std::string& host_name, |
| 31 const DoneCallback& done_callback); | 36 const DoneCallback& done_callback); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Accessed on the IPC thread only. | 68 // Accessed on the IPC thread only. |
| 64 int32 request_id_; | 69 int32 request_id_; |
| 65 bool registered_; | 70 bool registered_; |
| 66 | 71 |
| 67 DISALLOW_COPY_AND_ASSIGN(P2PHostAddressRequest); | 72 DISALLOW_COPY_AND_ASSIGN(P2PHostAddressRequest); |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 } // namespace content | 75 } // namespace content |
| 71 | 76 |
| 72 #endif // CONTENT_RENDERER_P2P_HOST_ADDRESS_REQUEST_H_ | 77 #endif // CONTENT_RENDERER_P2P_HOST_ADDRESS_REQUEST_H_ |
| OLD | NEW |