From 12528d19bdf7b00a0f1ad5cd466a12d587189055 Mon Sep 17 00:00:00 2001 From: "blundell@chromium.org" Date: Mon, 13 Jan 2014 10:40:07 +0000 Subject: Add -[BreakpadController setParametersToAddAtUploadTime:] for iOS. This provides the ability to add server parameters to a crash report when the report is uploaded. Patch by KiYun Roe BUG=558 R=blundell@chromium.org Review URL: https://breakpad.appspot.com/974002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1271 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/ios/BreakpadController.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/client/ios/BreakpadController.mm') diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm index 9a6dd814..4571470d 100644 --- a/src/client/ios/BreakpadController.mm +++ b/src/client/ios/BreakpadController.mm @@ -120,6 +120,7 @@ NSString* GetPlatform() { assert(!breakpadRef_); dispatch_release(queue_); [configuration_ release]; + [uploadTimeParameters_ release]; [super dealloc]; } @@ -192,6 +193,7 @@ NSString* GetPlatform() { NSString* uploadInterval = [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL]; [self setUploadInterval:[uploadInterval intValue]]; + [self setParametersToAddAtUploadTime:nil]; } - (void)setUploadingURL:(NSString*)url { @@ -209,6 +211,13 @@ NSString* GetPlatform() { uploadIntervalInSeconds_ = 0; } +- (void)setParametersToAddAtUploadTime:(NSDictionary*)uploadTimeParameters { + NSAssert(!started_, @"The controller must not be started when " + "setParametersToAddAtUploadTime is called"); + [uploadTimeParameters_ autorelease]; + uploadTimeParameters_ = [uploadTimeParameters copy]; +} + - (void)addUploadParameter:(NSString*)value forKey:(NSString*)key { NSAssert(started_, @"The controller must be started before addUploadParameter is called"); @@ -291,7 +300,7 @@ NSString* GetPlatform() { // A report can be sent now. if (timeToWait == 0) { [self reportWillBeSent]; - BreakpadUploadNextReport(breakpadRef_); + BreakpadUploadNextReport(breakpadRef_, uploadTimeParameters_); // If more reports must be sent, make sure this method is called again. if (BreakpadGetCrashReportCount(breakpadRef_) > 0) -- cgit v1.2.1