| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/local_discovery/service_discovery_host_client.h" | 5 #include "chrome/browser/local_discovery/service_discovery_host_client.h" |
| 6 | 6 |
| 7 #include "chrome/common/local_discovery/local_discovery_messages.h" | 7 #include "chrome/common/local_discovery/local_discovery_messages.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/utility_process_host.h" | 9 #include "content/public/browser/utility_process_host.h" |
| 10 #include "net/dns/mdns_client.h" | 10 #include "net/dns/mdns_client.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 host_->Send(new LocalDiscoveryMsg_StartWatcher(id_, service_type_)); | 75 host_->Send(new LocalDiscoveryMsg_StartWatcher(id_, service_type_)); |
| 76 started_ = true; | 76 started_ = true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 virtual void DiscoverNewServices(bool force_update) OVERRIDE { | 79 virtual void DiscoverNewServices(bool force_update) OVERRIDE { |
| 80 DVLOG(1) << "ServiceWatcher::DiscoverNewServices with id " << id_; | 80 DVLOG(1) << "ServiceWatcher::DiscoverNewServices with id " << id_; |
| 81 DCHECK(started_); | 81 DCHECK(started_); |
| 82 host_->Send(new LocalDiscoveryMsg_DiscoverServices(id_, force_update)); | 82 host_->Send(new LocalDiscoveryMsg_DiscoverServices(id_, force_update)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual void SetActivelyRefreshServices( |
| 86 bool actively_refresh_services) OVERRIDE { |
| 87 DVLOG(1) << "ServiceWatcher::SetActivelyRefreshServices with id " << id_; |
| 88 DCHECK(started_); |
| 89 host_->Send(new LocalDiscoveryMsg_SetActivelyRefreshServices( |
| 90 id_, actively_refresh_services)); |
| 91 } |
| 92 |
| 85 virtual std::string GetServiceType() const OVERRIDE { | 93 virtual std::string GetServiceType() const OVERRIDE { |
| 86 return service_type_; | 94 return service_type_; |
| 87 } | 95 } |
| 88 | 96 |
| 89 private: | 97 private: |
| 90 scoped_refptr<ServiceDiscoveryHostClient> host_; | 98 scoped_refptr<ServiceDiscoveryHostClient> host_; |
| 91 const std::string service_type_; | 99 const std::string service_type_; |
| 92 const uint64 id_; | 100 const uint64 id_; |
| 93 bool started_; | 101 bool started_; |
| 94 }; | 102 }; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 bool success, | 446 bool success, |
| 439 const net::IPAddressNumber& ip_address_ipv4, | 447 const net::IPAddressNumber& ip_address_ipv4, |
| 440 const net::IPAddressNumber& ip_address_ipv6) { | 448 const net::IPAddressNumber& ip_address_ipv6) { |
| 441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 449 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 442 DomainResolverCallbacks::iterator it = domain_resolver_callbacks_.find(id); | 450 DomainResolverCallbacks::iterator it = domain_resolver_callbacks_.find(id); |
| 443 if (it != domain_resolver_callbacks_.end() && !it->second.is_null()) | 451 if (it != domain_resolver_callbacks_.end() && !it->second.is_null()) |
| 444 it->second.Run(success, ip_address_ipv4, ip_address_ipv6); | 452 it->second.Run(success, ip_address_ipv4, ip_address_ipv6); |
| 445 } | 453 } |
| 446 | 454 |
| 447 } // namespace local_discovery | 455 } // namespace local_discovery |
| OLD | NEW |