Commit graph

887 commits

Author SHA1 Message Date
Carsten "Tomcat" Book
3a762886de Merge mozilla-central to mozilla-inbound 2017-04-07 15:33:03 +02:00
Tim Taubert
4da3a7f72e Bug 912717 - Tiny follow-up to fix ESLint bustage caused by a test file r=bustage 2017-04-07 15:09:46 +02: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
Mark Banner
92c422a2d6 Bug 1342459 - Add a rule to automatically detect ContentTask.spawn and inject the relevant globals. r=mossop
This reduces the amount of places where we need to specify the mozilla/frame-script environment. It does have
the side effect of allowing those globals in the whole file, but that is what specifying the environment would
do, and this is also for mochitest test files only.

MozReview-Commit-ID: 1LLFbn6fFJR

--HG--
extra : rebase_source : 82a6934d90bbbbd25f91b7b06bf4f9354e38865a
2017-04-05 10:00:25 +01:00
Joel Maher
16ec3a15a0 Bug 1341980 - Intermittent browser/components/sessionstore/test/browser_819510_perwindowpb.js - disable on osx. r=gbrown
MozReview-Commit-ID: J3IL8cHAmau
2017-04-06 07:29:53 -04:00
Mike Conley
e80d1e033b Bug 1351677 - Fix a race in browser_394759_purge.js. r=mikedeboer
MozReview-Commit-ID: J1z8Y5Zbwgz

--HG--
extra : rebase_source : 31cbee03b926e60f914ad2f9914ebd9bd6953c4f
2017-04-04 16:02:06 -04:00
Mike Conley
56cf3663de Bug 1351677 - Update browser_remoteness_flip_on_restore test to account for initial tab swapping. r=mikedeboer
MozReview-Commit-ID: 152bkpjVsPv

--HG--
extra : rebase_source : e32116c6f3baef212bc366a758cde6ad8b0494c5
2017-04-04 16:01:28 -04:00
Will Wang
9ab097c6ac Bug 1305950 - Don't collect/save the session when the user is idle. r=mdeboer
This patch includes:
- (By Yoric) Don't collect/save the session when the user is idle;r=mdeboer
- Add a test for the behavior of state writing in idle/active mode

When the user is not actively using the computer, webpages may still
perform changes that require (re)writing to sessionstore, e.g.  updating
Session Cookies or DOM Session Storage, or refreshing, etc. Before
this patch, a single active page can require us to
recollect/serialize/write the entire Session Restore file every 15
seconds even when the user is not in front of the computer.

We expect that, when the user is not in front of the computer, changes
are not critical and don't need to be saved as often. We now adopt the
following strategy:

- when the user has been away for (by default) 15 seconds, finish any
  pending collect/write, then increase the collect/write buffering
  delay to (by default) 1h

- when the user returns, reschedule any pending 1h collect/write as a
  (by default) 15 seconds collect/write, then proceed with (by
  default) 15 seconds collect/write delays.

--HG--
extra : histedit_source : b7ea6a6fbfee2f3a2bddeaa69b6446d7544c2585
2017-03-31 11:38:01 +08:00
Tim Taubert
ff47acdd0e Bug 1352365 - Remove duplicate PrivacyLevel checks in SessionCookies.jsm r=mikedeboer
PrivacyLevel checks currently allow to disable storing secure cookies and any
cookies belonging to an HTTPS host, or completely disable storing cookies. We
call PrivacyLevel.canSave() for every host found in the shistory of a given
window's tabs. We then call it again for every cookie when retrieving all
cookies stored for a given host.

The two different privacy checks exist because in the past an HTTP site could
send a secure cookie too. Since Firefox 52 this isn’t possible anymore, only
HTTPS sites can send secure cookies. So as soon as nsICookie.isSecure=true
we know the site was loaded over TLS.

That means there are the following scenarios:

[PRIVACY_LEVEL=NONE] (default)
We store all cookies.

[PRIVACY_LEVEL=FULL]
We store no cookies at all.

[PRIVACY_LEVEL=ENCRYPTED]
HTTP site sends cookie: Store.
HTTP site sends secure cookie: Can't happen since Fx52
HTTPS site sends cookie: Store. The site is HTTPS but we should store the
cookie anyway because the "Secure" directive is missing. That means the
site wants us to send it for HTTP requests too.
HTTPS site sends secure cookie: Don't store.

This allows us to simplify the code and remove the per-host PrivacyLevel
checks. Checking nsICookie.isSecure is enough to tell whether we want
to keep a cookie or not.
2017-03-31 11:54:18 +02:00
Wes Kocher
914dd4b76c Merge inbound to m-c a=merge 2017-03-28 13:30:56 -07:00
milindl
6109edd9bd Bug 1247201 - yield on tests using removeDataFromDomain,r=mak
This changeset changes tests using ForgetAboutSite.removeDataFromDomain
to yield on it, since now it is a Task

MozReview-Commit-ID: 72OEYoO1avd

--HG--
extra : rebase_source : 9ea8cc06493c3e965d260dc9377461ff29fe572a
2017-03-17 14:29:48 +05:30
Geoff Brown
117eae5d10 Bug 1284312 - Skip browser_819510_perwindowpb.js on win64 for persistent intermittent failures; r=jmaher 2017-03-28 08:15:12 -06:00
Jan Henning
8da83bac15 Bug 1265818 - Part 4 - Test that scroll positions for previous session history entries are restored on Desktop. r=mikedeboer
This extends the existing the existing scroll position test by navigating to a second page and then checking that after closing and restoring that tab, the scroll position is restored not only for the current history entry, but after going back as well.

MozReview-Commit-ID: Ddig1Mfo5rz

--HG--
extra : rebase_source : 20bdc1f116b27f7386a9b7d1cdc0ad383b21b99c
2017-02-19 22:17:28 +01:00
Mike Conley
e5f75b2640 Bug 1096013 - Add a test that ensures that we don't lose the favicon for background tabs that crash. r=mikedeboer
MozReview-Commit-ID: BoF62uPSfUC

--HG--
extra : rebase_source : 5549eaa87adcf93b81dbebc6e7e69c3ab5fc0e78
2017-03-24 10:26:49 -04:00
Joel Maher
48d7c50fac Bug 1211084 - Intermittent e10s browser_async_remove_tab.js. disable on debug. r=mikedeboer
MozReview-Commit-ID: BxYvy8WswY1
2017-03-24 09:50:49 -04:00
Jared Wein
a54eda04ca Bug 1348068 - Enable the key-spacing rule for eslint and fix the related issues. r=standard8
Running eslint with --fix didn't fix many of the issues. The majority here had to be fixed by hand but a significant majority of the issues were related to a few files that I was able to use find-and-replace with. I regret not making this in to separate commits of the hand-fixes and the fixes from --fix but I don't recall --fix fixing any of the issues.

MozReview-Commit-ID: ANyg2qfo3Qx

--HG--
extra : rebase_source : 61d2aa91bf9474af3d72a5dea41b25dca442c1b7
2017-03-21 14:29:43 -04:00
Mark Banner
bd625e4e9f Bug 1347712 - Change the testing configurations into ESLint configurations within eslint-plugin-mozilla - automatically update .eslintrc.js test config files for new config locations. r=jaws
MozReview-Commit-ID: LH0CQOPfoe6

--HG--
extra : rebase_source : 83eaf40c5cbb5e25cfb3f3b5afadf4fbf0422c92
2017-03-20 12:36:37 +01:00
Mike Conley
5d82a3b36c Bug 1256472 - When restoring a window, initialize each browser tab as remote if possible. r=mikedeboer
Originally, we were forcing these restored background tabs to be non-remote by default.
This was because we didn't want them to show the crashed tab favicon nor show about:tabcrashed
if the user hadn't restored them before.

Bug 1241459 added infrastructure that makes it possible to put crashed background tabs into
the "restore on demand" state again, without showing about:tabcrashed or showing the crashed
tab favicon.

This means we should be able to restore tabs in the content process again which should take
some load off of the parent process during session restore, which is good for perceived
performance.

Note that if the content process does crash, the background tabs are then loaded in the parent
process. Restoring them on demand will then do the remoteness flip.

MozReview-Commit-ID: 1mWe0td6geB

--HG--
extra : rebase_source : ea872b615ebe3d8639b214bfafc5e358ba6e65fd
2017-03-14 10:01:38 -04:00
Joel Maher
e3484be3f7 Bug 1167933 - Intermittent e10s browser_async_flushes.js- disable on debug. r=mikedeboer
MozReview-Commit-ID: 357NSaMFLqc
2017-03-17 16:39:23 -04:00
Sebastian Hengst
7345d89cab Backed out changeset 27f5fcaca7fa (bug 1256472) 2017-03-16 17:22:23 +01:00
Blake Kaplan
2782e4e4b4 Bug 1346286 - Remove CPOWs from browser_history_persist.js r=Felipe
MozReview-Commit-ID: 22fQbSgMzQM

--HG--
extra : rebase_source : 440fde61df0a652f0e045068d12ab6ef7ecf281a
2017-03-09 14:30:30 -08:00
Blake Kaplan
66ff3b755f Bug 1346286 - Remove CPOWs from browser_911547.js. r=Felipe
MozReview-Commit-ID: 3Y5K84X2EIe

--HG--
extra : rebase_source : 3ef4c073a92ab580d0baa1caa0a1cd14e5bec160
2017-03-09 11:36:28 -08:00
Blake Kaplan
1a97f71604 Bug 1346286 - Remove CPOWs from browser_500328.js. r=Felipe
MozReview-Commit-ID: 2Ok956Ec2ub

--HG--
extra : rebase_source : 19bc7673818ac49ceb47958bcf7e654a02fabbdb
2017-03-08 17:07:57 -08:00
Blake Kaplan
2a88902832 Bug 1346286 - Remove CPOWs from browser_687710_2.js. r=Felipe
MozReview-Commit-ID: Au09j3DGveY

--HG--
extra : rebase_source : 73eb360b97af7e7175446f1790c562427d48f6ad
2017-03-07 18:09:42 -08:00
Blake Kaplan
928a1b69e2 Bug 1346286 - Remove CPOWs from browser_739805.js. r=Felipe
MozReview-Commit-ID: I2wWOxSbdsD

--HG--
extra : rebase_source : 5563ca8f20ae229ce6191e9a149046a0be7da268
2017-03-07 16:38:13 -08:00
Mike Conley
a04621c4a8 Bug 1256472 - When restoring a window, initialize each browser tab as remote if possible. r=mikedeboer
Originally, we were forcing these restored background tabs to be non-remote by default.
This was because we didn't want them to show the crashed tab favicon nor show about:tabcrashed
if the user hadn't restored them before.

Bug 1241459 added infrastructure that makes it possible to put crashed background tabs into
the "restore on demand" state again, without showing about:tabcrashed or showing the crashed
tab favicon.

This means we should be able to restore tabs in the content process again which should take
some load off of the parent process during session restore, which is good for perceived
performance.

Note that if the content process does crash, the background tabs are then loaded in the parent
process. Restoring them on demand will then do the remoteness flip.

MozReview-Commit-ID: 1mWe0td6geB

--HG--
extra : rebase_source : 5e1dbbaf0e1fb641bd43f821980ab5dff7272b04
2017-03-14 10:01:38 -04:00
Carsten "Tomcat" Book
8fd069a1f2 Merge mozilla-central to autoland 2017-03-14 14:27:38 +01:00
Mark Banner
c26710ebe4 Bug 1311347 - Enable eslint of browser/components/sessionstore/. Manual fixes. r=jaws
MozReview-Commit-ID: AupJNLZJ2Ye

--HG--
extra : rebase_source : b9113d1ca913d399ca4e831f3c381e8fa45847bd
2017-03-13 10:32:03 +00:00
Mark Banner
4acba13973 Bug 1311347 - Enable eslint of browser/components/sessionstore/. Autofix changes. r=jaws
MozReview-Commit-ID: 5LKHbcmjSy

--HG--
extra : rebase_source : d7e4571dae5c5770c7908579d7634419382d78e2
2017-03-10 19:51:20 +00:00
Michael Layzell
f083c8ec83 Bug 1345857 - Clone TabData entries when restoring tabs, r=mikedeboer
MozReview-Commit-ID: BhAbhSHgXWt
2017-03-13 18:57:07 -04:00
Sebastian Hengst
5a87040be3 Backed out changeset 5e4c135cb424 (bug 1345857) for failing at least marionette (test_refresh_firefox.py TestFirefoxRefresh.testReset), functional-ui and browser-chrome. r=backout on a CLOSED TREE 2017-03-13 19:21:03 +01:00
Michael Layzell
f838a81893 Bug 1345857 - Clone TabData entries when restoring tabs, r=mikedeboer
MozReview-Commit-ID: BhAbhSHgXWt
2017-03-13 13:25:01 -04:00
jordan9769
5761e9b0d1 Bug 1311347 - Enable eslint of browser/components/sessionstore/. Initial changes by Sourav, updated by Standard8. r=jaws
MozReview-Commit-ID: 4RFxoV8SkIa

--HG--
extra : rebase_source : 96b24b172cfa957489df37943171ddae07145e84
2016-10-28 02:48:50 +05:30
Masatoshi Kimura
7be7b11a1c Bug 1342144 - Remove version parameter from the type attribute of script elements. r=jmaher
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;

MozReview-Commit-ID: AzhtdwJwVNg

--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
2017-02-23 06:10:07 +09:00
Sebastian Hengst
35f441b13c Backed out changeset 3f7bb57e5440 (bug 1340450) for frequently failing own test browser_disable_containers.js. r=backout 2017-02-21 17:52:23 +01:00
Andrea Marchesini
d11876b2bb Bug 1340450 - When containers are disabled, it should not be possible to reopen container tabs, r=mdeboer 2017-02-21 15:11:42 +01:00
Gabor Krizsanits
f9bc8c7133 Bug 1289723 - Fixing crashedTabs test for e10s-multi. r=mrbkap r=felipc 2017-02-21 13:30:17 +01:00
Carsten "Tomcat" Book
70d5eceb33 Backed out changeset 59d4978e8726 (bug 1289723) for eslint failure 2017-02-21 12:11:04 +01:00
Gabor Krizsanits
a498797697 Bug 1289723 - Fixing crashedTabs test for e10s-multi. r=mrbkap 2017-02-21 11:27:19 +01:00
Sebastian Hengst
d64fe0ec59 Backed out changeset 6b22d70e15f5 (bug 1340450) for frequent failure of own test browser_disable_containers.js. r=backout 2017-02-20 21:13:33 +01:00
Andrea Marchesini
b4c474e3d2 Bug 1340450 - When containers are disabled, it should not be possible to reopen container tabs, r=mdeboer 2017-02-20 15:55:05 +01:00
Tooru Fujisawa
1e407b8ed0 Bug 1338248 - Remove remaining legacy generator from browser/components/sessionstore/test/. r=mikedeboer 2017-02-11 01:53:23 +09:00
Florian Quèze
bdc1ffa608 Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
Christoph Kerschbaumer
af33c277b4 Bug 1307736 - Ensure tests performing a history load pass valid triggeringPrincipal. r=bz,mdeboer 2017-01-27 11:19:45 +01:00
Florian Quèze
15bab6d46b Bug 1334250 - adapt the no-useless-removeEventListener rule to handle the listener being added and removed with the same variable + some hand fixes, r=jaws. 2017-01-27 10:47:57 +01:00
Florian Quèze
0e0865f4fc Bug 1331599 - script-generated patch to replace removeEventListener calls with the once option when possible, r=jaws. 2017-01-25 07:01:52 +01:00
Tooru Fujisawa
82e73ed5ac Bug 1321215 - Remove legacy generator from browser/. r=Paolo 2017-01-21 22:52:44 +09:00
Mark Banner
16e6d381ac Bug 503613 - Remove old 'tail =' lines from xpcshell.ini files; r=gps
MozReview-Commit-ID: 62Hp5ISxowJ

--HG--
extra : rebase_source : daa8efb3409031fea553f4fd0c9d0746e38dc308
extra : histedit_source : b4c23aacf678ba0d0ac9c09191a7c494ead11a08
2017-01-18 10:30:39 +00:00
Florian Quèze
85611a7b6d Bug 1331081 - script generated patch to omit addEventListener/removeEventListener's third parameter when it's false, r=jaws.
--HG--
extra : rebase_source : a22344ee1569f58f1f0a01017bfe0d46a6a14602
2017-01-17 11:50:25 +01:00
Phil Ringnalda
191c2661b5 Backed out 2 changesets (bug 1307736) for failures in browser_490040.js and test_refresh_firefox.py TestFirefoxRefresh.testReset
CLOSED TREE

Backed out changeset 338dd2c343f8 (bug 1307736)
Backed out changeset 1a71a0d9aa90 (bug 1307736)
2017-01-16 10:47:55 -08:00