Closed
Bug 952660
Opened 11 years ago
Closed 11 years ago
Simplify control flow in nsXPCWrappedJS::GetNewOrUsed
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: mccr8, Assigned: mccr8)
Details
Attachments
(8 files)
1.94 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
1.82 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
2.62 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
945 bytes,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
1.08 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
3.55 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
1.06 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
1.58 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
Lot of gotos in there.
Assignee | ||
Comment 1•11 years ago
|
||
try run: https://tbpl.mozilla.org/?tree=Try&rev=20caa5300e5e The trickiest thing the goto in GetNewOrUsed does is release clazz in some cases, so using a smart pointer will simplify things.
Attachment #8351197 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8351198 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 3•11 years ago
|
||
Substitute in the tail of the function for each goto, then eliminate the resulting branches where possible.
Attachment #8351199 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8351200 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8351201 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 6•11 years ago
|
||
FindInherited is only ever used after running Find, and the way the checks are chained is a little weird.
Attachment #8351202 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 7•11 years ago
|
||
We check for root, then don't change root and check for !root, so this can just be an else.
Attachment #8351203 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 8•11 years ago
|
||
A non-root wrapper has to be inserted into the list. There's only one place this is needed, but I think it makes more sense like this.
Attachment #8351204 -
Flags: review?(bobbyholley+bmo)
Comment 9•11 years ago
|
||
Comment on attachment 8351197 [details] [diff] [review] part 1 - Use smart pointer for clazz in nsXPCWrappedJS::GetNewOrUsed. Could you rename clazz to clasp while you're at it? Doing it in a followup patch is fine.
Attachment #8351197 -
Flags: review?(bobbyholley+bmo) → review+
Updated•11 years ago
|
Attachment #8351198 -
Flags: review?(bobbyholley+bmo) → review+
Updated•11 years ago
|
Attachment #8351199 -
Flags: review?(bobbyholley+bmo) → review+
Updated•11 years ago
|
Attachment #8351200 -
Flags: review?(bobbyholley+bmo) → review+
Updated•11 years ago
|
Attachment #8351201 -
Flags: review?(bobbyholley+bmo) → review+
Updated•11 years ago
|
Attachment #8351202 -
Flags: review?(bobbyholley+bmo) → review+
Updated•11 years ago
|
Attachment #8351203 -
Flags: review?(bobbyholley+bmo) → review+
Comment 10•11 years ago
|
||
Comment on attachment 8351204 [details] [diff] [review] part 8 - Insert non-root wrappers into the list in the constructor for nsXPCWrappedJS. Review of attachment 8351204 [details] [diff] [review]: ----------------------------------------------------------------- Nice.
Attachment #8351204 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Thanks for the reviews! https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?changeset=bd14c8ecd480 I added the clazz -> clasp rename as part 9: https://hg.mozilla.org/integration/mozilla-inbound/rev/bd14c8ecd480
https://hg.mozilla.org/mozilla-central/rev/22d4298df5ce https://hg.mozilla.org/mozilla-central/rev/ac58b9be41b1 https://hg.mozilla.org/mozilla-central/rev/38dcdb7bef22 https://hg.mozilla.org/mozilla-central/rev/aaed859bdda9 https://hg.mozilla.org/mozilla-central/rev/c2d39db1260a https://hg.mozilla.org/mozilla-central/rev/d58e0d23b28e https://hg.mozilla.org/mozilla-central/rev/a6163494c298 https://hg.mozilla.org/mozilla-central/rev/9f773778b44f https://hg.mozilla.org/mozilla-central/rev/bd14c8ecd480
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in
before you can comment on or make changes to this bug.
Description
•