Index: chrome/installer/mac/app/OmahaCommunication.m |
diff --git a/chrome/installer/mac/app/OmahaCommunication.m b/chrome/installer/mac/app/OmahaCommunication.m |
index 9f1d8cb3e68392c02145f9e5819b17f2d564fad5..5315ff212bb82fe9a09485c8cf2e1a61e7051752 100644 |
--- a/chrome/installer/mac/app/OmahaCommunication.m |
+++ b/chrome/installer/mac/app/OmahaCommunication.m |
@@ -7,6 +7,7 @@ |
#import "OmahaXMLRequest.h" |
#import "OmahaXMLParser.h" |
+// TODO: turn this string to a command-line flag |
static NSString* const omahaURLPath = |
@"https://tools.google.com/service/update2"; |
@@ -35,7 +36,7 @@ static NSString* const omahaURLPath = |
} |
- (void)fetchDownloadURLs { |
- // TODO: turn this string to a command-line flag |
+ // Forming the request |
NSURL* requestURL = [NSURL URLWithString:omahaURLPath]; |
NSMutableURLRequest* request = |
[NSMutableURLRequest requestWithURL:requestURL]; |
@@ -44,6 +45,7 @@ static NSString* const omahaURLPath = |
[[requestXMLBody_ XMLString] dataUsingEncoding:NSUTF8StringEncoding]; |
request.HTTPBody = requestBody; |
request.HTTPMethod = @"POST"; |
+ // Sending the request |
[[[NSURLSession sharedSession] |
dataTaskWithRequest:request |
completionHandler:^(NSData* data, NSURLResponse* response, |
@@ -56,9 +58,10 @@ static NSString* const omahaURLPath = |
// parsing error, as the user only needs to know there was a problem |
// talking with the Google Update server. |
if (error) { |
- [delegate_ onOmahaFailureWithError:error]; |
+ [delegate_ omahaCommunication:self onOmahaFailureWithError:error]; |
} else { |
- [delegate_ onOmahaSuccessWithURLs:completeURLs]; |
+ [delegate_ omahaCommunication:self |
+ onOmahaSuccessWithURLs:completeURLs]; |
} |
}] resume]; |
} |