Closed Bug 735968 Opened 8 years ago Closed 8 years ago

PlacesUtils.history must be QI-ed before using nsPIPlacesDatabase methods

Categories

(Firefox :: Sync, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(1 file)

We were getting lucky before compartment-per-global, but now it's broken. The lazy getter only QIs to nsINavHistoryService:
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/PlacesUtils.jsm#2205

Attaching a patch. Flagging philikon for review.

Is there anywhere where this might crop up in non-test code? We _could_ always make the service getter non-lazy and explicitly QI it, but that seems ugly.
Attached patch patch. v1Splinter Review
Attachment #606080 - Flags: review?(philipp)
(FWIW this is time-sensitive, so please let me know right away if I guessed the wrong reviewer).
The module code itself does the right thing:

modules/engines/history.js
112:    let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
Comment on attachment 606080 [details] [diff] [review]
patch. v1

Review of attachment 606080 [details] [diff] [review]:
-----------------------------------------------------------------

This looks OK to me.
Attachment #606080 - Flags: review?(philipp) → review+
Pushed to m-i:

http://hg.mozilla.org/integration/mozilla-inbound/rev/39da111adaf5
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/39da111adaf5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.