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

Side by Side Diff: chrome/installer/mac/app/NetworkCommunication.h

Issue 2094583004: Initial commit for Chrome metainstaller on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed majority of comments excluding refactoring for blocks in main. 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_INSTALLER_MAC_APP_NETWORKCOMMUNICATION_H_
6 #define CHROME_INSTALLER_MAC_APP_NETWORKCOMMUNICATION_H_
7
8 #import <Foundation/Foundation.h>
9
10 typedef void (^DataTaskCompletionHandler)(NSData*, NSURLResponse*, NSError*);
11 typedef void (^DownloadTaskCompletionHandler)(NSURL*, NSURLResponse*, NSError*);
12
13 @interface NetworkCommunication : NSObject
14
15 @property(nonatomic, copy) NSMutableURLRequest* request;
16 @property(nonatomic, copy) NSURLSession* session;
17 @property(nonatomic, copy) DataTaskCompletionHandler dataResponseHandler;
18 @property(nonatomic, copy) DownloadTaskCompletionHandler downloadResponseHandler ;
19
20 - (id)init;
21 - (id)initWithDelegate:(id) delegate;
22
23 // Creates a mutable URLRequest object as an instance variable, then returns it
24 // so the caller has a chance to edit it before sending the request out.
25 // Contrary to the assumption in Objective-C that all return values are returned
26 // by VALUE, it seems that changes made to the returned object outside of this
27 // class are retained.
28 - (NSMutableURLRequest*)createRequestWithURLasString:(NSString*) urlString
Mark Mentovai 2016/07/07 17:53:48 URLasString looks weird, like “UR Las String”. Con
29 andXMLBody:(NSXMLDocument*) body;
30 // Adds a data task to the run loop using the request instance variable.
31 - (void)sendDataRequestWithCompletionHandler:
32 (DataTaskCompletionHandler) completionHandler;
33 // Adds a download task to the run loop using the request instance variable.
34 - (void)sendDownloadRequest;
35
36 @end
37
38 #endif // CHROME_INSTALLER_MAC_APP_NETWORKCOMMUNICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698