Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1707)

Unified Diff: chrome/browser/local_discovery/privet_http_asynchronous_factory_impl.cc

Issue 1436373002: Fixed OSX crash in net::URLFetcherCore::URLFetcherCore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@context5
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_url_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698