Closed Bug 1022003 Opened 11 years ago Closed 11 years ago

Remove ObjectWrapper.jsm

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla33

People

(Reporter: bholley, Assigned: Gijs)

Details

(Whiteboard: [fixed-in-inbound][Memshrink:P3] p=2 s=33.1 [qa-])

Attachments

(1 file)

We deprecated ObjectWrapper.jsm, and now there are only three consumers of it in the tree. One of them doesn't use it at all, and the other just uses it for getObjectKind. We should move getObjectKind into a some other kind of utils JSM, and remove ObjectWrapper.jsm.
Did you have a place in mind where to put getObjectKind? Just directly on Cu, or somewhere else?
Flags: needinfo?(bobbyholley)
OS: Mac OS X → All
Hardware: x86 → All
(In reply to :Gijs Kruitbosch from comment #1) > Did you have a place in mind where to put getObjectKind? Just directly on > Cu, or somewhere else? No idea. It doesn't need to be on Cu certainly - it's trivially implementable in JS. Is there some sort of JSM dumping ground for utils-y things? I'm just saying that we don't need a whole global for this thing.
Flags: needinfo?(bobbyholley)
(In reply to Bobby Holley (:bholley) from comment #2) > (In reply to :Gijs Kruitbosch from comment #1) > > Did you have a place in mind where to put getObjectKind? Just directly on > > Cu, or somewhere else? > > No idea. It doesn't need to be on Cu certainly - it's trivially > implementable in JS. Is there some sort of JSM dumping ground for utils-y > things? Not that I know of. > I'm just saying that we don't need a whole global for this thing. I think the simplest thing might be to add a method to SettingsDB, considering that that's essentially where the two sole consumers live right now (and SettingsManager can call into SettingsDB).
(In reply to :Gijs Kruitbosch from comment #3) > (In reply to Bobby Holley (:bholley) from comment #2) > > (In reply to :Gijs Kruitbosch from comment #1) > > > Did you have a place in mind where to put getObjectKind? Just directly on > > > Cu, or somewhere else? > > > > No idea. It doesn't need to be on Cu certainly - it's trivially > > implementable in JS. Is there some sort of JSM dumping ground for utils-y > > things? > > Not that I know of. Well, the closest I can think of are Services and XPCOMUtils, but both of them actually have a decently-specified purpose/domain, and this method isn't a clear fit for either.
So here's what I think we should do... Try push at https://tbpl.mozilla.org/?tree=Try&rev=39d9decfed95
Attachment #8437730 - Flags: review?(bobbyholley)
Attachment #8437730 - Flags: review?(anygregor)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Comment on attachment 8437730 [details] [diff] [review] remove ObjectWrapper.jsm, Review of attachment 8437730 [details] [diff] [review]: ----------------------------------------------------------------- r=bholley with that fixed. ::: dom/base/ObjectWrapper.jsm @@ -33,5 @@ > - } else if (aObject instanceof Ci.nsIDOMFile) { > - return "file"; > - } else if (aObject instanceof Ci.nsIDOMBlob) { > - return "blob"; > - } else if (aObject instanceof Date) { Oh wow, this was totally broken - cross-global instanceof doesn't work for pure ES objects. So unless the Date object actually came from this scope (which it almost certainly didn't), this would never return "date". Can you fix up the remaining consumers to do the constructor.name check?
Attachment #8437730 - Flags: review?(bobbyholley) → review+
Comment on attachment 8437730 [details] [diff] [review] remove ObjectWrapper.jsm, Review of attachment 8437730 [details] [diff] [review]: ----------------------------------------------------------------- I thought we are using it in more places. Thanks for fixing!
Attachment #8437730 - Flags: review?(anygregor) → review+
Whiteboard: [Memshrink] → [Memshrink:P3]
(In reply to :Gijs Kruitbosch from comment #5) > Created attachment 8437730 [details] [diff] [review] > remove ObjectWrapper.jsm, > > So here's what I think we should do... Try push at > https://tbpl.mozilla.org/?tree=Try&rev=39d9decfed95 Well, that was dumb. Let's try with actually removing the Cu.import call... https://tbpl.mozilla.org/?tree=Try&rev=4849f975f577
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/bb9ca4ddc79e Marco, can you add this one as well, please? :-)
Flags: needinfo?(mmucci)
Flags: firefox-backlog+
Whiteboard: [Memshrink:P3] → [fixed-in-inbound][Memshrink:P3][qa-] p=2
Added to Iteration 33.1
Flags: needinfo?(mmucci)
Whiteboard: [fixed-in-inbound][Memshrink:P3][qa-] p=2 → [fixed-in-inbound][Memshrink:P3] p=2 s=33.1 [qa-]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: