Commit graph

274 commits

Author SHA1 Message Date
Paolo Amadini
ac30ebecfa Bug 1370652 - Handle more rejections in code exercised by browser-chrome tests. r=Mossop
These fixes are in preparation of making browser-chrome tests fail when there are unhandled Promise rejections.

MozReview-Commit-ID: JTMgC2XwzX2

--HG--
extra : rebase_source : 4d0b0465641b2286d01f872b0cf8052af5573939
extra : amend_source : 75dacab1ff06bcab2a05e6e744845b151f97d06c
extra : intermediate-source : 047e38fdb0c889e7e7dc0c2cd5a4e6dc6aa7fe22
extra : source : b59573695517b2a464f22e00bd3792c50dcf371a
2017-06-06 21:15:42 +01:00
Joel Maher
b44356bc28 Bug 1368364 - backout bug 1242505 as it causes browser/modules/ intermittent failures. r=paolo 2017-06-03 10:34:14 +02:00
Julian Descottes
d94844731c Bug 1366823 - Use DevToolsShim to call Scratchpad APIs from SessionStore.jsm;r=mikedeboer
DevTools are moving out of mozilla-central and m-c code should only rely on the
DevToolsShim that will remain available in m-c after the migration.
This changeset updates SessionStore.jsm to call the DevToolsShim instead of the
scratchpadmanager.

The actual underlying implementation is the same when devtools are installed and
no-ops when they are not.

MozReview-Commit-ID: Fv22TtjJiDw

--HG--
extra : rebase_source : eb051a1612598eb3ca11cff8be92f55f5cb3f7ca
2017-05-24 20:50:23 +02:00
Paolo Amadini
0369d7414c Bug 1242505 - Part 1 - Handle more rejections in code exercised by browser-chrome tests. r=Mossop
MozReview-Commit-ID: JTMgC2XwzX2

--HG--
extra : rebase_source : 279cabcd658b3877a8501df382804ae5fa7aa1fc
extra : source : b59573695517b2a464f22e00bd3792c50dcf371a
2017-05-25 15:00:22 +01:00
Sebastian Hengst
877985ac99 Backed out changeset b59573695517 (bug 1242505) 2017-05-28 11:31:22 +02:00
Paolo Amadini
6886a4fb81 Bug 1242505 - Part 1 - Handle more rejections in code exercised by browser-chrome tests. r=Mossop
MozReview-Commit-ID: JTMgC2XwzX2

--HG--
extra : rebase_source : 83a77cbfe5629abe99ae575b57592361ea9627b8
2017-05-25 15:00:22 +01:00
Kevin Jones
dc64c827ef Bug 1365933 - Don't attempt to access tabData.entries value when tabData.entries is nonexistent or empty. r=mikedeboer
--HG--
extra : rebase_source : 59dff50d78c121f5d9a1519c76c298e749331c99
2017-05-22 08:33:29 -06:00
Dão Gottwald
5675800b1d Bug 1365780 - Consistently dispatch the TabAttrModified event and update the title bar when setting tab labels. r=mikedeboer
MozReview-Commit-ID: 1SNHtyw5hQ8

--HG--
extra : rebase_source : ab9176f3a90531f57a448f2661fa0b70e48d4f7a
2017-05-19 14:19:06 +02:00
Bob Owen
d0c57d84c1 Bug 1351358 Part 2.5: Move logic in the parent for switching in and out of Large Allocation process into browser.js RedirectLoad. r=mystor
This fixes a bug where we swap out of the Large Allocation process, when reloaded via the UI.
2017-05-18 12:08:56 +01:00
Bob Owen
47421837bf Bug 1351358 Part 2: Limit the http pages that will load in the file content process with allowLinkedWebInFileUriProcess pref. r=Gijs, r=mystor
This change means that any related http pages driven through content (window.open, links, etc.) will continue to be loaded in the file content process.
Same-origin loads via the UI will also remain in the file content process.
Cross-origin loads via the UI will cause a process switch.
History navigation will stay in the process, if it was originally loaded in that process.
2017-05-18 12:08:56 +01:00
Matheus Longaray
2ad6b7785b Bug 1364483 - Take customizemode attribute into account when saving tabs to disk. r=mikedeboer
This patch adds customizemode attribute data validation when saving tabs to disk.

MozReview-Commit-ID: 2GFXpApi0iQ

--HG--
extra : rebase_source : ce82001fbdabfda88621277fa750d60c8f1ccd6b
2017-05-15 13:21:54 -03:00
Carsten "Tomcat" Book
c60f5362f4 Backed out changeset 888dc371081a (bug 1347791) 2017-05-17 08:11:05 +02:00
Alastor Wu
a483732a11 Bug 1347791 - part4 : keep tab's block state consistent after session restore. r=mikedeboer
If the tab was resumed before, it could start playing any autoplay media without user's
permission after session restore.

MozReview-Commit-ID: C3DHIIsLtJA

--HG--
extra : rebase_source : 9517525aa242bff3150a902070544cf64c5ba6c1
2017-05-17 11:56:10 +08:00
Dão Gottwald
17f07e92b9 Bug 1364516 - Move gCustomizeMode.setTab call out of updateTabLabelAndIcon. r=mikedeboer
While setTab does end up setting the label and icon, it also does completely different and more crucial things. This call really doesn't belong in updateTabLabelAndIcon.

MozReview-Commit-ID: 1ZSY17ThNx

--HG--
extra : rebase_source : 7406be1314e50665b2a4aa612916e93846ac32f1
2017-05-15 18:52:34 +02:00
Sebastian Hengst
c06df98c46 Backed out changeset b96483ca2c27 (bug 1364516) for failing mochitest browser/components/customizableui/test/browser_exit_background_customize_mode.js and eslint failure at SessionStore.jsm:3696:7 | 'win' is not defined. r=backout 2017-05-15 15:19:07 +02:00
Dão Gottwald
be99777e74 Bug 1364516 - Move gCustomizeMode.setTab call out of updateTabLabelAndIcon. r=mikedeboer
While setTab does end up setting the label and icon, it also does completely different and more crucial things. This call really doesn't belong in updateTabLabelAndIcon.

MozReview-Commit-ID: 9HXYS0fXgRN

--HG--
extra : rebase_source : f11e283bdc487f8df4ba8013f420158b6f356dbe
2017-05-12 19:52:04 +02:00
Dão Gottwald
569c55f5cb Bug 1364127 - Set the initial tab label to the URL for new tabs and to the saved title for restored tabs, and make sure that label doesn't subsequently get clobbered with a placeholder r=past
MozReview-Commit-ID: 9t07uAVE13H

--HG--
extra : rebase_source : c3e317bf0d149593b5a5119a878be96ef36b81db
2017-05-12 13:35:44 +02:00
Florian Quèze
5e3539e504 Bug 1353542 - massive script-generated patch converting Task.async and Task.spawn calls, and generators clearly identifiable as tasks, rs=Mossop. 2017-05-12 14:42:39 +02:00
Kevin Jones
1adb35ba38 Bug 1360932 - Registered lazy tabs as switch-to-tab candidates. r=dao
MozReview-Commit-ID: 323l6pHQQAT
2017-05-12 05:34:43 +02:00
Panos Astithas
1190c6b247 Don't show 'Connecting' and 'Loading' labels in tab while loading pages (bug 1359352). r=dao
MozReview-Commit-ID: HMs0ri5kLw3

--HG--
extra : rebase_source : 62c26dda6dc08ae65789bb5536228a9c39e66ee8
2017-05-05 16:52:03 +03:00
Dão Gottwald
782bcc8ba0 Bug 1362595 - Clean up handling of hidden tabs in restoreWindow. r=mikedeboer
restoreWindow only opens new tabs rather than re-use pre-existing tabs, so
there's no point in calling showTab anymore. hideTab also will not hide the
selected tab, so the "all tabs to be restored are hidden" case can't happen.

MozReview-Commit-ID: FzmRcjprkuN

--HG--
extra : rebase_source : 9e7bbdb4c56220b148636e332c4d518b46c71a37
2017-05-06 01:20:29 +02:00
Dão Gottwald
39669a550b Bug 1054740 - Stop reusing tabs when restoring windows since at this point it's counterproductive rather than a useful optimization. r=mikedeboer
MozReview-Commit-ID: EuM08mEhDqZ

--HG--
extra : rebase_source : 43fc0410045f0efe48db2ae14d56994a90bded5f
2017-05-04 14:26:32 +02:00
Sebastian Hengst
532800137b Backed out changeset db9f3b377504 (bug 1054740) for failing Marionette's test_prefs.py TestPreferences.test_clear_pref, at least on Linux in non-e10s mode. r=backout on a CLOSED TREE 2017-05-03 23:15:56 +02:00
Wes Kocher
4e89a77541 Merge m-c to autoland, a=merge
MozReview-Commit-ID: F7qkNALe0WT
2017-05-03 13:52:24 -07:00
Dão Gottwald
1d352d917c Bug 1054740 - Stop reusing tabs when restoring windows since at this point it's counterproductive rather than a useful optimization. r=mikedeboer
MozReview-Commit-ID: LhJDs9GSxuK

--HG--
extra : rebase_source : 96cb427ada78ee70368f6cb1d4cad4811681c454
2017-05-03 21:57:06 +02:00
Sebastian Hengst
76d0313771 Backed out changeset 43f195f28f6a (bug 1054740) for failing test_quit_restart.py TestQuitRestart.test_in_app_restart_with_callback in Mn-e10s on OSX 10.10 opt. r=backout 2017-05-03 18:50:18 +02:00
Dão Gottwald
b5ee7d0b7b Bug 1054740 - Stop reusing tabs when restoring windows since at this point it's counterproductive rather than a useful optimization. r=mikedeboer
MozReview-Commit-ID: EgninUdUHir

--HG--
extra : rebase_source : cd5460a09d8e5918a17d964e520d7500348d9a4e
2017-05-03 11:19:31 +02:00
Tim Taubert
c9074e0e0a Bug 1360916 - Update telemetry code in sessionstore content script r=mikedeboer data-r=bsmedberg
This patch replaces FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS with
a more fine-grained data collection via a keyed histogram so that we can
determine which type of data collection we spend a lot of time on.

Additionally, it abandons sending telemetry data from the content to the parent
via custom messages and instead uses the Telemetry service directly. Thus it
also gets rid of a bug that currently overrides measurements for the same
histogram done quickly in succession
2017-05-03 12:06:34 +02:00
Sebastian Hengst
d462b93aeb Backed out changeset ec64ea9b1249 (bug 1360916) for failing browser_sessionStorage_size.js. r=backout 2017-05-03 00:25:07 +02:00
Tim Taubert
142cf6d7de Bug 1360916 - Update telemetry code in sessionstore content script r=mikedeboer data-r=bsmedberg
This patch replaces FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS with
a more fine-grained data collection via a keyed histogram so that we can
determine which type of data collection we spend a lot of time on.

Additionally, it abandons sending telemetry data from the content to the parent
via custom messages and instead uses the Telemetry service directly. Thus it
also gets rid of a bug that currently overrides measurements for the same
histogram done quickly in succession.
2017-05-02 23:22:45 +02:00
Tim Taubert
ed341f2836 Bug 1360810 - Add telemetry for session restore privacy levels chosen by users r=mikedeboer data-r=bsmedberg 2017-05-02 11:10:41 +02:00
Kevin Jones
fe32690b63 Bug 1360239 - Explicitly make pinned tabs nonlazy. r=dao
MozReview-Commit-ID: 7fOboqJamqE
2017-04-28 09:08:38 +02:00
Kevin Jones
0b02063268 Bug 1358735 - Ensure userContextId is always set in TabStateCache. r=mikedeboer
--HG--
extra : amend_source : d5a2d35fa588876f88785d57db1a4b0b2da16926
2017-04-25 04:54:00 -04:00
Mike Conley
36ea32d206 Bug 1357098 - Fix off-by-one error in SessionStore when preparing deferred restore data. r=mikedeboer
Bug 588482 made it possible to restore pinned tabs in windows before restoring the rest of the
tabs. Part of this involves extracting the pinned tab data from the last session, and make it
the default state to restore. The rest can be restored later.

If one of the pinned tabs in a window were selected, the code that was preparing the default
state for that window set the selection value by calculating the length of the tabs array
(before adding the selected one), and adding 2. Presumably, 1 count is because of the tab
we're about to add, and another count is due to how the "selected" value in SessionStore
is 1-indexed (where "0" means, "don't change the selection").

This is an off-by-one error though, since the tabs array length already cancels out the
need for the extra "1-index" difference. It is sufficient to just add 1 to the length of
the tabs array to calculate the selected value.

This appears to have been a bug for a while, but was covered up by the fact that the old
tab selection code exited early if the 0-indexed value of the selected tab was not within
the length of the tabs array. Bug 1351677 uncovered this bug by removing that second check.

This patch fixes the off-by-one error, and also puts a check back in to ensure that the tab
we're going to select is at a valid index.

MozReview-Commit-ID: 9WbbU0vUJHG

--HG--
extra : rebase_source : cd5f4432c23084b672a844da40879bf53e393596
2017-04-25 18:03:12 -04:00
Tim Taubert
88d5807434 Bug 1359429 - Remove superfluous telemetry probes r=mikedeboer f=bsmedberg
FX_SESSION_RESTORE_COLLECT_DATA_LONGEST_OP_MS can go because that's exactly the same as FX_SESSION_RESTORE_COLLECT_DATA_MS now.

We can remove FX_SESSION_RESTORE_COLLECT_COOKIES_MS because that's just a flat line since bug 912717 landed.
2017-04-25 21:48:22 +02:00
Gabor Krizsanits
b007d78f5d Bug 1352961 - P2: Measure for the delay before a new tab starts processing the first URL. r=mconley, data-r=bsmedberg
Opening pages in a new tab might suffer an extra delay from e10s-multi because
the new process has to start up and then run all the process / frame scripts
before it can react on the request from the parent to load the first page.

There are two code paths. Either we start the tab with a remote browser and
then the RemoteWebNavigation will send the request. Or we start with a non-remote
browser and have to change the remoteness flag on it, and then the SessionStore
will send the request.

In each cases we start the timer on the parent side, send it with the message,
and when the child receives it it stops the timer and reports the measured delay.
2017-04-25 17:11:12 +02:00
Kevin Jones
a7fa6eb9b7 Bug 1345090 - Modify SessionStore to restore tabs with lazy browsers. r=mikedeboer,dao
MozReview-Commit-ID: 5J5UqlWMxKX
2017-04-20 11:01:09 +02:00
Florian Queze
f935ddc4b3 Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, r=jaws. 2017-04-14 21:51:39 +02:00
Florian Queze
37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Sebastian Hengst
738d097aae Backed out changeset 55f3df15eaa6 (bug 1356569) 2017-04-14 23:39:17 +02:00
Florian Queze
3c564a2b02 Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, r=jaws. 2017-04-14 21:51:39 +02:00
Florian Queze
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Michael Layzell
149f41856d Bug 1353844 - Part 2: Send permissions to the content process before restoring SessionStorage, r=mikedeboer
MozReview-Commit-ID: 3oyQfHdls2
2017-04-12 11:54:41 -04:00
Tim Taubert
afed0705da Bug 912717 - Don't let SessionCookie collection jank the chrome process r=mikedeboer
Current state:
--------------

Session cookies - those that have no Expires or Max-Age directive, sent as a
header or set via document.cookie - are meant to live for the duration of a
session. SessionStore is a feature that aims to enable users to resume where
they left off last time they closed the browser. So SessionStore will persist
and restore those cookies that the cookie service only keeps in memory.

SessionCookies.jsm registers observers with the cookie service and is thus
notified of cookie additions, deletions, and modifications as-it-happens. It
has its own internal storage that we could easily serialize and write to disk
together with the rest of the session data.

The hangs shown in various profiles stem from the fact that since the inception
of SessionStore as an add-on around Firefox 2, cookies have been tacked to
windows. This means that whenever we collect session data for a specific
window (i.e. tabs, their shistory entries, etc.) we have to iterate *all* its
tabs and *all* their shistory entries to enumerate the hosts contained in that
window. We will then ask the internal cookie store in SessionCookies.jsm to
give us all cookies for these hosts and then store them together with the
window. This way we filter out cookies from tabs/hosts that have no active
documents (BFCache counts as "active").

Changes in this patch:
----------------------

Instead of trying to only retain cookies from “active” documents, i.e. those
contained somewhere in the shistory of a tab, we now simply save all session
cookies of the session. This will surely reduce user complaints about us
"logging them out" too fast because we discard cookies from tabs they
open only once in a while, although those definitely belong to the
browsing session.

Instead of storing the cookies per each window we now have a top-level
"cookies" attribute that is a list of cookies. These get restored whenever we
restore a session. Legacy window.cookies attributes will still be restored to
support older session formats for a while.

The DEFER_SESSION startup mode is active by default when a user choses not to
restore their whole session automatically but they still have one or more
pinned tabs. These pinned tabs are restored automatically and split off of the
rest of the session. The rest can be restored manually if the user chooses to
do so.

In the past, we here extracted and restored only the pinned tabs' cookies from
the last session. This filtering also works against how some sites (e.g.
Google) use session cookies. It also means we have to iterate all windows,
tabs, shistory entries, and cookies to find the data we want.

This patch changes our past behavior so that we now restore only pinned tabs
but all session cookies. So we don't have to filter, and pages will break less
likely. We hereby assume that a user having pinned tabs wants to continue their
browsing session partially, although without Firefox remembering the exact list
of tabs. Or they simply like starting off of a clean slate.
2017-04-07 14:41:38 +02:00
Mike Conley
32226bd237 Bug 1351677 - When restoring a window, swap the initially selected tab with the desired selected tab instead of tab switching. r=mikedeboer
When restoring a window, it's cheaper if we move the initially selected tab to the
index of the tab that's supposed to be selected in the restored state, rather than
switching to that tab.

If it turns out that moving that tab is not possible (if, for example, the user
context IDs of the two tabs to swap don't match, since the userContextIds are
set at tab construction time), then we fall back to tab switching.

MozReview-Commit-ID: L3qP40K5DaJ

--HG--
extra : rebase_source : 0954dac2f17af74418817ed45c5ab5dee7796511
2017-04-04 15:58:02 -04:00
Tim Taubert
890672d7f9 Bug 1351835 - Update PrivacyLevel.canSave() calls in SessionCookies.jsm r=mikedeboer
The first change we can make is to simplify the PrivacyLevel.canSave() method
itself as it only takes a single argument, `isHTTPS`. Callers shouldn't be
required to pass an object, they should simply pass a boolean.

The second change here is to cleanup SessionCookies.jsm that still passes the
old `isPinned` argument that's no longer needed. We can remove some house
keeping and simplify the cookie collection code.

SessionCookies.getHostsForWindow() that previously returned a map from hostnames
to a site's pinned status (tab.pinned) can now simply return a Set containing
all hostnames found in a window.
2017-03-30 13:57:42 +02:00
Tim Huang
08e052cb86 Bug 1330882 - Part 2: Disallow the session restore to modify window size when fingerprinting resistance is enabled. r=arthuredelstein,mikedeboer
MozReview-Commit-ID: F1Ray6c5dzq

--HG--
extra : rebase_source : ed299058bf6f926e5987468dcab518b110fd7220
2017-03-29 15:43:55 +08:00
Mike Conley
039c9ecb61 Bug 1096013 - Give selected tabs highest priority during restoration. r=mikedeboer
MozReview-Commit-ID: EtApFsDyB50

--HG--
extra : rebase_source : 37d0cc43801f434242b5c3a281c0ce293e1bbdff
2017-03-23 01:59:51 -04:00
Mike Conley
5fd41cbe9c Bug 1096013 - Show tab icons and titles as soon as possible instead of waiting for history restoration to complete. r=mikedeboer
MozReview-Commit-ID: EL8IcreTte2

--HG--
extra : rebase_source : cdaafcfdc4f827d4fd18a1011e3f2e91e4ed59c1
2016-04-20 17:24:24 -04:00