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

Side by Side Diff: ios/chrome/browser/crash_report/crash_report_background_uploader.mm

Issue 1552533003: Remove last vestige of APIs that are deprecated in iOS 8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ios/chrome/browser/crash_report/crash_report_background_uploader.h" 5 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/scoped_block.h" 10 #include "base/mac/scoped_block.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 static CrashReportBackgroundUploader* instance = 170 static CrashReportBackgroundUploader* instance =
171 [[CrashReportBackgroundUploader alloc] init]; 171 [[CrashReportBackgroundUploader alloc] init];
172 return instance; 172 return instance;
173 } 173 }
174 174
175 + (NSURLSession*)BreakpadBackgroundURLSessionWithCompletionHandler: 175 + (NSURLSession*)BreakpadBackgroundURLSessionWithCompletionHandler:
176 (ProceduralBlock)completionHandler { 176 (ProceduralBlock)completionHandler {
177 static NSURLSession* session = nil; 177 static NSURLSession* session = nil;
178 static dispatch_once_t onceToken; 178 static dispatch_once_t onceToken;
179 dispatch_once(&onceToken, ^{ 179 dispatch_once(&onceToken, ^{
180
181 // TODO(olivierrobin) When all bots compile with iOS8 release SDK, use
182 // only backgroundSessionConfigurationWithIdentifier.
183 NSURLSessionConfiguration* sessionConfig = [NSURLSessionConfiguration 180 NSURLSessionConfiguration* sessionConfig = [NSURLSessionConfiguration
184 backgroundSessionConfiguration:kBackgroundReportUploader]; 181 backgroundSessionConfigurationWithIdentifier:kBackgroundReportUploader];
185
186 session = [NSURLSession 182 session = [NSURLSession
187 sessionWithConfiguration:sessionConfig 183 sessionWithConfiguration:sessionConfig
188 delegate:[UrlSessionDelegate sharedInstance] 184 delegate:[UrlSessionDelegate sharedInstance]
189 delegateQueue:[NSOperationQueue mainQueue]]; 185 delegateQueue:[NSOperationQueue mainQueue]];
190 }); 186 });
191 DCHECK(session); 187 DCHECK(session);
192 if (completionHandler) { 188 if (completionHandler) {
193 [[UrlSessionDelegate sharedInstance] 189 [[UrlSessionDelegate sharedInstance]
194 setSessionCompletionHandler:completionHandler]; 190 setSessionCompletionHandler:completionHandler];
195 } 191 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 integerForKey:kReportsUploadedInBackground]; 353 integerForKey:kReportsUploadedInBackground];
358 return uploadedCrashReportsInBackgroundCount > 0; 354 return uploadedCrashReportsInBackgroundCount > 0;
359 } 355 }
360 356
361 + (void)resetReportsUploadedInBackgroundCount { 357 + (void)resetReportsUploadedInBackgroundCount {
362 [[NSUserDefaults standardUserDefaults] 358 [[NSUserDefaults standardUserDefaults]
363 removeObjectForKey:kReportsUploadedInBackground]; 359 removeObjectForKey:kReportsUploadedInBackground];
364 } 360 }
365 361
366 @end 362 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698