Commit Graph

294 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
761e9dfe4c Bug 1635094 - Cleanup the ReferrerInfo code. r=ckerschb
The cast in InitWithNode is wrong. AsElement() asserts instead of
checking the flag, so we always pass an element (and if we didn't we'd
have type confusion problems). I audited the callers and we're fine.

Anyhow, always require an element, and add two convenience constructors
for C++ code.

Differential Revision: https://phabricator.services.mozilla.com/D73636
2020-05-04 18:50:20 +00:00
Cosmin Sabou
71a40eae48 Backed out 2 changesets (bug 1635094) for build bustages on nsMacShellService.cpp. CLOSED TREE
Backed out changeset 0a2b0c6ea19a (bug 1635094)
Backed out changeset ead4f26f76ee (bug 1635094)
2020-05-04 20:04:06 +03:00
Emilio Cobos Álvarez
6dde680742 Bug 1635094 - Cleanup the ReferrerInfo code. r=ckerschb
The cast in InitWithNode is wrong. AsElement() asserts instead of
checking the flag, so we always pass an element (and if we didn't we'd
have type confusion problems). I audited the callers and we're fine.

Anyhow, always require an element, and add two convenience constructors
for C++ code.

Differential Revision: https://phabricator.services.mozilla.com/D73636
2020-05-04 16:26:51 +00:00
Tim Huang
206dbc83de Bug 1631234 - Part 2: Moving the setting of the 'HasStoragePermission' before the first check of the storage access in nsGlobalWindowOuter::SetNewDocument(). r=baku
Because we would check the storage access permission inside
nsGlobalWindowInner::ExecutionReady(), so we need to set the
'HasStoragePermission' flag before we call it in
nsGlobalWindowOuter::SetNewDocument().

In addition, we check the assertion in the
ClientSource::WindowExecutionReady() back to a diagnostic assertion.

Depends on D71564

Differential Revision: https://phabricator.services.mozilla.com/D71565
2020-04-22 14:49:22 +00:00
Tim Huang
cc191c2a88 Bug 1631234 - Change the diagnostic assertion of the storage aceess in the ClientSource to a regular assertion. r=dimi
We change this assertion to a normal to ease the crash problem from
users and will do a further investigation to know the root cause.

Differential Revision: https://phabricator.services.mozilla.com/D71525
2020-04-20 09:39:48 +00:00
Christoph Kerschbaumer
7e43ad336f Bug 1621987: Implement Sec-Fetch-User. r=baku,edgar,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D69392

--HG--
extra : moz-landing-system : lando
2020-04-16 08:04:26 +00:00
Anny Gakhokidze
20680c6e57 Bug 1622749 - Force new documents resulting from clicking on notifications to open in tabs so we don't crash, r=nika
This is a temporary solution as we don't want to permanently override users'
preferences.

Differential Revision: https://phabricator.services.mozilla.com/D70761

--HG--
extra : moz-landing-system : lando
2020-04-14 17:44:32 +00:00
Kris Maglione
9742588080 Bug 1626404: Part 2a - Store source BrowsingContext rather than DocShell in LoadState. r=nika CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D69418

--HG--
extra : source : 6fb384961b99821bacfd2702d36bff27231c96a7
extra : intermediate-source : b0d4b213b819d2346b1026122335553b77d63cae
2020-04-04 02:42:44 +00:00
Bogdan Tara
7a09dad859 Backed out 6 changesets (bug 1626404) for frequent timeouts on test_postMessage_onOther.html CLOSED TREE
Backed out changeset 453b858f4462 (bug 1626404)
Backed out changeset f54ce6a36c75 (bug 1626404)
Backed out changeset ec63b18da4b9 (bug 1626404)
Backed out changeset b0d4b213b819 (bug 1626404)
Backed out changeset af763de00e9d (bug 1626404)
Backed out changeset 45b68d43bdbb (bug 1626404)
2020-04-09 11:07:40 +03:00
Kris Maglione
edf0e3ba56 Bug 1626404: Part 2a - Store source BrowsingContext rather than DocShell in LoadState. r=nika CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D69418

--HG--
extra : source : 6fb384961b99821bacfd2702d36bff27231c96a7
extra : histedit_source : a380148c947dd2d5d53787ec6027ab387093a7c1
2020-04-04 02:42:44 +00:00
Oana Pop Rus
87d90e34dd Backed out 6 changesets (bug 1626404) for mochitest failures in BrowsingContext.cpp on a CLOSED TREE
Backed out changeset 4a3b391e08c4 (bug 1626404)
Backed out changeset 1a5a559ec6d5 (bug 1626404)
Backed out changeset 2ffdab0072e7 (bug 1626404)
Backed out changeset 6fb384961b99 (bug 1626404)
Backed out changeset c0c2e85e33da (bug 1626404)
Backed out changeset bf32b30efa49 (bug 1626404)

--HG--
extra : rebase_source : 466bf9356539fbc47cb015df212e38698322bfb3
2020-04-09 00:22:49 +03:00
Kris Maglione
f2708013e8 Bug 1626404: Part 2a - Store source BrowsingContext rather than DocShell in LoadState. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D69418

--HG--
extra : moz-landing-system : lando
2020-04-04 02:42:44 +00:00
Andreas Farre
f2fa2e633c Bug 1620594 - Part 5: Use GetMainThreadSerialEventTarget instead of SystemGroup::EventTargetFor. r=nika
This patch also tries to remove the event target entirely if it would
default to the main thread on a null event target.

Depends on D67634

Differential Revision: https://phabricator.services.mozilla.com/D67635

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:07 +00:00
Andreas Farre
36eaf82163 Bug 1620594 - Part 2: Use SchedulerGroup::Dispatch instead of SystemGroup::Dispatch. r=nika
Depends on D67631

Differential Revision: https://phabricator.services.mozilla.com/D67632

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:33 +00:00
Narcis Beleuzu
00218b8a49 Backed out 6 changesets (bug 1626404) for assertion failures on BrowsingContext.cpp . CLOSED TREE
Backed out changeset aed006ab4c20 (bug 1626404)
Backed out changeset ad87dcb98637 (bug 1626404)
Backed out changeset c065bd4594b4 (bug 1626404)
Backed out changeset a248fc78ab0c (bug 1626404)
Backed out changeset 52892d053ff1 (bug 1626404)
Backed out changeset 440b9193338a (bug 1626404)
2020-04-04 05:29:30 +03:00
Kris Maglione
4024d7dc97 Bug 1626404: Part 2a - Store source BrowsingContext rather than DocShell in LoadState. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D69418

--HG--
extra : moz-landing-system : lando
2020-04-04 00:13:01 +00:00
Narcis Beleuzu
ef38cbbda1 Backed out 6 changesets (bug 1626404) for bustages on LocationBase.cpp . CLOSED TREE
Backed out changeset a399dfff2725 (bug 1626404)
Backed out changeset ad3272abd830 (bug 1626404)
Backed out changeset 322c170e8301 (bug 1626404)
Backed out changeset df37f57cfa1d (bug 1626404)
Backed out changeset e255e4c9e665 (bug 1626404)
Backed out changeset 51120d617459 (bug 1626404)
2020-04-04 02:42:18 +03:00
Kris Maglione
70a8120363 Bug 1626404: Part 2a - Store source BrowsingContext rather than DocShell in LoadState. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D69418

--HG--
extra : moz-landing-system : lando
2020-04-03 22:41:29 +00:00
Ryan VanderMeulen
5012cc0f5d Backed out 6 changesets (bug 1584007) for causing bug 1625227.
Backed out changeset c626a363823e (bug 1584007)
Backed out changeset 0d130a64b0f5 (bug 1584007)
Backed out changeset 8ca43f80bdd2 (bug 1584007)
Backed out changeset 00eda7b39a13 (bug 1584007)
Backed out changeset ac2765b4b4ec (bug 1584007)
Backed out changeset 24deb3d46783 (bug 1584007)

--HG--
extra : amend_source : 9431aa82b4a472f0c60dcf1368817fe7c658bcf5
2020-03-30 14:53:46 -04:00
Andrea Marchesini
9ea9920b65 Bug 1503787 - Make WindowExecutionReady assertions MOZ_ASSERT only, r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D68538

--HG--
extra : moz-landing-system : lando
2020-03-27 14:46:35 +00:00
Perry Jiang
a6d30433e1 Bug 1584007 - FutureClientSourceParent should keep ClientManagerService alive r=asuth
The strong reference will be dropped when FutureClientSourceParent is removed,
and we guarantee that all FutureClientSourceParents will either be removed or
replaced with a ClientSourceParent (or at least this is a guarantee that's
supposed to be true).

Depends on D66529

Differential Revision: https://phabricator.services.mozilla.com/D68041

--HG--
extra : moz-landing-system : lando
2020-03-24 15:52:37 +00:00
Perry Jiang
45fc75766f Bug 1584007 - let ClientChannelHelperParent manage FutureClientSourceParent lifetime r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
ClientChannelHelperParent is the thing creating the ClientInfos which aren't
backed by existing ClientSources, so it may make sense for CCHP to tell the
ClientManagerService (CMS) to "expect" or "forget" a "future"
ClientSource(Parent).

When such a ClientInfo is created, CCHP notifies the CMS that a future
ClientSource may be created. This notification has to be observed before any
ClientHandles try to query CMS to a ClientSourceParent, which is the case
because the notification as well as ClientHandleParent constructors occur over
PBackground, and the notification sending method is called first.

CMS is told to forget the future ClientSource whenever a redirect occurs that
would result in the creation of a new ClientSource (i.e. a new ClientInfo). It's
also possible that the ClientInfo's LoadInfo's channel is cancelled. To account
for this, CHCP stores the most recent ClientInfo it's created and tells CMS
to _possibly_ forget the associated future ClientSource in its destructor. It's
possible that the channel completed its load, in which case this notification
is a no-op. This also relies on CHCP being destroyed after the reserved
ClientSource has a chance to both be created and register its
ClientSourceParent.

Differential Revision: https://phabricator.services.mozilla.com/D66529

--HG--
extra : moz-landing-system : lando
2020-03-24 15:18:31 +00:00
Perry Jiang
4f2d95544d Bug 1584007 - allow ClientManager to register "future" ClientSources r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D66520

--HG--
extra : moz-landing-system : lando
2020-03-24 15:18:29 +00:00
Perry Jiang
7dbfd819b4 Bug 1584007 - let ClientHandleParents wait on FutureClientSourceParents r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
Differential Revision: https://phabricator.services.mozilla.com/D66154

--HG--
extra : moz-landing-system : lando
2020-03-24 15:16:57 +00:00
Perry Jiang
21f57afb8b Bug 1584007 - let ClientManagerService store FutureClientSourceParent r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
The changes only make it possible for ClientManagerService to store
FutureClientSourceParents, but it will not actually store them until
following changesets.

Differential Revision: https://phabricator.services.mozilla.com/D66145

--HG--
extra : moz-landing-system : lando
2020-03-24 15:16:50 +00:00
Perry Jiang
75c94e9b42 Bug 1584007 - initial implementation of FutureClientSourceParent r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
Also implements SourceTableEntry and nsIDHasher to switch ClientManagerService's
nsDataHashTable to a mozilla::HashMap<nsID, SourceTableEntry> in following
changesets.

Differential Revision: https://phabricator.services.mozilla.com/D66144

--HG--
extra : moz-landing-system : lando
2020-03-24 15:16:42 +00:00
Bas Schouten
1bc21ff19c Bug 1563335 - Part 1: Implement mechanism to throttle JS execution. r=smaug,asuth
Differential Revision: https://phabricator.services.mozilla.com/D59321

--HG--
extra : moz-landing-system : lando
2020-03-26 00:36:24 +00:00
Daniel Huigens
7f0520ae9a Bug 1598278 - Check that Service Worker controls client in navigate() r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D66040

--HG--
extra : moz-landing-system : lando
2020-03-24 23:35:38 +00:00
Kristen Wright
5094f72a18 Bug 1622111 - Convert security.data_uri.unique_opaque_origin to static pref and remove ClientPrefs. r=njn
Converts security.data_uri.unique_opaque_origin to a static pref. This pref was initialized by the ClientManager in ClientPrefs, so this commit also removes those files. Somehow this pref was getting added in VarCache twice, so it also removes the places where the pref was added in Networking.

Differential Revision: https://phabricator.services.mozilla.com/D67185

--HG--
extra : moz-landing-system : lando
2020-03-23 16:08:52 +00:00
Mihai Alexandru Michis
b6435f7773 Backed out 5 changesets (bug 1584007) for causing crashes in ClientManagerService.
CLOSED TREE

Backed out changeset e8e6a6bb50ff (bug 1584007)
Backed out changeset 9468d92f2a55 (bug 1584007)
Backed out changeset 19ed74a7ea6f (bug 1584007)
Backed out changeset 6c35d3d0f747 (bug 1584007)
Backed out changeset ea67977a5cdd (bug 1584007)
2020-03-24 11:29:22 +02:00
Perry Jiang
373ae45772 Bug 1584007 - let ClientChannelHelperParent manage FutureClientSourceParent lifetime r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
ClientChannelHelperParent is the thing creating the ClientInfos which aren't
backed by existing ClientSources, so it may make sense for CCHP to tell the
ClientManagerService (CMS) to "expect" or "forget" a "future"
ClientSource(Parent).

When such a ClientInfo is created, CCHP notifies the CMS that a future
ClientSource may be created. This notification has to be observed before any
ClientHandles try to query CMS to a ClientSourceParent, which is the case
because the notification as well as ClientHandleParent constructors occur over
PBackground, and the notification sending method is called first.

CMS is told to forget the future ClientSource whenever a redirect occurs that
would result in the creation of a new ClientSource (i.e. a new ClientInfo). It's
also possible that the ClientInfo's LoadInfo's channel is cancelled. To account
for this, CHCP stores the most recent ClientInfo it's created and tells CMS
to _possibly_ forget the associated future ClientSource in its destructor. It's
possible that the channel completed its load, in which case this notification
is a no-op. This also relies on CHCP being destroyed after the reserved
ClientSource has a chance to both be created and register its
ClientSourceParent.

Differential Revision: https://phabricator.services.mozilla.com/D66529

--HG--
extra : moz-landing-system : lando
2020-03-24 02:34:20 +00:00
Perry Jiang
54f6dbaac3 Bug 1584007 - allow ClientManager to register "future" ClientSources r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D66520

--HG--
extra : moz-landing-system : lando
2020-03-24 02:34:12 +00:00
Perry Jiang
6b14fd7ea2 Bug 1584007 - let ClientHandleParents wait on FutureClientSourceParents r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
Differential Revision: https://phabricator.services.mozilla.com/D66154

--HG--
extra : moz-landing-system : lando
2020-03-24 02:34:10 +00:00
Perry Jiang
d1cc3d5d84 Bug 1584007 - let ClientManagerService store FutureClientSourceParent r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
The changes only make it possible for ClientManagerService to store
FutureClientSourceParents, but it will not actually store them until
following changesets.

Differential Revision: https://phabricator.services.mozilla.com/D66145

--HG--
extra : moz-landing-system : lando
2020-03-24 02:34:35 +00:00
Perry Jiang
b5b13cec75 Bug 1584007 - initial implementation of FutureClientSourceParent r=dom-workers-and-storage-reviewers,mattwoodrow,asuth
Also implements SourceTableEntry and nsIDHasher to switch ClientManagerService's
nsDataHashTable to a mozilla::HashMap<nsID, SourceTableEntry> in following
changesets.

Differential Revision: https://phabricator.services.mozilla.com/D66144

--HG--
extra : moz-landing-system : lando
2020-03-24 02:33:54 +00:00
Stefan Hindli
5f419e4b50 Backed out 9 changesets (bug 1622111) for causing mochitest failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE
Backed out changeset c244160797f8 (bug 1622111)
Backed out changeset dd9209f6bd8b (bug 1622111)
Backed out changeset d694c9e7061f (bug 1622111)
Backed out changeset 486aae809f6d (bug 1622111)
Backed out changeset 709266168c41 (bug 1622111)
Backed out changeset ca0d47bb86a8 (bug 1622111)
Backed out changeset caa735c8bb91 (bug 1622111)
Backed out changeset 12397711ab25 (bug 1622111)
Backed out changeset b66002fd1480 (bug 1622111)
2020-03-19 02:47:51 +02:00
Kristen Wright
54ef9a89c8 Bug 1622111 - Convert security.data_uri.unique_opaque_origin to static pref and remove ClientPrefs. r=njn
Converts security.data_uri.unique_opaque_origin to a static pref. This pref was initialized by the ClientManager in ClientPrefs, so this commit also removes those files. Somehow this pref was getting added in VarCache twice, so it also removes the places where the pref was added in Networking.

Differential Revision: https://phabricator.services.mozilla.com/D67185

--HG--
extra : moz-landing-system : lando
2020-03-18 22:12:20 +00:00
Kashav Madan
2dbd4a809e Bug 1578070 - Rename ClientOpenWindowInCurrentProcess and unskip test_openWindow.html, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D65232

--HG--
extra : moz-landing-system : lando
2020-03-10 20:27:49 +00:00
Kashav Madan
41ed32b21b Bug 1578070 - Use nsWindowWatcher::GetBrowsingContextByName in GeckoViewOpenWindow, r=farre
This also removes LaunchObserver, which was only needed for Fennec.

Differential Revision: https://phabricator.services.mozilla.com/D65401

--HG--
extra : moz-landing-system : lando
2020-03-10 20:27:24 +00:00
Kashav Madan
5f18b14d6d Bug 1578070 - Use the parent process for Clients.openWindow(), r=nika,asuth
Differential Revision: https://phabricator.services.mozilla.com/D64392

--HG--
extra : moz-landing-system : lando
2020-03-10 20:27:01 +00:00
David Teller
ecc51cfadf Bug 1605085 - Make ClientManagerService::OpenWindow use non-blocking GetNewOrUsedBrowserProcessAsync;r=baku
Differential Revision: https://phabricator.services.mozilla.com/D57779

--HG--
extra : moz-landing-system : lando
2020-03-10 12:19:33 +00:00
Boris Zbarsky
00cd5d4380 Bug 1619112 part 5. Stop accepting nsAString in ErrorResult error-throwing. r=smaug
Callers should pass in UTF-8, since that's what the JS engine ends up with in the end anyway.

The various URL changes are because NS_NewURI converts incoming nsAString to
UTF-8 anyway.  So we might as well do that up-front and then use the UTF-8
string for both the NS_NewURI call and the error-reporting if it fails.

Differential Revision: https://phabricator.services.mozilla.com/D65543

--HG--
extra : moz-landing-system : lando
2020-03-06 21:08:02 +00:00
Boris Zbarsky
c878a8bb26 Bug 1619112 part 2. Pass char literals instead of char16_t literals into ErrorResult throwing methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65538

--HG--
extra : moz-landing-system : lando
2020-03-06 21:04:58 +00:00
Matt Woodrow
4703f7d898 Bug 1617434 - Share code where possible in ClientChannelHelper. r=perry
Differential Revision: https://phabricator.services.mozilla.com/D63810

--HG--
extra : moz-landing-system : lando
2020-03-04 02:51:49 +00:00
Matt Woodrow
17729d1ea4 Bug 1617434 - Simplify ClientChannelHelperChild. r=perry
Differential Revision: https://phabricator.services.mozilla.com/D63809

--HG--
extra : moz-landing-system : lando
2020-03-04 02:47:59 +00:00
Matt Woodrow
0b6366e23e Bug 1617434 - Don't recreate ClientSource when we process switch. r=perry
Now that we're guaranteed to not have an existing ClientSource in the old process, we no longer need to allocate a new ClientInfo in the new process.
This lets us just create a ClientSource around the ClientInfo already on the channel (exactly as we do for same-process loads), and we no longer need to reconcile changes with the parent.

Differential Revision: https://phabricator.services.mozilla.com/D63808

--HG--
extra : moz-landing-system : lando
2020-03-04 02:47:57 +00:00
Matt Woodrow
73d8cfc1f5 Bug 1617434 - Move reserved client creation to parent-side with DocumentChannel. r=perry
Rather than creating a ClientSource in the content process for the initial URL, this changes us to just create the ClientInfo in the parent, as we do for redirects.

Differential Revision: https://phabricator.services.mozilla.com/D63807

--HG--
extra : moz-landing-system : lando
2020-03-01 04:14:00 +00:00
Matt Woodrow
6831e61636 Bug 1617434 - Split ClientChannelHelper into three separate classes instead of having a mode variable. r=perry
This should be a no-op, but should make the following changes easier to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D63805

--HG--
extra : moz-landing-system : lando
2020-03-01 04:13:06 +00:00
Dorel Luca
109ac83385 Backed out 7 changesets (bug 1617500, bug 1617789, bug 1617434) for build bustage in dom/clients/manager/ClientChannelHelper.cpp
Backed out changeset 1a62904bfcb7 (bug 1617500)
Backed out changeset 592a5ddf6acf (bug 1617789)
Backed out changeset 995edb2e7f98 (bug 1617789)
Backed out changeset f3518664d654 (bug 1617789)
Backed out changeset 98ea95f7fe87 (bug 1617789)
Backed out changeset c5f1f70efb88 (bug 1617434)
Backed out changeset 1563faa24d15 (bug 1617434)
2020-03-01 05:57:57 +02:00
Matt Woodrow
78a45f7c57 Bug 1617434 - Move reserved client creation to parent-side with DocumentChannel. r=perry
Rather than creating a ClientSource in the content process for the initial URL, this changes us to just create the ClientInfo in the parent, as we do for redirects.

Differential Revision: https://phabricator.services.mozilla.com/D63807

--HG--
extra : moz-landing-system : lando
2020-03-01 01:23:18 +00:00