diff options
author | mark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-11-20 16:34:13 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-11-20 16:34:13 +0000 |
commit | 8e28cb38988455cbdd4fcac2c8dc7301baca009a (patch) | |
tree | a98b6d980deaf0f3e974e283e14c764e16926510 /src/client/ios/BreakpadController.mm | |
parent | Allow SIGABRT to abort the program. (diff) | |
download | breakpad-8e28cb38988455cbdd4fcac2c8dc7301baca009a.tar.xz |
Provide BreakpadGetCrashReportCount() and -[BreakpadController
getCrashReportCount:]
This provides the ability for clients to query the number of crash reports
that are waiting to upload.
Patch by KiYun Roe <kiyun@chromium.org>
BUG=547
Review URL: https://breakpad.appspot.com/714002/
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1234 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/ios/BreakpadController.mm')
-rw-r--r-- | src/client/ios/BreakpadController.mm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index 31affa18..ac560d18 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -232,7 +232,15 @@ NSString* GetPlatform() { NSAssert(started_, @"The controller must be started before " "hasReportToUpload is called"); dispatch_async(queue_, ^{ - callback(breakpadRef_ && BreakpadHasCrashReportToUpload(breakpadRef_)); + callback(breakpadRef_ && (BreakpadGetCrashReportCount(breakpadRef_) > 0)); + }); +} + +- (void)getCrashReportCount:(void(^)(int))callback { + NSAssert(started_, @"The controller must be started before " + "getCrashReportCount is called"); + dispatch_async(queue_, ^{ + callback(breakpadRef_ ? BreakpadGetCrashReportCount(breakpadRef_) : 0); }); } @@ -264,7 +272,7 @@ NSString* GetPlatform() { - (void)sendStoredCrashReports { dispatch_async(queue_, ^{ - if (!BreakpadHasCrashReportToUpload(breakpadRef_)) + if (BreakpadGetCrashReportCount(breakpadRef_) == 0) return; int timeToWait = [self sendDelay]; @@ -279,7 +287,7 @@ NSString* GetPlatform() { BreakpadUploadNextReport(breakpadRef_); // If more reports must be sent, make sure this method is called again. - if (BreakpadHasCrashReportToUpload(breakpadRef_)) + if (BreakpadGetCrashReportCount(breakpadRef_) > 0) timeToWait = uploadIntervalInSeconds_; } |