Remove nsIBrowserHistory::count

RESOLVED FIXED in mozilla15

Status

()

Toolkit
Places
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mak, Assigned: marco)

Tracking

(Blocks: 1 bug, {addon-compat, dev-doc-complete})

Trunk
mozilla15
addon-compat, dev-doc-complete
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
.count is basically a duplicate of .hasHistoryEntries, it has never reported the actual count.  We don't need two attributes providing the same information.
(Assignee)

Comment 1

5 years ago
Created attachment 620451 [details] [diff] [review]
Patch
Attachment #620451 - Flags: review?(mak77)
(Reporter)

Comment 2

5 years ago
Comment on attachment 620451 [details] [diff] [review]
Patch

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

You should also fix call points, replacing PlacesUtils.bhistory.count with PlacesUtils.history.hasHistoryEntries.  This is what I found so far:
http://mxr.mozilla.org/mozilla-central/search?string=bhistory.count
Unfortunately sessionhistory has also a .count and is almost always called just history, so searching just for history.count generates lots of false positives due to sessionHistory.
I also tried to search for most common entries like browserHistory.count, browser_history.count, bh.count, hist.count and I couldn't find any use in add-ons mxr, so looks like there shouldn't be much trouble in the removal.

Once these are fixed will be worth to make a tryrun to check for eventual other call points.
Attachment #620451 - Flags: review?(mak77)
(Reporter)

Updated

5 years ago
Assignee: nobody → mar.castelluccio
Status: NEW → ASSIGNED
(Assignee)

Comment 3

5 years ago
Created attachment 620776 [details] [diff] [review]
Patch v2

Try: https://tbpl.mozilla.org/?tree=Try&rev=7aa2e9385e09
Attachment #620451 - Attachment is obsolete: true
(Reporter)

Updated

5 years ago
Keywords: addon-compat
(Assignee)

Comment 4

5 years ago
I think we can land it now, as the failures seems unrelated. Do you agree?
(Reporter)

Comment 5

5 years ago
Comment on attachment 620776 [details] [diff] [review]
Patch v2

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

yep, though this needs SR cause of the idl change.
Attachment #620776 - Flags: superreview?(gavin.sharp)
Attachment #620776 - Flags: review+
Comment on attachment 620776 [details] [diff] [review]
Patch v2

Any idea what the potential add-on impact will be? It looks like we had no in-tree callers (outside of tests), so I imagine it should be minimal?
Attachment #620776 - Flags: superreview?(gavin.sharp) → superreview+
(Reporter)

Comment 7

5 years ago
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #6)
> Comment on attachment 620776 [details] [diff] [review]
> Patch v2
> 
> Any idea what the potential add-on impact will be? It looks like we had no
> in-tree callers (outside of tests), so I imagine it should be minimal?

I didn't find any caller in addons mxr, though as I said in comment 2 it's hard to search cause sessionhistory is often called history, and there are many history.count (I checked most of those and were all about sessionhistory).
(Reporter)

Comment 8

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/790a7f291c9d
Target Milestone: --- → mozilla15
(Reporter)

Updated

5 years ago
Keywords: dev-doc-needed
https://hg.mozilla.org/mozilla-central/rev/790a7f291c9d
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Doc updated:

https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIBrowserHistory

Listed on Firefox 15 for developers.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.