Chromium Code Reviews| Index: chrome/installer/mac/app/main.m |
| diff --git a/chrome/installer/mac/app/main.m b/chrome/installer/mac/app/main.m |
| index 3f718136da58412eba1d290a526b7b9d7943aa83..b877107df41272a1d9db6cc02c55560dd547d977 100644 |
| --- a/chrome/installer/mac/app/main.m |
| +++ b/chrome/installer/mac/app/main.m |
| @@ -9,23 +9,27 @@ |
| #import "OmahaXMLRequest.h" |
| #import "SystemInfo.h" |
| -// TODO: add a class that takes care of what main is doing now |
| -void talkToOmahaThenExecuteBlock(OmahaRequestCompletionHandler block) { |
| +void talkToOmaha() { |
| NSXMLDocument* requestBody = [OmahaXMLRequest createXMLRequestBody]; |
| OmahaCommunication* messenger = |
| [[OmahaCommunication alloc] initWithBody:requestBody]; |
| - [messenger sendRequestWithBlock:block]; |
| -} |
| - |
| -int main() { |
| - talkToOmahaThenExecuteBlock(^(NSData* data, NSError* error) { |
| + [messenger sendRequestWithBlock:^(NSData* data, NSError* error) { |
| if (error) { |
| NSLog(@"%@", [error localizedDescription]); |
| return; |
| } |
| - Downloader* download = [[Downloader alloc] init]; |
| - [download downloadChromeImageToDownloadsDirectory:data]; |
| - }); |
| + |
| + downloadChrome(); |
|
Sidney San Martín
2016/07/18 18:28:52
It's confusing that talkToOmaha() also starts the
|
| + }]; |
| +} |
| + |
| +void downloadChrome() { |
| + Downloader* download = [[Downloader alloc] init]; |
| + [download downloadChromeImageToDownloadsDirectory:data]; |
| +} |
| + |
| +int main() { |
| + talkToOmaha(); |
| // [[NSRunLoop mainRunLoop] run]; |
| [[NSRunLoop mainRunLoop] |