diff options
author | Olivier Robin <olivierrobin@chromium.org> | 2019-04-18 18:06:31 +0200 |
---|---|---|
committer | Mark Mentovai <mark@chromium.org> | 2019-04-23 13:07:06 +0000 |
commit | 1fc9cc0d0e1dfafb8d29dba8d01f09587d870026 (patch) | |
tree | ad334e68729ce88aec5d750f9be3cd21f838d745 /src/client/mac/sender/uploader.mm | |
parent | Make breakpad_unittests work with Chrome's test runner instead of gtest's (diff) | |
download | breakpad-1fc9cc0d0e1dfafb8d29dba8d01f09587d870026.tar.xz |
[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 <mark@chromium.org>
Diffstat (limited to 'src/client/mac/sender/uploader.mm')
-rw-r--r-- | src/client/mac/sender/uploader.mm | 8 |
1 files changed, 8 insertions, 0 deletions
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 = @@ -548,6 +551,11 @@ NSDictionary *readConfigurationData(const char *configFile) { } //============================================================================= +- (void)setUploadCompletionBlock:(UploadCompletionBlock)uploadCompletion { + uploadCompletion_ = uploadCompletion; +} + +//============================================================================= - (void)report { NSURL *url = [NSURL URLWithString:[parameters_ objectForKey:@BREAKPAD_URL]]; |