| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 forHTTPHeaderField:base::SysUTF8ToNSString(pair.first)]; | 174 forHTTPHeaderField:base::SysUTF8ToNSString(pair.first)]; |
| 175 } | 175 } |
| 176 | 176 |
| 177 HTTPBodyStreamCFReadStream body_stream_cf(body_stream()); | 177 HTTPBodyStreamCFReadStream body_stream_cf(body_stream()); |
| 178 base::scoped_nsobject<NSInputStream> input_stream( | 178 base::scoped_nsobject<NSInputStream> input_stream( |
| 179 body_stream_cf.CreateInputStream()); | 179 body_stream_cf.CreateInputStream()); |
| 180 [request setHTTPBodyStream:input_stream.get()]; | 180 [request setHTTPBodyStream:input_stream.get()]; |
| 181 | 181 |
| 182 NSURLResponse* response = nil; | 182 NSURLResponse* response = nil; |
| 183 NSError* error = nil; | 183 NSError* error = nil; |
| 184 #pragma clang diagnostic push |
| 185 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 186 // Deprecated in OS X 10.11. The suggested replacement, NSURLSession, is |
| 187 // only available on 10.9 and later, and this needs to run on earlier |
| 188 // releases. |
| 184 NSData* body = [NSURLConnection sendSynchronousRequest:request | 189 NSData* body = [NSURLConnection sendSynchronousRequest:request |
| 185 returningResponse:&response | 190 returningResponse:&response |
| 186 error:&error]; | 191 error:&error]; |
| 192 #pragma clang diagnostic pop |
| 187 | 193 |
| 188 if (error) { | 194 if (error) { |
| 189 LOG(ERROR) << [[error localizedDescription] UTF8String] << " (" | 195 LOG(ERROR) << [[error localizedDescription] UTF8String] << " (" |
| 190 << [[error domain] UTF8String] << " " << [error code] << ")"; | 196 << [[error domain] UTF8String] << " " << [error code] << ")"; |
| 191 return false; | 197 return false; |
| 192 } | 198 } |
| 193 if (!response) { | 199 if (!response) { |
| 194 LOG(ERROR) << "no response"; | 200 LOG(ERROR) << "no response"; |
| 195 return false; | 201 return false; |
| 196 } | 202 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 217 } | 223 } |
| 218 | 224 |
| 219 } // namespace | 225 } // namespace |
| 220 | 226 |
| 221 // static | 227 // static |
| 222 scoped_ptr<HTTPTransport> HTTPTransport::Create() { | 228 scoped_ptr<HTTPTransport> HTTPTransport::Create() { |
| 223 return scoped_ptr<HTTPTransport>(new HTTPTransportMac()); | 229 return scoped_ptr<HTTPTransport>(new HTTPTransportMac()); |
| 224 } | 230 } |
| 225 | 231 |
| 226 } // namespace crashpad | 232 } // namespace crashpad |
| OLD | NEW |