Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / crash_report / crash_report_background_uploader.h
blob3469293ed46f63ba04066c3ef652460da3ea0489
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
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_CRASH_REPORT_CRASH_REPORT_BACKGROUND_UPLOADER_H_
6 #define IOS_CHROME_BROWSER_CRASH_REPORT_CRASH_REPORT_BACKGROUND_UPLOADER_H_
8 #import <UIKit/UIKit.h>
10 #include "base/ios/block_types.h"
12 typedef void (^BackgroundFetchCompletionBlock)(UIBackgroundFetchResult);
14 @interface CrashReportBackgroundUploader : NSObject
16 + (instancetype)sharedInstance;
18 // Handler for the application delegate |performFetchWithCompletionHandler|
19 // message. Sends the next breakpad report if available.
20 + (void)performFetchWithCompletionHandler:
21 (BackgroundFetchCompletionBlock)completionHandler;
23 // Handler for the application delegate |handleEventsForBackgroundURLSession|
24 // message. Retrieves info from the URL Session.
25 + (void)handleEventsForBackgroundURLSession:(NSString*)identifier
26 completionHandler:(ProceduralBlock)completionHandler;
28 // Returns YES if the session is a breakpad upload session.
29 + (BOOL)canHandleBackgroundURLSession:(NSString*)identifier;
31 // Returns YES if crash reports where uploaded in the background.
32 + (BOOL)hasUploadedCrashReportsInBackground;
34 // Resets the number of crash reports that have been uploaded.
35 + (void)resetReportsUploadedInBackgroundCount;
37 // Flag to determine if there are any pending crash reports on startup. This is
38 // not an indication that there are pending crash reports at the moment this
39 // flag is checked.
40 @property(nonatomic, assign) BOOL hasPendingCrashReportsToUploadAtStartup;
42 @end
44 #endif // IOS_CHROME_BROWSER_CRASH_REPORT_CRASH_REPORT_BACKGROUND_UPLOADER_H_