nsISHEntry's attributes and methods are thoroughly mixed. This patch separates
them, making it easier to understand.
--HG--
extra : rebase_source : 8a7822b5289fbb67e74dfa3cb42aa31206ee0e16
Both nsISHEntry.URI and nsISHEntry isSubFrame are readonly, but also have a
setter. This is silly, so this patch removes the setter and makes them
modifiable.
The patch also renames nsISHEntry.setAsHistoryLoad() as setLoadTypeAsHistory(),
which makes it clearer that it modifies the loadType attribute.
--HG--
extra : rebase_source : 7772e2c1d90d4fd9f462f20c777d6eacc65801c5
By marking some C++-only nsISHistory methods as [noscript] or [noscript,
notxpcom].
--HG--
extra : rebase_source : 1216e755a227fd13f01057afd71ea082a2a79ad7
The patch also removes some NS_ENSURE_ARG_POINTER checks from these attributes'
getters. Most of these getters already lack such checks, and as long as the
infallible getters are used a non-null pointer is guaranteed. In the worst case
we'll safely null-crash anyway.
--HG--
extra : rebase_source : 87d4f7fccfa7ffb605c514cf8c2abd270a13b24a
- Move VIEWER_WINDOW from nsISHistory to nsSHistory.
- Mark some C++-only nsISHistory methods as [noscript, notxpcom].
- Add gotoIndex() to nsISHistory so that LegacySHistoryImpl() can be removed.
--HG--
extra : rebase_source : c33081d527af6f9697fad095d24824fc4d451f4d
nsISHistoryListener can cancel several operations, but the functionality is
only ever used for OnHistoryReload(). So this patch removes it for the other
operations.
--HG--
extra : rebase_source : 433422e9160f7d645570baaaff4779c4bcc3ec04
This patch:
- removes GetTransactionAtIndex(), because getTransactionAtIndex() can be used
instead;
- renames a lot of things;
- updates some comments.
--HG--
extra : rebase_source : 845a1c1d5fe7f84eaa03db39a344d98fd5784afd
nsISHEntry.index is readonly, but if you pass `true` as getEntryAtIndex()'s
second argument, nsISHEntry.index will be modified. This is pretty gross.
This patch changes `index` so it's not readonly (because it's not!) and removes
getEntryAtIndex()'s second argument.
--HG--
extra : rebase_source : c519d77fcc1c3bda2f260b5888ce9cd0f6cfdab5
Because it's a wafer-thin wrapper around nsISHEntry that just complicates
things.
This patch leaves behind a combination of "entry" and "transaction"
terminology. I'll fix that in a subsequent patch.
--HG--
extra : rebase_source : ca15187447bf3d93c65ed3980ead5bca958471be
Specifically:
- Check the nsresult consistently, but don't check (unnecessarily) for null on
success.
- In AddEntry(), move GetTransactionAtIndex() before all state-changing
operations, so we don't end up with partial state updates upon failure.
- Use early returns to reduce indenting.
--HG--
extra : rebase_source : 17815f6813f024fae1cf4ec3cf1b7985ab7a2ff2
In practice it's always non-null, and only half the places that deal with it
have null handling code. So this simplifies things.
--HG--
extra : rebase_source : 250b286b6b2c10aeb0c4486ebe13b1e071bf6c8a
It was used to protect against changes in mIndex by history listeners, but the
new code structure doesn't need it, because we want to use mIndex afterwards.
--HG--
extra : rebase_source : 74f0cc7f696b101b8e9d699790f2f2c141c5f51b
nsSHistory currently implements nsIWebNavigation, but only three of the methods
are actually used, and the rest call MOZ_CRASH. This patch removes the
inheritance and changes the implementations of those three methods (Reload(),
GetCurrentURI(), and GotoIndex()) to pure C++.
There is one test, bug662200_window.xul, that calls Reload() from JS, which is
no longer possible. Fortunately, nsSHistory::ReloadCurrentEntry() -- which *is*
available from JS -- is similar enough to Reload(0) that it can be used
instead.
(The only difference between Reload(0) and ReloadCurrentEntry() is that the
former triggers the `OnHistoryReload` notification and the latter triggers
`OnHistoryGotoIndex`, which doesn't matter for this test.)
--HG--
extra : rebase_source : 69dba04f14b1438f50f597f3d16b77225795f8a7
The only ones that are reachable are GotoIndex(), GetCurrentURI(), and
Reload(). This patch makes all the others crash.
Note that the reason that Go{Back,Forward}() are unreachable is because of this
behaviour in ChildHistory::Go():
// XXX(nika): Should we turn Go(-1) and Go(1) to call GoForward and GoBack?
// They technically fire different change events but I couldn't find anyone
// who cares, so I'm inclined not to.
I.e. those functions are now subsumed by GotoIndex().
As for CanGo{Back,Forward}(), a try push plus code inspection confirm that they
are unused.
--HG--
extra : rebase_source : 6509e635478f257be1271b51d352e0a9d81899ec
(It's worth noting that I had to fix one of these instances in the previous
patch, by adding a -1.)
--HG--
extra : rebase_source : ea45cd7dc59b6649f1b46a2c917def79538fcbe8
- nsISHistoryInternal loses `rootTransaction`, and gains
GetTransactionAtIndex(). (The implementing class `nsSHistory` already
implemented a method by that method.)
- nsSHistory loses `mListRoot` in favour of `mTransactions`. It also loses
`mLength`, because `mTransactions` tracks the length itself.
- nsISHTransaction.{prev,next} are no longer needed.
- nsISHTransaction.create() is no longer needed, because all it does now is set
the SHEntry, and we can use SetSHEntry() for that.
Overall this deletes about 200 lines of code.
--HG--
extra : rebase_source : eac6334b653e04634baa86a0f4e3c8f07c06e560
In order to allow JS callers to use nsISimpleEnumerator instances with the JS
iteration protocol, we'll need to additional methods to every instance. Since
we currently have a large number of unrelated implementations, it would be
best if they could share the same implementation for the JS portion of the
protocol.
This patch adds a stub nsSimpleEnumerator base class, and updates all existing
implementations to inherit from it. A follow-up will add a new base interface
to this class, and implement the additional functionality required for JS
iteration.
Differential Revision: https://phabricator.services.mozilla.com/D3725
--HG--
extra : rebase_source : ad66d7b266856d5a750c772e4710679fab9434b1
extra : histedit_source : a83ebffbf2f0b191ba7de9007f73def6b9a955b8
nsSHEntry is the only class that instantiates those two interfaces, so the
separation is not useful. This lets us remove numerous pointless QIs.
--HG--
extra : rebase_source : 570b7ade669fb89a789184198bec9da186c5f1d3
nsSHEntry is the only class that instantiates those two interfaces, so the
separation is not useful. This lets us remove several pointless QIs.
The patch also removes RemoveFromBFCache{AS,S}ync, which are unused.
--HG--
extra : rebase_source : 84db7ec180c357ab8c762dc60efb5eed444ba514
We have 2 different LoadType enums with two different values, which
have to be converted between depending on whether we're going to/from
LoadInfo/nsISHEntry/etc. We should be able to just use the same enum
everywhere and not have to deal with conversion, especially since we
don't have any type safety around the enum.
MozReview-Commit-ID: 2t9vVGLpOte
The current limit of at most one bfcache entry on Android dates back to when
Fennec was built for the Nokia N810, which had a whopping 128 MB of memory.
Since a few years have passed since then and mobile device technology has
evolved considerably, it should be safe now to allow a little more than that.
Since web sites sizes might have grown somewhat as well compared to the figure
of 4MB mentioned in CalcMaxTotalViweres(), though and to be absolutely on the
safe side, we still tweak the formula when building for Android, though.
If in the worst case even those assumptions turn out too generous, we will still
be protected by the fact that
- we temporarily disable the bfcache when the OS signals memory pressure, and
- our contentViewerTimeout is set to a lower value than on Desktop, so bfcache
entries will expire sooner
MozReview-Commit-ID: 1A6d0Q6Mdx0
--HG--
extra : rebase_source : 9cc1f7abb1aef82ffc4d7987773ae7cf35440884