| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "OmahaCommunication.h" | 5 #import "OmahaCommunication.h" |
| 6 | 6 |
| 7 #import "OmahaXMLRequest.h" | 7 #import "OmahaXMLRequest.h" |
| 8 #import "OmahaXMLParser.h" | 8 #import "OmahaXMLParser.h" |
| 9 | 9 |
| 10 // TODO: turn this string to a command-line flag | 10 // TODO: Turn the below string into a command line flag for testing. |
| 11 static NSString* const omahaURLPath = | 11 static NSString* const omahaURLPath = |
| 12 @"https://tools.google.com/service/update2"; | 12 @"https://tools.google.com/service/update2"; |
| 13 | 13 |
| 14 @interface NSURLSession () | 14 @interface NSURLSession () |
| 15 - (NSURLSessionDataTask*)dataTaskWithRequest:(NSURLRequest*)request | 15 - (NSURLSessionDataTask*)dataTaskWithRequest:(NSURLRequest*)request |
| 16 completionHandler: | 16 completionHandler: |
| 17 (void (^)(NSData* data, | 17 (void (^)(NSData* data, |
| 18 NSURLResponse* response, | 18 NSURLResponse* response, |
| 19 NSError* error))completionHandler; | 19 NSError* error))completionHandler; |
| 20 @end | 20 @end |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // talking with the Google Update server. | 59 // talking with the Google Update server. |
| 60 if (error) { | 60 if (error) { |
| 61 [delegate_ omahaCommunication:self onFailure:error]; | 61 [delegate_ omahaCommunication:self onFailure:error]; |
| 62 } else { | 62 } else { |
| 63 [delegate_ omahaCommunication:self onSuccess:completeURLs]; | 63 [delegate_ omahaCommunication:self onSuccess:completeURLs]; |
| 64 } | 64 } |
| 65 }] resume]; | 65 }] resume]; |
| 66 } | 66 } |
| 67 | 67 |
| 68 @end | 68 @end |
| OLD | NEW |