Closed
Bug 753277
Opened 12 years ago
Closed 12 years ago
Refactor transplant code and improve comments
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: bholley, Assigned: bholley)
Details
Attachments
(6 files, 1 obsolete file)
10.89 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
3.02 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
3.02 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
3.60 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
1.31 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
12.37 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
Some of this stuff is more confusing than it needs to be. I'm about to fix a bug in this stuff (I think), and I felt like clarifying some things first. Patches soon.
Assignee | ||
Comment 1•12 years ago
|
||
Attaching a patch. Flagging mrbkap for review.
Attachment #622351 -
Flags: review?(mrbkap)
Comment 2•12 years ago
|
||
Comment on attachment 622351 [details] [diff] [review] Factor out CCW remapping from JS_TransplantObject and add comments. v1 Review of attachment 622351 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsapi.cpp @@ +1516,5 @@ > + * identities by altering wrappers. > + * > + * The |origobj| argument should be the object whose identity needs to be > + * remapped, usually to another compartment. The contents of |origobj| are > + * destroyed, unless |origobj == target|. Here and below, you refer to the |origobj == target| case, while it's now been outlawed (in favor of JS_RefreshCrossCompartmentWrappers). @@ +1544,4 @@ > JSCompartment *destination = target->compartment(); > WrapperMap &map = destination->crossCompartmentWrappers; > Value origv = ObjectValue(*origobj); > JSObject *obj; Is there anything we can do about this name? I could never think of anything better here, but |obj| is pretty generic, especially in the face of |origobj| and |target|... Perhaps |newObj|?
Attachment #622351 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Blake Kaplan (:mrbkap) from comment #2) > Is there anything we can do about this name? I could never think of anything > better here, but |obj| is pretty generic, especially in the face of > |origobj| and |target|... Perhaps |newObj|? newIdentity. I'm making that a separate patch with r=mrbkap. Let me know if you disagree. ;-)
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #622351 -
Attachment is obsolete: true
Attachment #623073 -
Flags: review+
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #623074 -
Flags: review+
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #623076 -
Flags: review?(mrbkap)
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #623077 -
Flags: review?(mrbkap)
Assignee | ||
Comment 8•12 years ago
|
||
It's not wrong, but it's not necessary either, since we'll just unwrap directly to the underlying object during wrapping. And this is confusing enough as-is.
Attachment #623078 -
Flags: review?(mrbkap)
Assignee | ||
Comment 9•12 years ago
|
||
The reindentation is pure. No snakes.
Attachment #623079 -
Flags: review?(mrbkap)
Comment 10•12 years ago
|
||
Comment on attachment 623078 [details] [diff] [review] Part 5 - Rename tobj to wrapperGuts, and avoid going through the SCSW on the other side unnecessarily. v1 Review of attachment 623078 [details] [diff] [review]: ----------------------------------------------------------------- Only the rename happened, no?
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Ms2ger from comment #10) > Only the rename happened, no? No, it's subtle. Note that we previously were pointing to newWrapper, and now we point to targetobj.
Updated•12 years ago
|
Attachment #623076 -
Flags: review?(mrbkap) → review+
Updated•12 years ago
|
Attachment #623077 -
Flags: review?(mrbkap) → review+
Updated•12 years ago
|
Attachment #623078 -
Flags: review?(mrbkap) → review+
Comment 12•12 years ago
|
||
Comment on attachment 623079 [details] [diff] [review] Part 6 - Assert that all cross-scope wrapper reparenting operations are cross-compartment, and remove the conditional. v1 A diff -w would have been nice here.
Attachment #623079 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 13•12 years ago
|
||
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=1e91648bba69
Assignee | ||
Comment 14•12 years ago
|
||
Looks green. Pushed to m-i: http://hg.mozilla.org/integration/mozilla-inbound/rev/6678097e44e5 http://hg.mozilla.org/integration/mozilla-inbound/rev/86ce1810ab6f http://hg.mozilla.org/integration/mozilla-inbound/rev/2330abd18337 http://hg.mozilla.org/integration/mozilla-inbound/rev/d3af846d8bc9 http://hg.mozilla.org/integration/mozilla-inbound/rev/2d846fdb9ddc http://hg.mozilla.org/integration/mozilla-inbound/rev/a8bdf0315130
Target Milestone: --- → mozilla15
Comment 15•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a8bdf0315130 https://hg.mozilla.org/mozilla-central/rev/2d846fdb9ddc https://hg.mozilla.org/mozilla-central/rev/d3af846d8bc9 https://hg.mozilla.org/mozilla-central/rev/2330abd18337 https://hg.mozilla.org/mozilla-central/rev/86ce1810ab6f https://hg.mozilla.org/mozilla-central/rev/6678097e44e5
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•