Commit Graph

1214 Commits

Author SHA1 Message Date
Tim Huang
1fa1133990 Bug 1633851 - Part 1: Add a 'IsThirdPartyContextToTopWindow' flag to LoadInfo. r=baku
We add a 'IsThirdPartyContextToTopWindow' flag in the LoadInfo. This
flag shows if the channel is considered as a third party related to the
top-level window.

This flag would be set when opening the channel in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D73199
2020-05-13 13:38:41 +00:00
Peter Van der Beken
879cba492c Bug 1570255 - Reboot session history in parent part 1. r=smaug,necko-reviewers,valentin
This adds a new implementation of nsISHEntry
(mozilla::dom::SessionHistoryEntry). When session history in the parent
is turned on, we'll instantiate the existing nsSHistory in the parent
process, but it will store entries of this new type. The nsSHistory in
the child process will also be instantiated for now, to avoid breaking
too many assumptions, and we try to keep parent and child
implementations in sync.

mozilla::dom::SessionHistoryEntry stores most of its data in a new
structure (mozilla::dom::SessionHistoryInfo) which can be sent over IPC.
When a load starts through the DocumentChannel we create an entry of
this new type for it in the parent process in
DocumentLoadListener::Open. The SessionHistoryInfo for that entry (with
an associated ID) is then sent over IPC in the RedirectToRealChannelArgs
to the process that does the actual load, where we store it in the
nsDocShell in mLoadingEntry (and mLoadingEntryId). The parent process
keeps track of outstanding loading entries in an array (mLoadingEntries)
in the CanonicalBrowsingContext. When a load finishes the nsDocShell
transfers mLoadingEntry into mActiveEntry, and notifies the parent
process through an IPC message (HistoryCommit) with the id of that
entry. The CanonicalBrowsingContext then removes the entry from the
array and stores it in its mActiveEntry, and adds the entry to the
nsSHistory object.

There are a number of things in this patch that are broken, and a lot of
FIXME comments. However, with the pref turned off things should just be
working as before. The goal is to land this first part, and then iterate
on the new implementation until we can switch over.

Differential Revision: https://phabricator.services.mozilla.com/D65329
2020-05-13 13:46:33 +00:00
ssengupta
cf852bbfb9 Bug 1635399 - Function PrincipalInfoToPrincipal now returns Result<nsCOMPtr<nsIPrincipal>, nsresult> r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D73868
2020-05-12 19:02:05 +00:00
Jean-Yves Avenard
28d4ac9c33 Bug 1634982 - Don't call DocumentChannelBridgeDisconnected when already being disconnected from the DocumentLoadListener. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D74517
2020-05-11 00:42:09 +00:00
Dan Glastonbury
39c9e7dd94 Bug 1624550 - P3: Update Global History from DocumentLoadListener in Parent process. r=mak,farre,mattwoodrow
Avoid round-trip Parent->Content->Parent to add visited URI to browsing history.

Differential Revision: https://phabricator.services.mozilla.com/D72278
2020-05-08 03:28:42 +00:00
Matt Woodrow
3d6e4f24c6 Bug 1635995 - Allow CSP service to do redirect checks on documents in the parent, rather than doing it manually. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D74170
2020-05-08 02:53:57 +00:00
Nika Layzell
2454ade94e Bug 1633820 - Part 3: Get rid of PBrowserOrId, r=mattwoodrow,necko-reviewers,dragana
The 'Id' variant was only used with b2g for remote `mozbrowser`s, and is no
longer relevant. The new code instead uses `PBrowser` directly in all cases.

Differential Revision: https://phabricator.services.mozilla.com/D72933
2020-05-07 22:49:06 +00:00
Razvan Maries
7a5b66f9b6 Backed out 5 changesets (bug 1633820) for build bustages at TabContext.cpp. CLOSED TREE
Backed out changeset 0a20dd1935d7 (bug 1633820)
Backed out changeset 626e834293ed (bug 1633820)
Backed out changeset 14cc454a8cbc (bug 1633820)
Backed out changeset 7bbcb9266b87 (bug 1633820)
Backed out changeset ef99672bd2af (bug 1633820)
2020-05-08 00:59:20 +03:00
Nika Layzell
dd35cc6b02 Bug 1633820 - Part 3: Get rid of PBrowserOrId, r=mattwoodrow,necko-reviewers,dragana
The 'Id' variant was only used with b2g for remote `mozbrowser`s, and is no
longer relevant. The new code instead uses `PBrowser` directly in all cases.

Differential Revision: https://phabricator.services.mozilla.com/D72933
2020-05-07 17:45:12 +00:00
Kershaw Chang
2531104710 Bug 1623380 - Send ODA directly to content process r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D67609
2020-05-07 14:39:21 +00:00
Dorel Luca
ed73e1d6d4 Backed out changeset 2b9fc84a789b (bug 1623380) for Mochitest failures in dist/include/mozilla/RefPtr.h. CLOSED TREE 2020-05-07 15:17:30 +03:00
Kershaw Chang
467f6725fc Bug 1623380 - Send ODA directly to content process r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D67609
2020-05-07 11:12:46 +00:00
Simon Giesecke
61ad805d68 Bug 1626570 - Use CopyableTArray in ipdlc as member type for now. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D73685
2020-05-07 08:11:08 +00:00
Gijs Kruitbosch
88153109ac Bug 1633790 - pass channels to stream conversion getContentType and always allow PDF.js use for user-opened local PDF files, r=mattwoodrow,jaws
Differential Revision: https://phabricator.services.mozilla.com/D73511
2020-05-06 20:34:51 +00:00
Bogdan Tara
7fce40912d Backed out 5 changesets (bug 1633820) for bustages complaining about TabContext CLOSED TREE
Backed out changeset 4982d41d5e6b (bug 1633820)
Backed out changeset 9803c41e42f9 (bug 1633820)
Backed out changeset 2475bbab03a8 (bug 1633820)
Backed out changeset 762f0b2c154c (bug 1633820)
Backed out changeset f9ea871a0227 (bug 1633820)
2020-05-06 22:39:46 +03:00
Nika Layzell
da2aae6af5 Bug 1633820 - Part 3: Get rid of PBrowserOrId, r=mattwoodrow,necko-reviewers,dragana
The 'Id' variant was only used with b2g for remote `mozbrowser`s, and is no
longer relevant. The new code instead uses `PBrowser` directly in all cases.

Differential Revision: https://phabricator.services.mozilla.com/D72933
2020-05-06 17:42:41 +00:00
shashvat
22ff7b4e5c Bug 1629425 Removed redundant return statement r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D71545
2020-04-20 11:45:25 +00:00
Simon Giesecke
00122bbae3 Bug 1626570 - Improve handling of copying arrays in netwerk/. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D73678
2020-05-06 11:48:42 +00:00
Nika Layzell
573962fe33 Bug 1634764 - Add helpers for Top/Parent WindowContext, r=farre
There are various times when it would be useful to get the toplevel or parent
WindowContext from a window or browsing context. While this is already possible,
it's currently somewhat inconvenient.

Differential Revision: https://phabricator.services.mozilla.com/D73500
2020-05-04 14:26:34 +00:00
Nicholas Nethercote
fe37816cbd Bug 1628033 - Add pid to the socket process in about:memory. r=valentin,necko-reviewers
This is modelled on the corresponding code in
`RDDParent::RecvRequestMemoryReport()`.

Also rename it `Socket` to match other content processes like `GPU` and `RDD`.

Differential Revision: https://phabricator.services.mozilla.com/D72995
2020-04-30 00:46:14 +00:00
sagudev
94a5c2f430 Bug 1319881 - Remove UsingNeckoIPCSecurity r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D72534
2020-04-29 12:00:01 +00:00
Jean-Yves Avenard
94a3210fdf Bug 1633644 - P2. Do not call RedirectToRealChannel if the channel got cancelled. r=mattwoodrow.
Depends on D72795

Differential Revision: https://phabricator.services.mozilla.com/D72809
2020-04-28 22:31:55 +00:00
Jean-Yves Avenard
f7bbf64d0e Bug 1633644 - P1. Handle case where the DocumentChannel got cancelled mid-air. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D72795
2020-04-28 12:29:52 +00:00
Matt Woodrow
9bc5c5b884 Bug 1633310 - Don't do pre-load shouldLoadURI process switches for leaving about:newtab in the web process. r=nika,mconley
Differential Revision: https://phabricator.services.mozilla.com/D72583
2020-04-28 19:45:43 +00:00
Kershaw Chang
4db371a46e Bug 1512478 - Use sync IPC to get client auth data from parent process r=keeler,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D36911
2020-04-28 20:12:43 +00:00
Dan Glastonbury
6ffa81c157 Bug 1623565 - P3: Remove mLoadFlags from DocumentChannelCreationArgs. r=mattwoodrow,jya
Differential Revision: https://phabricator.services.mozilla.com/D67799
2020-04-27 05:38:15 +00:00
Matt Woodrow
20f213591b Bug 1624318 - Serialize replacement config input stream as a blob. r=baku,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D71872
2020-04-27 04:49:00 +00:00
Matt Woodrow
a34398fd9f Bug 1602318 - Initiate document loads in the parent process in parallel with setting up the content process side. r=nika,jya
Differential Revision: https://phabricator.services.mozilla.com/D72112
2020-04-26 00:54:15 +00:00
Matt Woodrow
382b007694 Bug 1602318 - Simplify DocumentChannelParent construction so that everything happens in Init. r=jya,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D72111
2020-04-26 00:53:37 +00:00
Matt Woodrow
98e4b6eb1f Bug 1602318 - Expose LoadContext on BrowsingContext webidl. r=nika,kmag,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D71135
2020-04-26 00:53:01 +00:00
Matt Woodrow
428f559ab6 Bug 1602318 - Fix unified build issues. r=jya,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D70620
2020-04-26 00:51:05 +00:00
Matt Woodrow
59ee67c46a Bug 1602318 - Remove nsILoadContext from DocumentLoadListener. r=nika,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D70618
2020-04-26 00:50:52 +00:00
Matt Woodrow
c5176bc6cf Bug 1602318 - Initialize mixed content channel for process-switches. r=ckerschb,necko-reviewers,dragana
Same process origin changes are handled by the docshell, which detects this during AsyncOnChannelRedirect and clears the mixed content permission.
Process switches load in a fresh docshell, so we need to make sure we appropriately set or clear the mixed content permission.

Differential Revision: https://phabricator.services.mozilla.com/D67095
2020-04-26 00:49:21 +00:00
Matt Woodrow
8ff849ade1 Bug 1602318 - Associate a current DocumentLoadListener with CanonicalBrowsingContext. r=nika,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D67094
2020-04-26 00:49:19 +00:00
sagudev
84e60a5d6c Bug 1322254 - Remove network.disable.ipc.security pref r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D71914
2020-04-24 17:42:35 +00:00
Cosmin Sabou
0f970fbb19 Backed out 20 changesets (bug 1602318) for causing multiple types of failures. CLOSED TREE
Backed out changeset f71e3eff7a8c (bug 1602318)
Backed out changeset 0e0bdebf223b (bug 1602318)
Backed out changeset 44e82f4339a1 (bug 1602318)
Backed out changeset 5f341ebd8591 (bug 1602318)
Backed out changeset 088ea9d20617 (bug 1602318)
Backed out changeset 5de6321939f2 (bug 1602318)
Backed out changeset f5742e84912b (bug 1602318)
Backed out changeset 13bec3079540 (bug 1602318)
Backed out changeset 6c24ba022911 (bug 1602318)
Backed out changeset 5d0fc0102a7f (bug 1602318)
Backed out changeset fc4efd11e643 (bug 1602318)
Backed out changeset 028bd63e710d (bug 1602318)
Backed out changeset 21ad350f9617 (bug 1602318)
Backed out changeset 8f27319f2c34 (bug 1602318)
Backed out changeset db2832973382 (bug 1602318)
Backed out changeset 1756c7584491 (bug 1602318)
Backed out changeset 983e5a9abe02 (bug 1602318)
Backed out changeset a1b9429b3298 (bug 1602318)
Backed out changeset 7d1c0d968a09 (bug 1602318)
Backed out changeset a3b056ec6be3 (bug 1602318)
2020-04-24 11:15:12 +03:00
Matt Woodrow
fc342b8877 Bug 1602318 - Initiate document loads in the parent process in parallel with setting up the content process side. r=nika,jya
Differential Revision: https://phabricator.services.mozilla.com/D72112
2020-04-24 07:00:39 +00:00
Matt Woodrow
14182ed7f9 Bug 1602318 - Simplify DocumentChannelParent construction so that everything happens in Init. r=jya,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D72111
2020-04-24 06:59:59 +00:00
Matt Woodrow
89ca645d61 Bug 1602318 - Expose LoadContext on BrowsingContext webidl. r=nika,kmag,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D71135
2020-04-24 06:59:29 +00:00
Matt Woodrow
2049140b75 Bug 1602318 - Fix unified build issues. r=jya,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D70620
2020-04-24 06:57:30 +00:00
Matt Woodrow
a884d27d80 Bug 1602318 - Remove nsILoadContext from DocumentLoadListener. r=nika,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D70618
2020-04-24 06:57:17 +00:00
Matt Woodrow
e93ecebed1 Bug 1602318 - Initialize mixed content channel for process-switches. r=ckerschb,necko-reviewers,dragana
Same process origin changes are handled by the docshell, which detects this during AsyncOnChannelRedirect and clears the mixed content permission.
Process switches load in a fresh docshell, so we need to make sure we appropriately set or clear the mixed content permission.

Differential Revision: https://phabricator.services.mozilla.com/D67095
2020-04-24 06:56:18 +00:00
Matt Woodrow
ca01075202 Bug 1602318 - Associate a current DocumentLoadListener with CanonicalBrowsingContext. r=nika,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D67094
2020-04-24 06:55:20 +00:00
Jean-Yves Avenard
55a6e2ac80 Bug 1607984 - P17. Put ParentProcessDocumentChannel behind a pref. r=necko-reviewers,mattwoodrow
We disable it for now, until some remaining failures are sorted out.

Differential Revision: https://phabricator.services.mozilla.com/D71875
2020-04-24 01:46:25 +00:00
Jean-Yves Avenard
4dd65b320f Bug 1607984 - P13. Proxy the first http-on-opening-request event to the DocumentChannel. r=mayhemer,necko-reviewers
Some tests rely on this event to start action. The DocumentChannel had no equivalent. We make the ParentProcessDocumentChannel listen to this event and if it matches the nsIChannel currently in use in the DocumentLoadListener than we emit a similar document-on-modify-request event on the DocumentChannel.

Differential Revision: https://phabricator.services.mozilla.com/D70010
2020-04-24 01:45:55 +00:00
Jean-Yves Avenard
ff4bc77f97 Bug 1607984 - P12-4. Start parent load via DocumentChannel. r=mayhemer,nika,mattwoodrow,necko-reviewers
Add ParentProcessDocumentChannel object. This object is a DocumentChannel that will start a channel load from the parent process via a DocumentChannel.

The aim of this task is two-fold.
1- Be consistent on how we handle redirects before continuing the load on the final channel.
2- Prepare to initiate a process switch when needed without having to go via an intermediary content process, saving a process switch. This task will be done in a follow-up task.

The behaviour of the ParentProcessDocumentChannel is similar in logic to the DocumentChannelChild/DocumentChannelParent pair. The ParentProcessDocumentChannel sets up a DocumentLoadListener, have it handle the redirects and upon completion continue the load on the final channel.

Differential Revision: https://phabricator.services.mozilla.com/D70009
2020-04-24 01:58:23 +00:00
Jean-Yves Avenard
45fb84edc5 Bug 1607984 - P12-3. Let DocumentChannel decides when it can be used. r=mattwoodrow
Depends on D72272

Differential Revision: https://phabricator.services.mozilla.com/D72273
2020-04-24 02:22:58 +00:00
Jean-Yves Avenard
6cc38139af Bug 1607984 - P12-2. Refactor DocumentLoadListener. r=mattwoodrow
This prepares the code so that it doesn't always have to deal with dealing with another process as is the case when using DocumentChannelChild/DocumentChannelParent

Depends on D72271

Differential Revision: https://phabricator.services.mozilla.com/D72272
2020-04-24 02:29:03 +00:00
Jean-Yves Avenard
f9c4df23ce Bug 1607984 - P12-1. Move methods to base class. r=mattwoodrow
Move DocumentChannelChild methods to the base class as they will be needed with the ParentProcessDocumentChannel

Depends on D70008

Differential Revision: https://phabricator.services.mozilla.com/D72271
2020-04-24 02:21:01 +00:00
Jean-Yves Avenard
97dd134ba0 Bug 1607984 - P7. Fix compilation failure in non-unified mode. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D70004
2020-04-24 01:45:04 +00:00