Closed Bug 1280357 Opened 8 years ago Closed 8 years ago

Update browser.history.onVisited to not call PlacesUtils.promisePlaceInfo

Categories

(WebExtensions :: Untriaged, defect, P1)

defect

Tracking

(firefox50 fixed)

RESOLVED FIXED
mozilla50
Iteration:
50.1 - Jun 20
Tracking Status
firefox50 --- fixed

People

(Reporter: bsilverberg, Assigned: bsilverberg)

References

Details

(Whiteboard: [history]triaged)

Attachments

(1 file, 1 obsolete file)

It was suggested that it is too expensive/degrading of performance to call PlacesUtils.promisePlaceInfo for every visit, so the code in the observer should be changed to not call PlacesUtils.promisePlaceInfo but rather attempt to wait for a notification of `onTitleChanged` and use the title from that to provide data for onVisited.
Assignee: nobody → bob.silverberg
Status: NEW → ASSIGNED
Iteration: --- → 50.1
Priority: -- → P1
Whiteboard: [history]triaged
Waiting for `onTitleChanged` is not helpful. Chrome does not provide the title in cases where it isn't already known, so we shouldn't either.
That's true. So we should still track titles of known pages via onTitleChanged, and then use those values if they are known when onVisit fires?
Removing the call to PlacesUtils.promisePlaceInfo and just returning an empty title.

Review commit: https://reviewboard.mozilla.org/r/59486/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/59486/
Attachment #8763188 - Flags: review?(aswan)
Let's leave this as-is until we decide what we're going to do next. We just need to make sure to deal with it before the next merge.
Attachment #8763188 - Flags: review?(aswan) → review+
Comment on attachment 8763188 [details]
Bug 1280357 - Update browser.history.onVisited to not call PlacesUtils.promisePlaceInfo,

https://reviewboard.mozilla.org/r/59486/#review56564

::: browser/components/extensions/ext-history.js:105
(Diff revision 1)
>        onVisit: function(uri, visitId, time, sessionId, referringId, transitionType, guid, hidden, visitCount, typed) {
> -        PlacesUtils.promisePlaceInfo(guid).then(placeInfo => {
> -          let data = {
> +        let data = {
> -            id: guid,
> +          id: guid,
> -            url: uri.spec,
> +          url: uri.spec,
> -            title: placeInfo.title,
> +          title: "",

Chrome documents title as an optional property, why don't we just omit it here?
Depends on: 1280601
Comment on attachment 8763188 [details]
Bug 1280357 - Update browser.history.onVisited to not call PlacesUtils.promisePlaceInfo,

We're going to approach this differently.
Attachment #8763188 - Attachment is obsolete: true
Kris, I'm only here for the next few days, and then off until Aug. 8th. We said that we didn't want this code to make it into 50, so here are some suggestions:

1. I can just add back in a patch which removes the call to promisePlaceInfo and returns "" for the title, and then we can fix the title issue after bug 1280601 lands.
2. If you can land bug 1280601 in the next couple of days I can update this to use the title from the event.
3. I can do nothing and leave it in your hands to both land bug 1280601 and update this code before the merge.

I think 1 is safest, and least demanding of your time, right now, but let me know what you think we should do.
Flags: needinfo?(kmaglione+bmo)
Comment on attachment 8772575 [details]
Bug 1280357 - Update browser.history.onVisited to not call PlacesUtils.promisePlaceInfo,

https://reviewboard.mozilla.org/r/65332/#review62648
Attachment #8772575 - Flags: review?(kmaglione+bmo) → review+
Thanks Kris.
Flags: needinfo?(kmaglione+bmo)
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/17409ee90c86
Update browser.history.onVisited to not call PlacesUtils.promisePlaceInfo, r=kmag
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/17409ee90c86
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: