From 1335417f9feefd20e5b0e4b1e18e9010edb87043 Mon Sep 17 00:00:00 2001 From: "blundell@chromium.org" Date: Mon, 1 Sep 2014 11:02:57 +0000 Subject: Adding possibility for client to upload the file This CL adds three features that will allow the client to upload the report file. Three main modifications are made : - Allow upload url to have a file:// scheme, and write the HTTP request to file in that case - Split the request in two parts in case of a file:// scheme, the request time and the response time. A new API [handleNetworkResponse] is added. - Give the opportunity to the client to get the configuration NSDictionary to be able to recreate the breakpad context at response time. Patch by Olivier Robin Review URL: https://breakpad.appspot.com/2764002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1368 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/ios/BreakpadController.mm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/client/ios/BreakpadController.mm') diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index a85dd68e..dd71cff6 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -155,6 +155,18 @@ NSString* GetPlatform() { }); } +// This method must be called from the breakpad queue. +- (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration + withBreakpadRef:(BreakpadRef)ref { + NSAssert(started_, @"The controller must be started before " + "threadUnsafeSendReportWithConfiguration is called"); + if (breakpadRef_) { + BreakpadUploadReportWithParametersAndConfiguration(breakpadRef_, + uploadTimeParameters_, + configuration); + } +} + - (void)setUploadingEnabled:(BOOL)enabled { NSAssert(started_, @"The controller must be started before setUploadingEnabled is called"); @@ -260,6 +272,25 @@ NSString* GetPlatform() { }); } +- (void)getNextReportConfigurationOrSendDelay: + (void(^)(NSDictionary*, int))callback { + NSAssert(started_, @"The controller must be started before " + "getNextReportConfigurationOrSendDelay is called"); + dispatch_async(queue_, ^{ + if (!breakpadRef_) { + callback(nil, -1); + return; + } + int delay = [self sendDelay]; + if (delay != 0) { + callback(nil, delay); + return; + } + [self reportWillBeSent]; + callback(BreakpadGetNextReportConfiguration(breakpadRef_), 0); + }); +} + #pragma mark - - (int)sendDelay { -- cgit v1.2.1