Commit Graph

86 Commits

Author SHA1 Message Date
Kris Maglione
4f509ee856 Bug 1562292: Part 2c - Use BrowserContext rather than DocShell to resolve named targets. r=nika
This lets us lookup cross-process targets, but does not yet allow returning or
loading anything into them.

Differential Revision: https://phabricator.services.mozilla.com/D40500
2019-06-28 14:34:58 -07:00
Kris Maglione
b5cd69594c Bug 1562292: Part 2b - Remove unused nsPIWindowWatcher::FindItemWithName method. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D40499
2019-06-28 12:32:49 -07:00
Kris Maglione
f98ef52fa5 Bug 1562292: Part 1e - Use BrowsingContext as target in IsSandboxedFrom(). r=nika
This check always has access to an in-process DocShell which is attempting to
perform a load, but its target may often be cross-process, and have no
in-process DocShell. This patch changes the target checks to use a
BrowsingContext in a Fission-compatible way.

Differential Revision: https://phabricator.services.mozilla.com/D40496
2019-08-01 16:36:32 -07:00
Kris Maglione
7cd2a9581b Bug 1562292: Part 1d - Move OnePermittedSandboxedNavigator to BrowsingContext. r=nika
We need to be able to check the one-permitted-sandboxed-navigator from
potentially-cross-process access checks in DocShell, which means it needs to
live on BrowsingContext rather than DocShell.

Differential Revision: https://phabricator.services.mozilla.com/D40495
2019-08-01 16:22:52 -07:00
Kannan Vijayan
c110dbe443 Bug 1569262 - Rename nsIDocShellTreeItem::GetRootTreeItem to GetInProcessRootTreeItem for Fission marking. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D41064
2019-08-07 19:24:00 +00:00
Kris Maglione
dbebcfeaa8 Bug 1571272: Add missing null check. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D40672
2019-08-06 17:36:16 +00:00
Kris Maglione
7575d4eb1d Bug 1561015: Part 2 - Return BrowsingContext from openWindow2. r=bzbarsky
There are some unfortunate aspects of openWindow() and openWindow2() that make
this difficult. Namely, they sometimes return top-level chrome windows, and
sometimes a single content window from the top-level chrome window that they
open, depending on how they're called.

There really isn't any reason to return a BrowsingContext rather than a chrome
window in the former case, but there also really isn't a way to make the API
polymorphic in a way that would allow handling the two cases differently. So
at some point, the two cases should ideally be split into separate APIs rather
than separate special cases of a single API.

In the mean time, I've left openWindow() returning local mozIDOMWindowProxy
objects, since it isn't used by the DOM window.open() or openDialog() APIs,
and only updated openWindow2(). As a follow-up, we should remove both
openWindow() and openWindow2(), and replace them with openChromeWindow() and
openContentWindow() (or similar) methods which make it immediately clear what
type of window is being returned.

Differential Revision: https://phabricator.services.mozilla.com/D35689
2019-08-02 20:48:40 +00:00
Kris Maglione
1bb60064a6 Bug 1561015: Part 1 - Use BrowsingContext in window provider APIs. r=bzbarsky,mossop
This is the first step in making it possible to return remote WindowProxy
objects from window.open() and related APIs.

This patch also incidentally fixes a bug where getContentWindowOrOpenURI
returned the top-level browser window rather than the new content window when
passed OPEN_NEWWINDOW for the `aWhere` parameter. This was not the expected
behavior, and was a potentially major footgun for any new users who expected
to always get the content window for the URL they were loading, rather than
sometimes getting a chrome browser window instead.

For now, that case just returns null, which is only a minor footgun, rather
than the major one we had before.

Differential Revision: https://phabricator.services.mozilla.com/D35688
2019-08-02 20:48:33 +00:00
Tom Schuster
0700472892 Bug 1558915 - Use infallible nsIURI::SchemeIs in toolkit/ r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40323
2019-08-02 16:31:54 +00:00
Mihai Alexandru Michis
5a74ddfbef Backed out 2 changesets (bug 1558915) for causing bustages. CLOSED TREE
Backed out changeset e44c9fd81e5b (bug 1558915)
Backed out changeset 3da6e9e86be4 (bug 1558915)
2019-08-02 12:17:42 +03:00
Tom Schuster
b637c03f89 Bug 1558915 - Use infallible nsIURI::SchemeIs in toolkit/ r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40323
2019-08-02 08:54:18 +00:00
Kannan Vijayan
c690c1925f Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D39378
2019-07-26 16:48:31 +00:00
Thomas Nguyen
5a46d126ce Bug 1534681 Use ReferrerInfo class in document r=ckerschb,baku,Gijs
Also, in many place, we use document uri as referrer. It is not right
for the case srdoc iframe. We should use the last non-srdoc parent
document's uri

Differential Revision: https://phabricator.services.mozilla.com/D30191
2019-06-06 07:23:37 +00:00
Nika Layzell
071576bb6e Bug 1555850 - Get rid of nsIWindowCreator2, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D33232
2019-05-31 03:41:47 +00:00
Edgar Chen
ea9872bc1b Bug 1554122 - Rename nsAutoPopupStatePusher* to AutoPopupStatePusher; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D32457
2019-05-24 12:42:29 +00:00
Ryan Hunt
8f79ffabf2 Bug 1525720, part 13 - Stop inheriting nsIRemoteTab interface in BrowserParent. r=nika
This commit removes nsIRemoteTab as a parent class from BrowserParent,
so that BrowserHost is the only concrete implementation of nsIRemoteTab.

Some static_cast's are updated to cast to BrowserHost, and other places
have to be updated to pass a BrowserHost instead of a BrowserParent.

WindowGlobalParent had a getter to return it's managing BrowserParent
as a nsIRemoteTab. I couldn't find a use of this in-tree, so I've just
opt-ed to remove it. If there's a use-case, we can add something back
in.

Differential Revision: https://phabricator.services.mozilla.com/D31444
2019-05-08 14:34:47 -05:00
Gurzau Raul
65201d8181 Backed out 18 changesets (bug 1525720) for mass failures on Windows platform e.g ProcessPriorityManager.cpp on a CLOSED TREE.
Backed out changeset 1f2e86c2d691 (bug 1525720)
Backed out changeset 9b79caa460a0 (bug 1525720)
Backed out changeset e65cb2d4c5a5 (bug 1525720)
Backed out changeset 99f971a02d87 (bug 1525720)
Backed out changeset d25963c72ff7 (bug 1525720)
Backed out changeset 810b73719871 (bug 1525720)
Backed out changeset ee10a8254481 (bug 1525720)
Backed out changeset 1bcf9f586c55 (bug 1525720)
Backed out changeset d3b2ac8d5ca4 (bug 1525720)
Backed out changeset 697774dd8984 (bug 1525720)
Backed out changeset eadeacbe4483 (bug 1525720)
Backed out changeset 32eeee79d628 (bug 1525720)
Backed out changeset 07678a2fa9e7 (bug 1525720)
Backed out changeset 757b4f595cc4 (bug 1525720)
Backed out changeset b255e0a84e12 (bug 1525720)
Backed out changeset 9a255864f75d (bug 1525720)
Backed out changeset 5f1c1b609ec1 (bug 1525720)
Backed out changeset 00d83f1d02e0 (bug 1525720)
2019-05-23 01:57:16 +03:00
Ryan Hunt
eda6ea6e51 Bug 1525720, part 13 - Stop inheriting nsIRemoteTab interface in BrowserParent. r=nika
This commit removes nsIRemoteTab as a parent class from BrowserParent,
so that BrowserHost is the only concrete implementation of nsIRemoteTab.

Some static_cast's are updated to cast to BrowserHost, and other places
have to be updated to pass a BrowserHost instead of a BrowserParent.

WindowGlobalParent had a getter to return it's managing BrowserParent
as a nsIRemoteTab. I couldn't find a use of this in-tree, so I've just
opt-ed to remove it. If there's a use-case, we can add something back
in.

Differential Revision: https://phabricator.services.mozilla.com/D31444
2019-05-08 14:34:47 -05:00
Christoph Kerschbaumer
29451e9f5e Bug 965637: Move CSP from Principal into Client, part 1: backend changes. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D27654
2019-05-21 23:14:27 +00:00
Andrea Marchesini
5da6de5df1 Bug 1551055 - StoragePrincipal should be supported by localStorage - part 1, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D30801
2019-05-14 05:49:46 +00:00
Ciure Andrei
bf6ebec07a Backed out 3 changesets (bug 1551055) for causing xpcshell localStorage perma failures CLOSED TREE
Backed out changeset 21e44ad9c6df (bug 1551055)
Backed out changeset 8727e61ab69b (bug 1551055)
Backed out changeset d99a6769beb4 (bug 1551055)
2019-05-13 22:40:22 +03:00
Andrea Marchesini
f01f7ba493 Bug 1551055 - StoragePrincipal should be supported by localStorage - part 1, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D30801
2019-05-13 18:42:36 +00:00
Ehsan Akhgari
36ed31a827 Bug 1527287 - Add support for "noreferrer" feature argument to window.open(); r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D28396
2019-04-24 20:29:19 -04:00
Ryan Hunt
6b09ea12a4 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
This commit renames TabParent to BrowserParent.

Differential Revision: https://phabricator.services.mozilla.com/D28133
2019-04-09 16:38:15 -05:00
Ryan Hunt
c6e302039f Bug 1534395 - Rename nsITabParent to nsIRemoteTab. r=nika,mconley
nsITabParent is exposed to frontend code and is generally used as a representation of a remote tab. We could just rename the interface to nsIBrowserParent and worry about it later, but I think it's better to rename the interface to nsIRemoteTab so that we can later work on splitting the interface away from the PBrowser protocol.

Note: Some frontend code refers to a TabParentId. This commit renames this to RemoteTabId. We need to figure out the purpose of TabId with fission.

Differential Revision: https://phabricator.services.mozilla.com/D28132
2019-04-09 15:59:37 -05:00
Nika Layzell
53da643c46 Bug 1542791 - Part 1: Support enabling out-of-process iframes with per-frame granularity, r=mconley
This code builds on top of the E10S "remote tabs" configuration system to add a
system for specifying that remote subframes should be used. Fission can be
enabled for a window by including the "fission" flag in options when opening
the window.

Differential Revision: https://phabricator.services.mozilla.com/D26560
2019-04-17 00:53:22 +00:00
Boris Zbarsky
24b6917568 Bug 1543564 part 3. Get rid of pointless nsPIDOMWindowOuter::GetOuterWindow method. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D27028
2019-04-11 14:14:15 +00:00
Masayuki Nakano
dbcabe5901 Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D25744
2019-04-04 00:19:48 +00:00
Razvan Maries
5e691f8a46 Backed out changeset 3b94c20ba873 (bug 1540990) for build bustages. CLOSED TREE 2019-04-04 02:44:00 +03:00
Masayuki Nakano
0fd36d1719 Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D25744
2019-04-03 23:29:38 +00:00
Masayuki Nakano
5b1ecc8b12 Bug 1540015 - part 1: Make Document.h stop including nsIPresShell.h r=smaug
If `Document::GetShell()` returns `PresShell*` rather than `nsIPresShell`, it's
a good step to deCOMTaminate `PresShell`.

This patch makes `Document.h` stop including `nsIPresShell.h` since
`nsIPresShell.h` includes `Document.h` indirectly and that causes bustage
when we make `Document::GetShell()` return `PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25332
2019-03-29 15:11:04 +00:00
Dorel Luca
6cd4166b18 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano
12b497174b Bug 1540015 - part 1: Make Document.h stop including nsIPresShell.h r=smaug
If `Document::GetShell()` returns `PresShell*` rather than `nsIPresShell`, it's
a good step to deCOMTaminate `PresShell`.

This patch makes `Document.h` stop including `nsIPresShell.h` since
`nsIPresShell.h` includes `Document.h` indirectly and that causes bustage
when we make `Document::GetShell()` return `PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25332
2019-03-29 12:12:20 +00:00
Christoph Kerschbaumer
5c9ea002ed Bug 1529893: Set correct CSP within nsWindowWatcher. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D25260
2019-03-28 19:20:00 +00:00
meandave
000f482925 Bug 1522848 - Add Lock Aspect Ratio feature. r=mconley,jmathies.
***
Bug 1522848 - Smoothing out Lock Aspect Ratio feature r?mconley.

Differential Revision: https://phabricator.services.mozilla.com/D20713
2019-03-18 20:07:31 +00:00
Christoph Kerschbaumer
bd82a2ed63 Bug 1518454: Part 1, backend changes, add CSP to loadURIOptions dictionary and pass CSP explicitly from frontend to docshell. r=bz 2019-02-21 16:00:32 +01:00
Thomas Nguyen
d13c22ef47 Bug 1517703 - Part 1 - Implement ReferrerInfo class r=smaug
The class contains original full referrer and referrer policy will be
applied to the referrer.

Differential Revision: https://phabricator.services.mozilla.com/D17923
2019-02-12 19:35:32 +00:00
Mike Conley
0d5139a916 Bug 1519893 - Add alwaysOnTop chrome-only window feature for Windows. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D16486
2019-01-15 22:29:59 +00:00
Emilio Cobos Álvarez
dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Kyle Machulis
8e9467964d Bug 1497995 - Make URI a constructor argument of nsDocShellLoadState; r=bzbarsky
We'll always need a URI for DocShellLoadState, and it should only
change is special circumstances. Construct the object with it, and
then follow up in Bug 1515433 for more cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D13490
2018-12-21 20:17:43 +00:00
Andrea Marchesini
ab2f923d5e Bug 1513895 - Unify PopupBlocker algorithm in 1 single file, r=smaug 2018-12-16 10:21:16 +01:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Jonathan Kingston
1ec5d5b19b Bug 1490257 - Add in asserts for missing triggeringPrincipal. r=ckerschb
Depends on D10884

Differential Revision: https://phabricator.services.mozilla.com/D10885
2018-11-05 14:03:28 +00:00
Jonathan Kingston
03611d5588 Bug 1490257 - Add triggeringPrincipal to missing cpp loads. r=ckerschb
Depends on D10883

Differential Revision: https://phabricator.services.mozilla.com/D10884
2018-11-05 14:03:47 +00:00
Gurzau Raul
fb23268fea Backed out changeset 523ff2753dea (bug 1490257) for causing Bug 1503757 a=backout 2018-11-01 15:27:30 +02:00
Jonathan Kingston
b25eb46164 Bug 1490257 - Add asserts into loadURI where we imply SystemPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D10221
2018-10-31 18:00:40 +00:00
Kyle Machulis
05a190dd1a Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState; r=bz, nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.
2018-10-29 17:13:29 -07:00
Kyle Machulis
e37f01f866 Backed out changeset fa8487b94a38 due to a=BUSTAGE on comm-central 2018-10-29 12:28:02 -07:00
Kyle Machulis
8416fded30 Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState r=bzbarsky,nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.

Differential Revision: https://phabricator.services.mozilla.com/D6944
2018-10-26 03:50:37 +00:00
Narcis Beleuzu
28f99c035d Backed out changeset 8dd09fad1f35 (bug 1492648) for bc failures on browser_auto_close_window.js 2018-10-19 10:11:33 +03:00