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

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: Addressed all comments except NetworkCommunication 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
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..834931831b656b378d4806da2fdcbb3991cd6b92 100644
--- a/chrome/installer/mac/app/NetworkCommunication.m
+++ b/chrome/installer/mac/app/NetworkCommunication.m
@@ -2,16 +2,12 @@
// 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
@synthesize session = session_;
@synthesize request = request_;
-@synthesize dataResponseHandler = dataResponseHandler_;
-@synthesize downloadResponseHandler = downloadResponseHandler_;
- (id)init {
return [self initWithDelegate:nil];
@@ -41,24 +37,14 @@
return request_;
}
-- (void)sendDataRequestWithCompletionHandler:
- (DataTaskCompletionHandler)completionHandler {
- dataResponseHandler_ = completionHandler;
- NSURLSessionDataTask* dataTask =
- [session_ dataTaskWithRequest:request_
- completionHandler:dataResponseHandler_];
-
+- (void)sendDataRequest {
+ NSURLSessionDataTask* 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];
}

Powered by Google App Engine
This is Rietveld 408576698