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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 const sockaddr* socket = static_cast<const sockaddr*>(bytes); | 350 const sockaddr* socket = static_cast<const sockaddr*>(bytes); |
351 net::IPEndPoint end_point; | 351 net::IPEndPoint end_point; |
352 if (end_point.FromSockAddr(socket, length)) { | 352 if (end_point.FromSockAddr(socket, length)) { |
353 service_description_.address = | 353 service_description_.address = |
354 net::HostPortPair::FromIPEndPoint(end_point); | 354 net::HostPortPair::FromIPEndPoint(end_point); |
355 break; | 355 break; |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 if (service_description_.address.host().empty()) { | 359 if (service_description_.address.host().empty()) { |
360 NOTREACHED() << service_name_; | 360 VLOG(1) << "Service IP is not resolved: " << service_name_; |
361 // Unexpected, but could be a reason for crbug.com/513505 | |
362 base::debug::DumpWithoutCrashing(); | |
363 callback_runner_->PostTask( | 361 callback_runner_->PostTask( |
364 FROM_HERE, | 362 FROM_HERE, |
365 base::Bind(callback_, STATUS_KNOWN_NONEXISTENT, ServiceDescription())); | 363 base::Bind(callback_, STATUS_KNOWN_NONEXISTENT, ServiceDescription())); |
366 return; | 364 return; |
367 } | 365 } |
368 | 366 |
369 ParseTxtRecord([service_ TXTRecordData], &service_description_.metadata); | 367 ParseTxtRecord([service_ TXTRecordData], &service_description_.metadata); |
370 | 368 |
371 // TODO(justinlin): Implement last_seen. | 369 // TODO(justinlin): Implement last_seen. |
372 service_description_.last_seen = base::Time::Now(); | 370 service_description_.last_seen = base::Time::Now(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 container_->OnResolveUpdate(local_discovery::ServiceResolver::STATUS_SUCCESS); | 480 container_->OnResolveUpdate(local_discovery::ServiceResolver::STATUS_SUCCESS); |
483 } | 481 } |
484 | 482 |
485 - (void)netService:(NSNetService *)sender | 483 - (void)netService:(NSNetService *)sender |
486 didNotResolve:(NSDictionary *)errorDict { | 484 didNotResolve:(NSDictionary *)errorDict { |
487 container_->OnResolveUpdate( | 485 container_->OnResolveUpdate( |
488 local_discovery::ServiceResolver::STATUS_REQUEST_TIMEOUT); | 486 local_discovery::ServiceResolver::STATUS_REQUEST_TIMEOUT); |
489 } | 487 } |
490 | 488 |
491 @end | 489 @end |
OLD | NEW |