Index: chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc |
diff --git a/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc b/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc |
index b01795490fd24402ec0a25e9bb82ad08d8234a43..d29894f8c14e478d94d8892e5a4bbec2d492a5ca 100644 |
--- a/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc |
+++ b/chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc |
@@ -6,6 +6,7 @@ |
#include "base/bind.h" |
#include "base/command_line.h" |
+#include "base/debug/dump_without_crashing.h" |
#include "base/strings/stringprintf.h" |
#include "chrome/browser/local_discovery/privet_http_impl.h" |
#include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
@@ -82,10 +83,18 @@ void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::Start( |
const ResultCallback& callback) { |
#if defined(OS_MACOSX) |
net::IPAddressNumber ip_address; |
- DCHECK(net::ParseIPLiteralToNumber(address.host(), &ip_address)); |
- // MAC already has IP there. |
- callback.Run(scoped_ptr<PrivetHTTPClient>( |
- new PrivetHTTPClientImpl(name_, address, request_context_.get()))); |
+ if (!net::ParseIPLiteralToNumber(address.host(), &ip_address)) { |
+ NOTREACHED() << address.ToString(); |
+ // Unexpected, but could be a reason for crbug.com/513505 |
+ base::debug::DumpWithoutCrashing(); |
+ return callback.Run(scoped_ptr<PrivetHTTPClient>()); |
+ } |
+ |
+ // OSX already has IP there. |
+ callback.Run(scoped_ptr<PrivetHTTPClient>(new PrivetHTTPClientImpl( |
+ name_, net::HostPortPair::FromIPEndPoint( |
+ net::IPEndPoint(ip_address, address.port())), |
+ request_context_.get()))); |
#else // OS_MACOSX |
net::AddressFamily address_family = net::ADDRESS_FAMILY_UNSPECIFIED; |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |