Updating BreakpadController to allow start and stop being nop. (issue 505002)

1 view
Skip to first unread message

q...@chromium.org

unread,
Dec 17, 2012, 8:58:45 AM12/17/12
to ma...@chromium.org, google-br...@googlegroups.com, re...@breakpad-hr.appspotmail.com
Reviewers: Mark Mentovai,

Description:
Updating BreakpadController to allow start and stop being nop.

When BreakpadController is already started or stopped, trying to
restart it or
restopping it will now be no-op instead of asserting.

Please review this at https://breakpad.appspot.com/505002/

Affected files:
M src/client/ios/BreakpadController.mm


Index: src/client/ios/BreakpadController.mm
===================================================================
--- src/client/ios/BreakpadController.mm (revision 1091)
+++ src/client/ios/BreakpadController.mm (working copy)
@@ -136,7 +136,8 @@
BreakpadAddUploadParameter(breakpadRef_, @"platform",
GetPlatform());
}
};
- NSAssert(!started_, @"Start cannot be called more than once.");
+ if (started)
+ return;
started_ = YES;
if (onCurrentThread)
startBlock();
@@ -145,8 +146,8 @@
}

- (void)stop {
- NSAssert(started_,
- @"The controller must be started before it can be stopped");
+ if (!started)
+ return;
started_ = NO;
dispatch_sync(queue_, ^{
if (breakpadRef_) {


ma...@chromium.org

unread,
Dec 17, 2012, 9:17:22 AM12/17/12
to q...@chromium.org, google-br...@googlegroups.com, re...@breakpad-hr.appspotmail.com
LGTM


https://breakpad.appspot.com/505002/diff/1/src/client/ios/BreakpadController.mm
File src/client/ios/BreakpadController.mm (right):

https://breakpad.appspot.com/505002/diff/1/src/client/ios/BreakpadController.mm#newcode132
src/client/ios/BreakpadController.mm:132: void(^startBlock)() = ^{
Let’s move the declaration of startBlock down to where it’s actually
needed, right before testing onCurrentThread.

https://breakpad.appspot.com/505002/

q...@chromium.org

unread,
Dec 17, 2012, 9:20:00 AM12/17/12
to ma...@chromium.org, google-br...@googlegroups.com, re...@breakpad-hr.appspotmail.com

https://breakpad.appspot.com/505002/diff/1/src/client/ios/BreakpadController.mm
File src/client/ios/BreakpadController.mm (right):

https://breakpad.appspot.com/505002/diff/1/src/client/ios/BreakpadController.mm#newcode132
src/client/ios/BreakpadController.mm:132: void(^startBlock)() = ^{
On 2012/12/17 14:17:22, Mark Mentovai wrote:
> Let’s move the declaration of startBlock down to where it’s actually
needed,
> right before testing onCurrentThread.

Done.

https://breakpad.appspot.com/505002/
Reply all
Reply to author
Forward
0 new messages