| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_ | 5 #ifndef CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_ |
| 6 #define CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_ | 6 #define CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <string> | 11 #include <string> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/callback.h" | 14 #include "base/callback.h" |
| 13 #include "base/cancelable_callback.h" | 15 #include "base/cancelable_callback.h" |
| 16 #include "base/macros.h" |
| 14 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 16 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
| 17 #include "chrome/common/local_discovery/service_discovery_client.h" | 20 #include "chrome/common/local_discovery/service_discovery_client.h" |
| 18 #include "net/dns/mdns_client.h" | 21 #include "net/dns/mdns_client.h" |
| 19 | 22 |
| 20 namespace local_discovery { | 23 namespace local_discovery { |
| 21 | 24 |
| 22 class ServiceDiscoveryClientImpl : public ServiceDiscoveryClient { | 25 class ServiceDiscoveryClientImpl : public ServiceDiscoveryClient { |
| 23 public: | 26 public: |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 235 |
| 233 void Start() override; | 236 void Start() override; |
| 234 | 237 |
| 235 const std::string& domain() { return domain_; } | 238 const std::string& domain() { return domain_; } |
| 236 | 239 |
| 237 private: | 240 private: |
| 238 void OnTransactionComplete( | 241 void OnTransactionComplete( |
| 239 net::MDnsTransaction::Result result, | 242 net::MDnsTransaction::Result result, |
| 240 const net::RecordParsed* record); | 243 const net::RecordParsed* record); |
| 241 | 244 |
| 242 scoped_ptr<net::MDnsTransaction> CreateTransaction(uint16 type); | 245 scoped_ptr<net::MDnsTransaction> CreateTransaction(uint16_t type); |
| 243 | 246 |
| 244 bool IsSuccess(); | 247 bool IsSuccess(); |
| 245 | 248 |
| 246 void SendResolvedAddresses(); | 249 void SendResolvedAddresses(); |
| 247 | 250 |
| 248 std::string domain_; | 251 std::string domain_; |
| 249 net::AddressFamily address_family_; | 252 net::AddressFamily address_family_; |
| 250 IPAddressCallback callback_; | 253 IPAddressCallback callback_; |
| 251 | 254 |
| 252 scoped_ptr<net::MDnsTransaction> transaction_a_; | 255 scoped_ptr<net::MDnsTransaction> transaction_a_; |
| 253 scoped_ptr<net::MDnsTransaction> transaction_aaaa_; | 256 scoped_ptr<net::MDnsTransaction> transaction_aaaa_; |
| 254 | 257 |
| 255 int transactions_finished_; | 258 int transactions_finished_; |
| 256 | 259 |
| 257 net::MDnsClient* mdns_client_; | 260 net::MDnsClient* mdns_client_; |
| 258 | 261 |
| 259 net::IPAddressNumber address_ipv4_; | 262 net::IPAddressNumber address_ipv4_; |
| 260 net::IPAddressNumber address_ipv6_; | 263 net::IPAddressNumber address_ipv6_; |
| 261 | 264 |
| 262 base::CancelableCallback<void()> timeout_callback_; | 265 base::CancelableCallback<void()> timeout_callback_; |
| 263 | 266 |
| 264 DISALLOW_COPY_AND_ASSIGN(LocalDomainResolverImpl); | 267 DISALLOW_COPY_AND_ASSIGN(LocalDomainResolverImpl); |
| 265 }; | 268 }; |
| 266 | 269 |
| 267 | 270 |
| 268 } // namespace local_discovery | 271 } // namespace local_discovery |
| 269 | 272 |
| 270 #endif // CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_ | 273 #endif // CHROME_COMMON_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_ |
| OLD | NEW |