| 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 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_MAC_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_MAC_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_MAC_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class ServiceDiscoveryClientMac : public ServiceDiscoverySharedClient { | 30 class ServiceDiscoveryClientMac : public ServiceDiscoverySharedClient { |
| 31 public: | 31 public: |
| 32 ServiceDiscoveryClientMac(); | 32 ServiceDiscoveryClientMac(); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 virtual ~ServiceDiscoveryClientMac(); | 35 virtual ~ServiceDiscoveryClientMac(); |
| 36 | 36 |
| 37 // ServiceDiscoveryClient implementation. | 37 // ServiceDiscoveryClient implementation. |
| 38 virtual scoped_ptr<ServiceWatcher> CreateServiceWatcher( | 38 virtual scoped_ptr<ServiceWatcher> CreateServiceWatcher( |
| 39 const std::string& service_type, | 39 const std::string& service_type, |
| 40 const ServiceWatcher::UpdatedCallback& callback) OVERRIDE; | 40 const ServiceWatcher::UpdatedCallback& callback) override; |
| 41 virtual scoped_ptr<ServiceResolver> CreateServiceResolver( | 41 virtual scoped_ptr<ServiceResolver> CreateServiceResolver( |
| 42 const std::string& service_name, | 42 const std::string& service_name, |
| 43 const ServiceResolver::ResolveCompleteCallback& callback) OVERRIDE; | 43 const ServiceResolver::ResolveCompleteCallback& callback) override; |
| 44 virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver( | 44 virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver( |
| 45 const std::string& domain, | 45 const std::string& domain, |
| 46 net::AddressFamily address_family, | 46 net::AddressFamily address_family, |
| 47 const LocalDomainResolver::IPAddressCallback& callback) OVERRIDE; | 47 const LocalDomainResolver::IPAddressCallback& callback) override; |
| 48 | 48 |
| 49 void StartThreadIfNotStarted(); | 49 void StartThreadIfNotStarted(); |
| 50 | 50 |
| 51 scoped_ptr<base::Thread> service_discovery_thread_; | 51 scoped_ptr<base::Thread> service_discovery_thread_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(ServiceDiscoveryClientMac); | 53 DISALLOW_COPY_AND_ASSIGN(ServiceDiscoveryClientMac); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class ServiceWatcherImplMac : public ServiceWatcher { | 56 class ServiceWatcherImplMac : public ServiceWatcher { |
| 57 public: | 57 public: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 const std::string& service_type, | 95 const std::string& service_type, |
| 96 const ServiceWatcher::UpdatedCallback& callback, | 96 const ServiceWatcher::UpdatedCallback& callback, |
| 97 scoped_refptr<base::MessageLoopProxy> service_discovery_runner); | 97 scoped_refptr<base::MessageLoopProxy> service_discovery_runner); |
| 98 | 98 |
| 99 void OnServicesUpdate(ServiceWatcher::UpdateType update, | 99 void OnServicesUpdate(ServiceWatcher::UpdateType update, |
| 100 const std::string& service); | 100 const std::string& service); |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 virtual ~ServiceWatcherImplMac(); | 103 virtual ~ServiceWatcherImplMac(); |
| 104 | 104 |
| 105 virtual void Start() OVERRIDE; | 105 virtual void Start() override; |
| 106 virtual void DiscoverNewServices(bool force_update) OVERRIDE; | 106 virtual void DiscoverNewServices(bool force_update) override; |
| 107 virtual void SetActivelyRefreshServices( | 107 virtual void SetActivelyRefreshServices( |
| 108 bool actively_refresh_services) OVERRIDE; | 108 bool actively_refresh_services) override; |
| 109 virtual std::string GetServiceType() const OVERRIDE; | 109 virtual std::string GetServiceType() const override; |
| 110 | 110 |
| 111 std::string service_type_; | 111 std::string service_type_; |
| 112 ServiceWatcher::UpdatedCallback callback_; | 112 ServiceWatcher::UpdatedCallback callback_; |
| 113 bool started_; | 113 bool started_; |
| 114 | 114 |
| 115 scoped_ptr<NetServiceBrowserContainer, | 115 scoped_ptr<NetServiceBrowserContainer, |
| 116 ServiceDiscoveryThreadDeleter<NetServiceBrowserContainer> > | 116 ServiceDiscoveryThreadDeleter<NetServiceBrowserContainer> > |
| 117 container_; | 117 container_; |
| 118 base::WeakPtrFactory<ServiceWatcherImplMac> weak_factory_; | 118 base::WeakPtrFactory<ServiceWatcherImplMac> weak_factory_; |
| 119 | 119 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 const std::string& service_name, | 163 const std::string& service_name, |
| 164 const ServiceResolver::ResolveCompleteCallback& callback, | 164 const ServiceResolver::ResolveCompleteCallback& callback, |
| 165 scoped_refptr<base::MessageLoopProxy> service_discovery_runner); | 165 scoped_refptr<base::MessageLoopProxy> service_discovery_runner); |
| 166 | 166 |
| 167 // Testing methods. | 167 // Testing methods. |
| 168 NetServiceContainer* GetContainerForTesting(); | 168 NetServiceContainer* GetContainerForTesting(); |
| 169 | 169 |
| 170 private: | 170 private: |
| 171 virtual ~ServiceResolverImplMac(); | 171 virtual ~ServiceResolverImplMac(); |
| 172 | 172 |
| 173 virtual void StartResolving() OVERRIDE; | 173 virtual void StartResolving() override; |
| 174 virtual std::string GetName() const OVERRIDE; | 174 virtual std::string GetName() const override; |
| 175 | 175 |
| 176 void OnResolveComplete(RequestStatus status, | 176 void OnResolveComplete(RequestStatus status, |
| 177 const ServiceDescription& description); | 177 const ServiceDescription& description); |
| 178 | 178 |
| 179 const std::string service_name_; | 179 const std::string service_name_; |
| 180 ServiceResolver::ResolveCompleteCallback callback_; | 180 ServiceResolver::ResolveCompleteCallback callback_; |
| 181 bool has_resolved_; | 181 bool has_resolved_; |
| 182 | 182 |
| 183 scoped_ptr<NetServiceContainer, | 183 scoped_ptr<NetServiceContainer, |
| 184 ServiceDiscoveryThreadDeleter<NetServiceContainer> > container_; | 184 ServiceDiscoveryThreadDeleter<NetServiceContainer> > container_; |
| 185 base::WeakPtrFactory<ServiceResolverImplMac> weak_factory_; | 185 base::WeakPtrFactory<ServiceResolverImplMac> weak_factory_; |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(ServiceResolverImplMac); | 187 DISALLOW_COPY_AND_ASSIGN(ServiceResolverImplMac); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 } // namespace local_discovery | 190 } // namespace local_discovery |
| 191 | 191 |
| 192 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_MAC_H_ | 192 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_MAC_H_ |
| OLD | NEW |