| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 NSHTTPURLResponse* http_response = | 197 NSHTTPURLResponse* http_response = |
| 198 base::mac::ObjCCast<NSHTTPURLResponse>(response); | 198 base::mac::ObjCCast<NSHTTPURLResponse>(response); |
| 199 if (!http_response) { | 199 if (!http_response) { |
| 200 LOG(ERROR) << "no http_response"; | 200 LOG(ERROR) << "no http_response"; |
| 201 return false; | 201 return false; |
| 202 } | 202 } |
| 203 NSInteger http_status = [http_response statusCode]; | 203 NSInteger http_status = [http_response statusCode]; |
| 204 if (http_status != 200) { | 204 if (http_status != 200) { |
| 205 LOG(ERROR) << base::StringPrintf("HTTP status %ld", | 205 LOG(ERROR) << base::StringPrintf("HTTP status %ld", |
| 206 implicit_cast<long>(http_status)); | 206 crashpad::implicit_cast<long>(http_status
)); |
| 207 return false; | 207 return false; |
| 208 } | 208 } |
| 209 | 209 |
| 210 if (response_body) { | 210 if (response_body) { |
| 211 response_body->assign(static_cast<const char*>([body bytes]), | 211 response_body->assign(static_cast<const char*>([body bytes]), |
| 212 [body length]); | 212 [body length]); |
| 213 } | 213 } |
| 214 | 214 |
| 215 return true; | 215 return true; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace | 219 } // namespace |
| 220 | 220 |
| 221 // static | 221 // static |
| 222 scoped_ptr<HTTPTransport> HTTPTransport::Create() { | 222 scoped_ptr<HTTPTransport> HTTPTransport::Create() { |
| 223 return scoped_ptr<HTTPTransport>(new HTTPTransportMac()); | 223 return scoped_ptr<HTTPTransport>(new HTTPTransportMac()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace crashpad | 226 } // namespace crashpad |
| OLD | NEW |