From 315d1368a7f38071b7ff79dd813a07ea9d157a30 Mon Sep 17 00:00:00 2001 From: Evan Bernstein Date: Thu, 4 Oct 2018 14:46:45 -0700 Subject: Adds method to get the date of the most recent iOS crash report. Also adds method to determine if breakpad is started. Change-Id: I272765e7ac6bbc07d77ca2d8dcc34d51c205116e Reviewed-on: https://chromium-review.googlesource.com/c/1260625 Reviewed-by: Joshua Peraza --- src/client/ios/BreakpadController.mm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/client/ios/BreakpadController.mm') diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index dc5a2d1e..8d499c27 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -156,6 +156,10 @@ NSString* GetPlatform() { }); } +- (BOOL)isStarted { + return started_; +} + // This method must be called from the breakpad queue. - (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration withBreakpadRef:(BreakpadRef)ref { @@ -289,6 +293,18 @@ NSString* GetPlatform() { }); } +- (void)getDateOfMostRecentCrashReport:(void(^)(NSDate *))callback { + NSAssert(started_, @"The controller must be started before " + "getDateOfMostRecentCrashReport is called"); + dispatch_async(queue_, ^{ + if (!breakpadRef_) { + callback(nil); + return; + } + callback(BreakpadGetDateOfMostRecentCrashReport(breakpadRef_)); + }); +} + #pragma mark - - (int)sendDelay { -- cgit v1.2.1