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

Side by Side Diff: chrome/installer/mac/app/Downloader.m

Issue 2293923005: General comment cleaning / refactoring for Mac Installer (Closed)
Patch Set: Created 4 years, 3 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "Downloader.h" 5 #import "Downloader.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 @implementation Downloader 9 @implementation Downloader
10 10
(...skipping 15 matching lines...) Expand all
26 - (void)URLSession:(NSURLSession*)session 26 - (void)URLSession:(NSURLSession*)session
27 downloadTask:(NSURLSessionDownloadTask*)downloadTask 27 downloadTask:(NSURLSessionDownloadTask*)downloadTask
28 didWriteData:(int64_t)bytesWritten 28 didWriteData:(int64_t)bytesWritten
29 totalBytesWritten:(int64_t)totalBytesWritten 29 totalBytesWritten:(int64_t)totalBytesWritten
30 totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite { 30 totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
31 double downloadProgressPercentage = 31 double downloadProgressPercentage =
32 (double)totalBytesWritten / totalBytesExpectedToWrite * 100.0; 32 (double)totalBytesWritten / totalBytesExpectedToWrite * 100.0;
33 [delegate_ downloader:self percentProgress:downloadProgressPercentage]; 33 [delegate_ downloader:self percentProgress:downloadProgressPercentage];
34 } 34 }
35 35
36 // Delegate method to move downloaded disk image to user's Download directory.
37 - (void)URLSession:(NSURLSession*)session 36 - (void)URLSession:(NSURLSession*)session
38 downloadTask:(NSURLSessionDownloadTask*)downloadTask 37 downloadTask:(NSURLSessionDownloadTask*)downloadTask
39 didFinishDownloadingToURL:(NSURL*)location { 38 didFinishDownloadingToURL:(NSURL*)location {
40 assert([location isFileURL]); 39 assert([location isFileURL]);
41 [delegate_ downloader:self onSuccess:location]; 40 [delegate_ downloader:self onSuccess:location];
42 } 41 }
43 42
44 - (void)URLSession:(NSURLSession*)session 43 - (void)URLSession:(NSURLSession*)session
45 task:(NSURLSessionTask*)task 44 task:(NSURLSessionTask*)task
46 didCompleteWithError:(NSError*)error { 45 didCompleteWithError:(NSError*)error {
47 if (error) { 46 if (error) {
48 [delegate_ downloader:self onFailure:error]; 47 [delegate_ downloader:self onFailure:error];
49 } 48 }
50 } 49 }
51 50
52 @end 51 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698