From 00407e09c734c1be508d20d392e09e3c4364a73a Mon Sep 17 00:00:00 2001 From: "qsr@chromium.org" Date: Fri, 1 Feb 2013 09:49:09 +0000 Subject: [PATCH] Add API to find out if there is crash reports to send to the server. Review URL: https://breakpad.appspot.com/518002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1109 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/ios/BreakpadController.h | 3 +++ src/client/ios/BreakpadController.mm | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/client/ios/BreakpadController.h b/src/client/ios/BreakpadController.h index f766100e..6e6229a7 100644 --- a/src/client/ios/BreakpadController.h +++ b/src/client/ios/BreakpadController.h @@ -105,6 +105,9 @@ // BreakpadController. - (void)setUploadingEnabled:(BOOL)enabled; +// Check if there is currently a crash report to upload. +- (void)hasReportToUpload:(void(^)(BOOL))callback; + @end #endif // CLIENT_IOS_HANDLER_IOS_BREAKPAD_CONTROLLER_H_ diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index 01312c8f..31affa18 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -228,6 +228,13 @@ NSString* GetPlatform() { }); } +- (void)hasReportToUpload:(void(^)(BOOL))callback { + NSAssert(started_, @"The controller must be started before " + "hasReportToUpload is called"); + dispatch_async(queue_, ^{ + callback(breakpadRef_ && BreakpadHasCrashReportToUpload(breakpadRef_)); + }); +} #pragma mark -