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 |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 16 #include "net/base/ip_address_number.h" |
16 | 17 |
17 using local_discovery::ServiceWatcherImplMac; | 18 using local_discovery::ServiceWatcherImplMac; |
18 using local_discovery::ServiceResolverImplMac; | 19 using local_discovery::ServiceResolverImplMac; |
19 | 20 |
20 @interface NetServiceBrowserDelegate | 21 @interface NetServiceBrowserDelegate |
21 : NSObject<NSNetServiceBrowserDelegate, NSNetServiceDelegate> { | 22 : NSObject<NSNetServiceBrowserDelegate, NSNetServiceDelegate> { |
22 @private | 23 @private |
23 ServiceWatcherImplMac::NetServiceBrowserContainer* container_; // weak. | 24 ServiceWatcherImplMac::NetServiceBrowserContainer* container_; // weak. |
24 base::scoped_nsobject<NSMutableArray> services_; | 25 base::scoped_nsobject<NSMutableArray> services_; |
25 } | 26 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 container_->OnResolveUpdate(local_discovery::ServiceResolver::STATUS_SUCCESS); | 471 container_->OnResolveUpdate(local_discovery::ServiceResolver::STATUS_SUCCESS); |
471 } | 472 } |
472 | 473 |
473 - (void)netService:(NSNetService *)sender | 474 - (void)netService:(NSNetService *)sender |
474 didNotResolve:(NSDictionary *)errorDict { | 475 didNotResolve:(NSDictionary *)errorDict { |
475 container_->OnResolveUpdate( | 476 container_->OnResolveUpdate( |
476 local_discovery::ServiceResolver::STATUS_REQUEST_TIMEOUT); | 477 local_discovery::ServiceResolver::STATUS_REQUEST_TIMEOUT); |
477 } | 478 } |
478 | 479 |
479 @end | 480 @end |
OLD | NEW |