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_client_mac.h" | 5 #include "chrome/browser/local_discovery/service_discovery_client_mac.h" |
6 | 6 |
7 #import <arpa/inet.h> | 7 #import <arpa/inet.h> |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #import <net/if_dl.h> | 9 #import <net/if_dl.h> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 ServiceDiscoveryClientMac::ServiceDiscoveryClientMac() {} | 119 ServiceDiscoveryClientMac::ServiceDiscoveryClientMac() {} |
120 ServiceDiscoveryClientMac::~ServiceDiscoveryClientMac() {} | 120 ServiceDiscoveryClientMac::~ServiceDiscoveryClientMac() {} |
121 | 121 |
122 scoped_ptr<ServiceWatcher> ServiceDiscoveryClientMac::CreateServiceWatcher( | 122 scoped_ptr<ServiceWatcher> ServiceDiscoveryClientMac::CreateServiceWatcher( |
123 const std::string& service_type, | 123 const std::string& service_type, |
124 const ServiceWatcher::UpdatedCallback& callback) { | 124 const ServiceWatcher::UpdatedCallback& callback) { |
125 StartThreadIfNotStarted(); | 125 StartThreadIfNotStarted(); |
126 VLOG(1) << "CreateServiceWatcher: " << service_type; | 126 VLOG(1) << "CreateServiceWatcher: " << service_type; |
127 return scoped_ptr<ServiceWatcher>(new ServiceWatcherImplMac( | 127 return scoped_ptr<ServiceWatcher>(new ServiceWatcherImplMac( |
128 service_type, callback, service_discovery_thread_->message_loop_proxy())); | 128 service_type, callback, service_discovery_thread_->task_runner())); |
129 } | 129 } |
130 | 130 |
131 scoped_ptr<ServiceResolver> ServiceDiscoveryClientMac::CreateServiceResolver( | 131 scoped_ptr<ServiceResolver> ServiceDiscoveryClientMac::CreateServiceResolver( |
132 const std::string& service_name, | 132 const std::string& service_name, |
133 const ServiceResolver::ResolveCompleteCallback& callback) { | 133 const ServiceResolver::ResolveCompleteCallback& callback) { |
134 StartThreadIfNotStarted(); | 134 StartThreadIfNotStarted(); |
135 VLOG(1) << "CreateServiceResolver: " << service_name; | 135 VLOG(1) << "CreateServiceResolver: " << service_name; |
136 return scoped_ptr<ServiceResolver>(new ServiceResolverImplMac( | 136 return scoped_ptr<ServiceResolver>(new ServiceResolverImplMac( |
137 service_name, callback, service_discovery_thread_->message_loop_proxy())); | 137 service_name, callback, service_discovery_thread_->task_runner())); |
138 } | 138 } |
139 | 139 |
140 scoped_ptr<LocalDomainResolver> | 140 scoped_ptr<LocalDomainResolver> |
141 ServiceDiscoveryClientMac::CreateLocalDomainResolver( | 141 ServiceDiscoveryClientMac::CreateLocalDomainResolver( |
142 const std::string& domain, | 142 const std::string& domain, |
143 net::AddressFamily address_family, | 143 net::AddressFamily address_family, |
144 const LocalDomainResolver::IPAddressCallback& callback) { | 144 const LocalDomainResolver::IPAddressCallback& callback) { |
145 NOTIMPLEMENTED(); // TODO(noamsml): Implement. | 145 NOTIMPLEMENTED(); // TODO(noamsml): Implement. |
146 VLOG(1) << "CreateLocalDomainResolver: " << domain; | 146 VLOG(1) << "CreateLocalDomainResolver: " << domain; |
147 return scoped_ptr<LocalDomainResolver>(); | 147 return scoped_ptr<LocalDomainResolver>(); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 container_->OnResolveUpdate(local_discovery::ServiceResolver::STATUS_SUCCESS); | 471 container_->OnResolveUpdate(local_discovery::ServiceResolver::STATUS_SUCCESS); |
472 } | 472 } |
473 | 473 |
474 - (void)netService:(NSNetService *)sender | 474 - (void)netService:(NSNetService *)sender |
475 didNotResolve:(NSDictionary *)errorDict { | 475 didNotResolve:(NSDictionary *)errorDict { |
476 container_->OnResolveUpdate( | 476 container_->OnResolveUpdate( |
477 local_discovery::ServiceResolver::STATUS_REQUEST_TIMEOUT); | 477 local_discovery::ServiceResolver::STATUS_REQUEST_TIMEOUT); |
478 } | 478 } |
479 | 479 |
480 @end | 480 @end |
OLD | NEW |