Closed Bug 525181 Opened 15 years ago Closed 14 years ago

IPDL: Implement "soft" dynamic checking of protocol state in generated C++

Categories

(Core :: IPC, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cjones, Assigned: cjones)

References

Details

Attachments

(4 files)

No description provided.
Blocks: 536319
jduell, quick warning --- these patches by themselves probably won't be enough to implement state checking for necko (we're still a decent ways away from the whole enchilada). Bug 533002 ought to be enough, though, so you might want to block on that.
Summary: IPDL: Turn on dynamic protocol state-machine checking in generated C++ → IPDL: Implement "soft" dynamic checking of protocol state in generated C++
Damn! How did I forget this again?! Sorry, I'll get it tomorrow.
Comment on attachment 450820 [details] [diff] [review] Fix up the stub C++ implementation of protocol states in actor classes. Add a special NULL state (that only transitions to -->Null and -->Dead) for stateless protocols >+ stmts.append(StmtExpr(ExprAssn(_actorState(actorvar), >+ _startState(actorproto)))) >+ >+ return stmts I don't quite get why you changed to using append() rather than adding to the list, is that intentional?
Attachment #450820 - Flags: review?(bent.mozilla) → review+
Comment on attachment 450821 [details] [diff] [review] part 2: Implement protocol state machines in C++ >+ Trigger(Action _action, int32 _msg) : Bah, leading underscores?
Attachment #450821 - Flags: review?(bent.mozilla) → review+
Comment on attachment 450822 [details] [diff] [review] part 3: Turn on "soft" state checking, NS_WARNING()ing on bad transitions >+ # FIXME: make this a FatalError() >+ ifbad.addifstmt(_printWarningMessage('bad state transition!')) You could make a _handleBadTransition function maybe? Then switching behavior down the road might be more intuitive.
Attachment #450822 - Flags: review?(bent.mozilla) → review+
(In reply to comment #9) > Comment on attachment 450820 [details] [diff] [review] > Fix up the stub C++ implementation of protocol states in actor classes. Add a > special NULL state (that only transitions to -->Null and -->Dead) for stateless > protocols > > >+ stmts.append(StmtExpr(ExprAssn(_actorState(actorvar), > >+ _startState(actorproto)))) > >+ > >+ return stmts > > I don't quite get why you changed to using append() rather than adding to the > list, is that intentional? Hm, looks like brain damage. I think that code used to be in a |if hasstate:| block or similar and that the condition went away. Thanks for the catch.
(In reply to comment #10) > Comment on attachment 450821 [details] [diff] [review] > part 2: Implement protocol state machines in C++ > > >+ Trigger(Action _action, int32 _msg) : > > Bah, leading underscores? Alright alright, I'll use mFoo fields ;). *holds nose*
(In reply to comment #11) > Comment on attachment 450822 [details] [diff] [review] > part 3: Turn on "soft" state checking, NS_WARNING()ing on bad transitions > > >+ # FIXME: make this a FatalError() > >+ ifbad.addifstmt(_printWarningMessage('bad state transition!')) > > You could make a _handleBadTransition function maybe? Then switching behavior > down the road might be more intuitive. Good idea, done.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: