Closed
Bug 975823
Opened 10 years ago
Closed 10 years ago
Clean up nsStreamConverterService
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(14 files, 1 obsolete file)
8.23 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
7.24 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
6.24 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
3.05 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
4.50 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
5.10 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
2.64 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
4.00 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
6.20 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
1.67 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
5.03 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
7.83 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
1.74 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
2.24 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
The code in this file is pretty old, and there are some things that can be cleaned up. 1. Some trailing whitespace. 2. Tons of null checks for the return value of infallible new. 3. The two different hashtables in this file use the same type for their data, for no reason. The combination of 2 and 3 allows a lot of simplifications.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8384161 -
Attachment is obsolete: true
Assignee | ||
Comment 3•10 years ago
|
||
Assignee | ||
Comment 4•10 years ago
|
||
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Comment 7•10 years ago
|
||
Assignee | ||
Comment 8•10 years ago
|
||
Assignee | ||
Comment 9•10 years ago
|
||
Assignee | ||
Comment 10•10 years ago
|
||
Assignee | ||
Comment 11•10 years ago
|
||
Assignee | ||
Comment 12•10 years ago
|
||
Assignee | ||
Comment 13•10 years ago
|
||
Assignee | ||
Comment 14•10 years ago
|
||
Assignee | ||
Comment 15•10 years ago
|
||
Patrick, do you have a suggestion for who could review these changes to nsStreamConverterService, or should I just pick a random networking peer? There are a lot of patches here, but each one makes a small mechanical change, and shouldn't really require a deep understanding of whatever this class is doing.
Flags: needinfo?(mcmanus)
Assignee | ||
Comment 17•10 years ago
|
||
Thanks! In part 7, SCTableData ends up as a typedef, which I don't inline. Instead, I'm going to do that in bug 972593, because the conversion to a modern hash table eliminates a bunch of casts that mention SCTableData, so it makes the replacement a little nicer.
Updated•10 years ago
|
Attachment #8391885 -
Flags: review+
Updated•10 years ago
|
Attachment #8391886 -
Flags: review+
Comment 18•10 years ago
|
||
Andrew - I appreciate the legacy cleanup. We've got a lot of that hanging around. You deserve an award for turning the patch series into a choose-your-own-adventure (best-path) novel..
Updated•10 years ago
|
Attachment #8391887 -
Flags: review+
Updated•10 years ago
|
Attachment #8391888 -
Flags: review+
Updated•10 years ago
|
Attachment #8391889 -
Flags: review+
Updated•10 years ago
|
Attachment #8391890 -
Flags: review+
Updated•10 years ago
|
Attachment #8391891 -
Flags: review+
Comment 19•10 years ago
|
||
Comment on attachment 8391892 [details] [diff] [review] part 8 - Inline nsStreamConverterService::Init which is now infallible. Review of attachment 8391892 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/streamconv/src/nsStreamConverterService.cpp @@ +52,5 @@ > // Adjacency list data class. > typedef nsCOMArray<nsIAtom> SCTableData; > > +// Delete all the entries in the adjacency list > +static bool DeleteAdjacencyEntry(nsHashKey *aKey, void *aData, void* closure) { nit *closure not * closure.. but you're just moving the code so don't fix if its a pain.
Attachment #8391892 -
Flags: review+
Updated•10 years ago
|
Attachment #8391894 -
Flags: review+
Updated•10 years ago
|
Attachment #8391895 -
Flags: review+
Updated•10 years ago
|
Attachment #8391896 -
Flags: review+
Updated•10 years ago
|
Attachment #8391897 -
Flags: review+
Updated•10 years ago
|
Attachment #8391898 -
Flags: review+
Assignee | ||
Comment 20•10 years ago
|
||
(In reply to Patrick McManus [:mcmanus] from comment #18) > Andrew - I appreciate the legacy cleanup. We've got a lot of that hanging > around. You deserve an award for turning the patch series into a > choose-your-own-adventure (best-path) novel.. Thanks! And thanks for all of the reviews. I just wish I knew why it did this in the first place. ;)
Assignee | ||
Comment 21•10 years ago
|
||
(In reply to Patrick McManus [:mcmanus] from comment #19) > nit *closure not * closure.. but you're just moving the code so don't fix if > its a pain. That method actually gets deleted in the hash table conversion, so I'll just leave the * alone.
Assignee | ||
Comment 22•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?changeset=cd2da33bf4a2
Assignee | ||
Comment 23•10 years ago
|
||
This is leaking a small number of nsCStringKey and nsHashKey. That's what I get for failing to push this to try without the hash table conversion on top of it! I'm sure this will be easy to fix, so I'll look into it tomorrow.
All backed out in http://hg.mozilla.org/integration/mozilla-inbound/rev/8c20a5739d0c for leaks in mochitest-5 and crashtests
Assignee | ||
Comment 25•10 years ago
|
||
This is kind of awesome. Most hash table keys are allocated on the stack, then they get added to the hashtable, which clones the key. These two are allocated on the heap. Before my part 4 patch here, SCTableData would store a pointer to that heap allocated key, do nothing with it, until the entry went away, when it would delete the key, avoiding a leak. I removed the pointer to the key in part 4, because we never used it, so these heap allocated keys started leaking. The solution is just to not be weird and allocate them on the stack like everything else. I'll land this folded into part 4. try run is green: https://tbpl.mozilla.org/?tree=Try&rev=facff5057fe4
Attachment #8394426 -
Flags: review?(mcmanus)
Assignee | ||
Comment 26•10 years ago
|
||
Somebody went to a lot of effort to keep around pointers to these keys in SCTableData, so they must have been used at some point...
Comment 27•10 years ago
|
||
Comment on attachment 8394426 [details] [diff] [review] part 4b - Don't pointlessly create new hash table keys. Review of attachment 8394426 [details] [diff] [review]: ----------------------------------------------------------------- awesome. it's like being a forensic programmer some days.
Attachment #8394426 -
Flags: review?(mcmanus) → review+
Assignee | ||
Comment 28•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?changeset=7f9fd179263e
https://hg.mozilla.org/mozilla-central/rev/a96fc992024c https://hg.mozilla.org/mozilla-central/rev/e98833ba22bf https://hg.mozilla.org/mozilla-central/rev/951f95252494 https://hg.mozilla.org/mozilla-central/rev/c0c8ce89c57a https://hg.mozilla.org/mozilla-central/rev/f48161f34546 https://hg.mozilla.org/mozilla-central/rev/2038aa3affdc https://hg.mozilla.org/mozilla-central/rev/496288ab6f10 https://hg.mozilla.org/mozilla-central/rev/fa2ff68f86e4 https://hg.mozilla.org/mozilla-central/rev/31b7a5b5c31b https://hg.mozilla.org/mozilla-central/rev/20620ef855be https://hg.mozilla.org/mozilla-central/rev/db2568cc6e61 https://hg.mozilla.org/mozilla-central/rev/d2c6f3f8e36c https://hg.mozilla.org/mozilla-central/rev/7f9fd179263e
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•