Closed
Bug 545455
Opened 15 years ago
Closed 15 years ago
IPDL: Add hooks for when RPCChannel code is first pushed on and finally popped from the C++ stack
Categories
(Core :: IPC, enhancement)
Core
IPC
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a2
People
(Reporter: cjones, Assigned: cjones)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
8.44 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
5.22 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
7.16 KB,
patch
|
Details | Diff | Splinter Review |
Two uses so far (1) Enable/disable nested glib event loop detection, for better power efficiency (2) Defer Dealloc*() in IPDL until IPDL code is off the stack (mostly) I really only care about hooking RPCChannel because that's all we've used so far, but a similar hook could be useful for SyncChannel.
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: nobody → jones.chris.g
Attachment #426608 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 2•15 years ago
|
||
Attachment #426609 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 3•15 years ago
|
||
Comment on attachment 426608 [details] [diff] [review] Part 1: Track when RPCChannel code is first pushed on the C++ stack and last popped >+ void ExitedCxxStack(); >+ class NS_STACK_CLASS CxxStackFrame { Nit: Newline between those >+ CxxStackFrame(RPCChannel& that) : mThat(that) { How about also AssertWorkerThread'ing here and in the dtor
Attachment #426608 -
Flags: review?(bent.mozilla) → review+
Comment on attachment 426609 [details] [diff] [review] Part 2: Expose override-able hooks for top-level IPDL actors to be notified on stack entrance/exit > RPCChannel::EnteredCxxStack() > RPCChannel::ExitedCxxStack() Looks like these can be moved to the header (inlined) >+ virtual void OnEnteredCxxStack() = 0; >+ virtual void OnExitedCxxStack() = 0; I think you should have a default impl that aborts here rather than make each non-toplevel actor implement their own.
Ooh, ooh! Can we also make these RPCStack helpers record message name?! Maybe only in debug builds?!
Assignee | ||
Comment 7•15 years ago
|
||
(In reply to comment #5) > (From update of attachment 426609 [details] [diff] [review]) > > RPCChannel::EnteredCxxStack() > > RPCChannel::ExitedCxxStack() > > Looks like these can be moved to the header (inlined) > > >+ virtual void OnEnteredCxxStack() = 0; > >+ virtual void OnExitedCxxStack() = 0; > > I think you should have a default impl that aborts here rather than make each > non-toplevel actor implement their own. Did you mean to leave the review status as "?"? Do you want to see the updated patch?
Assignee | ||
Comment 8•15 years ago
|
||
(In reply to comment #6) > Ooh, ooh! Can we also make these RPCStack helpers record message name?! Maybe > only in debug builds?! I have plans to add a Message::name() interface (in opt builds too). Would that suit your needs?
Comment on attachment 426609 [details] [diff] [review] Part 2: Expose override-able hooks for top-level IPDL actors to be notified on stack entrance/exit Oops
Attachment #426609 -
Flags: review?(bent.mozilla) → review+
(In reply to comment #8) > I have plans to add a Message::name() interface (in opt builds too). Would > that suit your needs? I just want to be able to look at some variable in the debugger that has a stack of message names. I don't want to have to call any functions (can't do that in record+replay) to do it either. Just a simple const char* for each rpcframe would do it i think. And only in DEBUG builds.
Assignee | ||
Comment 11•15 years ago
|
||
OIC. Like storing a std::stack<const char*> as a member of RPCChannel, and having CxxStackFrame push Message::name() onto that as part of the ctor? That's certainly doable.
Assignee | ||
Comment 12•15 years ago
|
||
http://hg.mozilla.org/projects/electrolysis/rev/5ca3dfc1266a http://hg.mozilla.org/projects/electrolysis/rev/9800842b1f02 http://hg.mozilla.org/projects/electrolysis/rev/642cb539eb88
Whiteboard: [land m-c]
Comment 13•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/dbfb36b8b381 http://hg.mozilla.org/mozilla-central/rev/d0f27565024d http://hg.mozilla.org/mozilla-central/rev/569dede83071
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [land m-c]
Target Milestone: --- → mozilla1.9.3a2
You need to log in
before you can comment on or make changes to this bug.
Description
•