From 1fc9cc0d0e1dfafb8d29dba8d01f09587d870026 Mon Sep 17 00:00:00 2001 From: Olivier Robin Date: Thu, 18 Apr 2019 18:06:31 +0200 Subject: [Breakpad iOS] Add a callback on report upload completion. This CL adds a result callback on report upload completion. On failure, Breakpad deletes the configuration file and does retry to upload a report. Using this callback, the client will be able to log some metrics and to act on upload failure. Bug: 954175 Change-Id: I95a3264b65d4c06ba5d8dde8377440d23f1e2081 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1572661 Reviewed-by: Mark Mentovai --- src/client/mac/sender/uploader.mm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client/mac/sender/uploader.mm') diff --git a/src/client/mac/sender/uploader.mm b/src/client/mac/sender/uploader.mm index c74c0583..08aecf76 100644 --- a/src/client/mac/sender/uploader.mm +++ b/src/client/mac/sender/uploader.mm @@ -511,6 +511,9 @@ NSDictionary *readConfigurationData(const char *configFile) { reportID = [[result stringByTrimmingCharactersInSet:trimSet] UTF8String]; [self logUploadWithID:reportID]; } + if (uploadCompletion_) { + uploadCompletion_([NSString stringWithUTF8String:reportID], error); + } // rename the minidump file according to the id returned from the server NSString *minidumpDir = @@ -547,6 +550,11 @@ NSDictionary *readConfigurationData(const char *configFile) { return [NSURLQueryItem queryItemWithName:queryItemName value:escapedValue]; } +//============================================================================= +- (void)setUploadCompletionBlock:(UploadCompletionBlock)uploadCompletion { + uploadCompletion_ = uploadCompletion; +} + //============================================================================= - (void)report { NSURL *url = [NSURL URLWithString:[parameters_ objectForKey:@BREAKPAD_URL]]; -- cgit v1.2.1