aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblundell@chromium.org <blundell@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-12 14:52:37 +0000
committerblundell@chromium.org <blundell@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-12 14:52:37 +0000
commit88b8ac618241f25d977c75224b7969c0064c3f49 (patch)
treeea9cd14da10bc0afd94dc7c29d1eef3fd27fcb49
parentdisable unittests under ASAN that use memory crashes (diff)
downloadbreakpad-88b8ac618241f25d977c75224b7969c0064c3f49.tar.xz
Add -[BreakpadController resetConfiguration] for iOS.
Add a resetConfiguration method to BreakpadController for iOS. The new method resets the controller configuration to its initial value, which is the infoDictionary of the bundle of the application. Patch by KiYun Roe <kiyun@chromium.org> BUG=554 Review URL: https://breakpad.appspot.com/904002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1256 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r--src/client/ios/BreakpadController.h4
-rw-r--r--src/client/ios/BreakpadController.mm15
2 files changed, 15 insertions, 4 deletions
diff --git a/src/client/ios/BreakpadController.h b/src/client/ios/BreakpadController.h
index eb59e228..be072ea9 100644
--- a/src/client/ios/BreakpadController.h
+++ b/src/client/ios/BreakpadController.h
@@ -71,6 +71,10 @@
// new one. Merge is done by replacing the old values by the new values.
- (void)updateConfiguration:(NSDictionary*)configuration;
+// Reset the controller configuration to its initial value, which is the
+// infoDictionary of the bundle of the application.
+- (void)resetConfiguration;
+
// Configure the URL to upload the report to. This must be called at least once
// if the URL is not in the bundle information.
- (void)setUploadingURL:(NSString*)url;
diff --git a/src/client/ios/BreakpadController.mm b/src/client/ios/BreakpadController.mm
index ac560d18..9a6dd814 100644
--- a/src/client/ios/BreakpadController.mm
+++ b/src/client/ios/BreakpadController.mm
@@ -108,12 +108,9 @@ NSString* GetPlatform() {
self = [super init];
if (self) {
queue_ = dispatch_queue_create("com.google.BreakpadQueue", NULL);
- configuration_ = [[[NSBundle mainBundle] infoDictionary] mutableCopy];
enableUploads_ = NO;
started_ = NO;
- NSString* uploadInterval =
- [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
- [self setUploadInterval:[uploadInterval intValue]];
+ [self resetConfiguration];
}
return self;
}
@@ -187,6 +184,16 @@ NSString* GetPlatform() {
[self setUploadInterval:[uploadInterval intValue]];
}
+- (void)resetConfiguration {
+ NSAssert(!started_,
+ @"The controller must not be started when resetConfiguration is called");
+ [configuration_ autorelease];
+ configuration_ = [[[NSBundle mainBundle] infoDictionary] mutableCopy];
+ NSString* uploadInterval =
+ [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
+ [self setUploadInterval:[uploadInterval intValue]];
+}
+
- (void)setUploadingURL:(NSString*)url {
NSAssert(!started_,
@"The controller must not be started when setUploadingURL is called");