Commit graph

21 commits

Author SHA1 Message Date
Will Wang
dd03c7ac9b Bug 1366213: Part 2 - Make session restore component switch to observe new topic 'session-cookie-changed' instead of 'cookie-changed'. r=mikedeboer
--HG--
extra : rebase_source : beabb6499eb9c00cd0eda70fe7f08acefd4f7ed1
2017-06-30 12:09:31 -07:00
Christoph Kerschbaumer
e4f38c8d7c Bug 1362993 - Rewrite gBrowser.addTab() to use BrowserTestUtils.addTab(). r=florian 2017-05-15 21:49:50 +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
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
Florian Queze
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Carsten "Tomcat" Book
3a762886de Merge mozilla-central to mozilla-inbound 2017-04-07 15:33:03 +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
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
Pushpankar
c6670d980f Bug 1286854 - Replace ownerDocument.defaultView with ownerGlobal in browser/. r=dao
--HG--
extra : rebase_source : 72d50e73baf595840a2aade57ae782e4c40d4c27
2016-07-16 10:20:04 +02:00
Jonathan Hao
5c43c6db43 Bug 1283709 - Test if cookies are restored correctly to container tabs. r=mikedeboer
MozReview-Commit-ID: 2NJlJ5tFsS4

--HG--
extra : amend_source : ae347962c3fb5ae2c20d960698d078553a99f17e
2016-07-06 01:39:00 +08:00
Yoshi Huang
5399e1e48d Bug 1278149 - split browser_sessionStoreContainer.js. r=mikedeboer 2016-06-07 11:02:38 +08:00
Yoshi Huang
339be8eaee Bug 1274461 - Part 3: another test for restoring. r=mikedeboer
This test will verify the following case:
When restore tab doesn't have userContextId, however open tab does have.
2016-06-03 15:01:03 +08:00
Yoshi Huang
0f17c65a40 Bug 1274461 - Part 2: restore tabs should preserve userContextId. r=mikedeboer 2016-06-03 15:01:03 +08:00
Yoshi Huang
c4e888761f Bug 1274461 - Part 1: undoCloseTab should preserve userContextId. r=mikedeboer 2016-06-03 15:01:03 +08:00
Yoshi Huang
96c3cbd91b Bug 1250063 - Part 1: Pass userContextId in duplicateTab. r=ttaubert 2016-05-17 19:49:09 +08:00
Mike de Boer
df7e3c059a Bug 1241930: Part 2 - convert all assertion methods used inside content tasks to the Assert.* family in browser tests. r=mconley 2016-03-04 14:32:24 +01:00
Kate McKinley
b23827ce73 Bug 1195881 - working test for session store using containers under e10s. r=baku,r=tanvi 2016-01-20 00:29:00 +01:00
Andrea Marchesini
54e1406a46 Bug 1237081 - remove the getter of userContextId from nsIDocShell, r=smaug 2016-01-06 15:39:58 +00:00
Andrea Marchesini
72360793f4 Bug 1193854 - Restoring userContextIds with the browser session - part 3 - tests, r=ttaubert 2016-01-05 21:01:46 +00:00