Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8495)

Unified Diff: chrome/installer/mac/app/NetworkCommunication.m

Issue 2148293005: Migrate mac installer to delegate-driven model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last patch before CQ Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/mac/app/NetworkCommunication.h ('k') | chrome/installer/mac/app/OmahaCommunication.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mac/app/NetworkCommunication.m
diff --git a/chrome/installer/mac/app/NetworkCommunication.m b/chrome/installer/mac/app/NetworkCommunication.m
index d19566a1e0188cd7a0d61bbbd0f09abc39275e02..4347a17758e0f165e593f44fc79ad59645e5822b 100644
--- a/chrome/installer/mac/app/NetworkCommunication.m
+++ b/chrome/installer/mac/app/NetworkCommunication.m
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import <Foundation/Foundation.h>
-
#import "NetworkCommunication.h"
@implementation NetworkCommunication : NSObject
@@ -11,7 +9,6 @@
@synthesize session = session_;
@synthesize request = request_;
@synthesize dataResponseHandler = dataResponseHandler_;
-@synthesize downloadResponseHandler = downloadResponseHandler_;
- (id)init {
return [self initWithDelegate:nil];
@@ -41,24 +38,21 @@
return request_;
}
-- (void)sendDataRequestWithCompletionHandler:
- (DataTaskCompletionHandler)completionHandler {
- dataResponseHandler_ = completionHandler;
- NSURLSessionDataTask* dataTask =
- [session_ dataTaskWithRequest:request_
- completionHandler:dataResponseHandler_];
+- (void)sendDataRequest {
+ NSURLSessionDataTask* dataTask;
+ if (dataResponseHandler_) {
+ dataTask = [session_ dataTaskWithRequest:request_
+ completionHandler:dataResponseHandler_];
+ } else {
+ dataTask = [session_ dataTaskWithRequest:request_];
+ }
[dataTask resume];
}
- (void)sendDownloadRequest {
- NSURLSessionDownloadTask* downloadTask;
- if (downloadResponseHandler_) {
- downloadTask = [session_ downloadTaskWithRequest:request_
- completionHandler:downloadResponseHandler_];
- } else {
- downloadTask = [session_ downloadTaskWithRequest:request_];
- }
+ NSURLSessionDownloadTask* downloadTask =
+ [session_ downloadTaskWithRequest:request_];
[downloadTask resume];
}
« no previous file with comments | « chrome/installer/mac/app/NetworkCommunication.h ('k') | chrome/installer/mac/app/OmahaCommunication.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698