Closed
Bug 951855
Opened 12 years ago
Closed 11 years ago
nsICycleCollectorListener's documentation is confusing
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: jimb, Assigned: jimb)
Details
Attachments
(1 file, 3 obsolete files)
8.18 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
The comments in xpcom/base/nsICycleCollectorListener.idl don't make clear the relationship between nsICycleCollectorListener and nsICycleCollectorHandler, and its rationale. bz dared me to improve the docs on IRC, so here's my attempt. It's probably too long-winded, but hopefully it's an improvement.
Attachment #8349667 -
Flags: review?(bugs)
Assignee | ||
Comment 1•12 years ago
|
||
Fixed some typos.
Assignee: nobody → jimb
Attachment #8349667 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8349667 -
Flags: review?(bugs)
Assignee | ||
Updated•12 years ago
|
Attachment #8349675 -
Flags: review?(bugs)
Comment 2•12 years ago
|
||
Comment on attachment 8349667 [details] [diff] [review]
Improve documentation for nsICycleCollectionListener and nsICycleCollectionHandler.
Could you document disableLog = true and wantAfterProcessing too.
JS probably wants
disableLog = true; // disables the default print-log-to-file
wantAfterProcessing = true; // enables graph recording.
And yes, we could have two different implementations of
nsICycleCollectorHandler, but so far the setup has worked just fine.
Comment 3•12 years ago
|
||
Comment on attachment 8349667 [details] [diff] [review]
Improve documentation for nsICycleCollectionListener and nsICycleCollectionHandler.
Could you document disableLog = true and wantAfterProcessing too.
JS probably wants
disableLog = true; // disables the default print-log-to-file
wantAfterProcessing = true; // enables graph recording.
And yes, we could have two different implementations of
nsICycleCollectorHandler, but so far the setup has worked just fine.
Updated•12 years ago
|
Attachment #8349675 -
Flags: review?(bugs)
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #2)
> And yes, we could have two different implementations of
> nsICycleCollectorHandler, but so far the setup has worked just fine.
Hah, didn't I make some remark to you long ago about using the same underlying C++ class to implement all the different flavors of message managers? nsICycleCollectorListener is the same strategy: have one class that implements two different behaviors, under the guidance of some booleans.
Assignee | ||
Comment 5•12 years ago
|
||
Address review comments: document disableLog and wantAfterProcessing, and describe the general flow of using from JS.
Attachment #8349675 -
Attachment is obsolete: true
Attachment #8349751 -
Flags: review?(bugs)
Comment 6•12 years ago
|
||
Message manager is very different kind of beast, and there it just makes the implementation easier to
keep everything in one place, and it doesn't affect to the API.
Here keeping everything in one places makes the API look a bit bad.
Assignee | ||
Comment 7•12 years ago
|
||
Document allTraces, too.
Attachment #8349751 -
Attachment is obsolete: true
Attachment #8349751 -
Flags: review?(bugs)
Attachment #8350157 -
Flags: review?(bugs)
Assignee | ||
Comment 8•12 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #6)
> Here keeping everything in one places makes the API look a bit bad.
I filed bug 952257 with what I imagine you had in mind.
Comment 9•11 years ago
|
||
Comment on attachment 8350157 [details] [diff] [review]
Improve documentation for nsICycleCollectionListener and nsICycleCollectionHandler.
> [scriptable, builtinclass, uuid(7096e77d-7834-4996-b52c-50564144d4be)]
> interface nsICycleCollectorListener : nsISupports
> {
>+ // Return a listener that directs the cycle collector to traverse objects
>+ // that it knows won't be collectable. If your purpose is to build a picture
>+ // of the heap, and not simply find garbage, then you should use the
>+ // listener this returns.
"of the heap" isn't quite right, since CC doesn't know about the whole heap.
It knows about the possible garbage
(and allTraces() disables optimizations which try to remove certainly alive objects from that set of possible garbage objects)
>- attribute boolean wantAfterProcessing;
>
> // This string will appear somewhere in the log's filename.
> attribute AString filenameIdentifier;
>
>+ // If true, record all method calls in memory, to be retrieved later
>+ // using |processNext|. Initially false.
>+ attribute boolean wantAfterProcessing;
Since you move this attribute, you need to also update uuid of this interface.
Attachment #8350157 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 10•11 years ago
|
||
Flags: in-testsuite-
Target Milestone: --- → mozilla31
Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #9)
> >+ // Return a listener that directs the cycle collector to traverse objects
> >+ // that it knows won't be collectable. If your purpose is to build a picture
> >+ // of the heap, and not simply find garbage, then you should use the
> >+ // listener this returns.
> "of the heap" isn't quite right, since CC doesn't know about the whole heap.
> It knows about the possible garbage
> (and allTraces() disables optimizations which try to remove certainly alive
> objects from that set of possible garbage objects)
I missed this comment. Amended in this push:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2bbc1d0a9dbb
> Since you move this attribute, you need to also update uuid of this
> interface.
I did update the UUID in my first push.
Comment 12•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5a6dd74ed6c1
https://hg.mozilla.org/mozilla-central/rev/2bbc1d0a9dbb
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•