From 9fdb70738b351281fade7156cdac6db7bcbdabbc Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 7 Oct 2015 16:16:53 -0400 Subject: [PATCH] mac: 10.11 SDK compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This doesn’t really provide compatibility, it just ignores the deprecation warning for +[NSURLConnection sendSynchronousRequest:returningResponse:error:]. The suggested replacement, NSURLSession, was new in 10.9, and this code needs to run on 10.6, so it’s not usable here, at least not without a runtime check. BUG=crashpad:65 R=rsesek@chromium.org Review URL: https://codereview.chromium.org/1395673002 . --- util/net/http_transport_mac.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/net/http_transport_mac.mm b/util/net/http_transport_mac.mm index af523c69..971a9986 100644 --- a/util/net/http_transport_mac.mm +++ b/util/net/http_transport_mac.mm @@ -181,9 +181,15 @@ bool HTTPTransportMac::ExecuteSynchronously(std::string* response_body) { NSURLResponse* response = nil; NSError* error = nil; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // Deprecated in OS X 10.11. The suggested replacement, NSURLSession, is + // only available on 10.9 and later, and this needs to run on earlier + // releases. NSData* body = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; +#pragma clang diagnostic pop if (error) { LOG(ERROR) << [[error localizedDescription] UTF8String] << " ("