Commit Graph

7058 Commits

Author SHA1 Message Date
Jean-Yves Avenard
fc71e1daf1 Bug 1637869 - P4. Access pref via staticpref. r=mattwoodrow,necko-reviewers
It would otherwise triggers browser/base/content/test/performance/browser_preferences_usage.js

That pref would have been checked with every single load, a staticpref is O-1 .

Differential Revision: https://phabricator.services.mozilla.com/D76317
2020-05-28 04:07:15 +00:00
Jean-Yves Avenard
da36716654 Bug 1637869 - P3. Force about:credits to load in the content process. r=nika
It was apparently overlooked.

Yours truly doesn't even appear on that list :(

Differential Revision: https://phabricator.services.mozilla.com/D76316
2020-05-28 00:07:46 +00:00
Jean-Yves Avenard
66a61d942d Bug 1637869 - P2. Allow ParentProcessDocumentChannel to perform process switching. r=nika,mattwoodrow
The moves all decisions to perform a process switch into the DocumentLoadListerner. This removes the unnecessary need to go via a content process to start the load.

Differential Revision: https://phabricator.services.mozilla.com/D76315
2020-05-28 00:07:39 +00:00
Tom Tung
839aba3410 Bug 1601594 - Move CrossOriginIsolated from nsGlobalWindowInner to BrowsingContext; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D75131
2020-05-25 12:51:53 +00:00
Razvan Maries
a985167fa6 Backed out 7 changesets (bug 1638711) for perma failures on test_bug375314-2.html. CLOSED TREE
Backed out changeset 9643bf18ac31 (bug 1638711)
Backed out changeset 3d06b48e2e3a (bug 1638711)
Backed out changeset c2a1461890c3 (bug 1638711)
Backed out changeset 9eda9f6c5877 (bug 1638711)
Backed out changeset f776c30279f3 (bug 1638711)
Backed out changeset b34546384903 (bug 1638711)
Backed out changeset 47da03dd8365 (bug 1638711)
2020-05-28 04:25:38 +03:00
Matt Woodrow
e773557320 Bug 1638711 - Call DisplayLoadError for NS_ERROR_CONTENT_BLOCKED during EndPageLoad, since we would also have done this for the same error during AsyncOpen. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D77171
2020-05-28 00:10:47 +00:00
Erica Wright
2533f8da77 Bug 1636962 - Add telemetry for all page load errors r=johannh,xeonchen,nika
Differential Revision: https://phabricator.services.mozilla.com/D75873
2020-05-27 22:33:02 +00:00
Marco Bonardo
e8fd1b7c50 Bug 1398567 - Invert URIFixup default behavior to search unless the string looks like a URI. r=Gijs
With recent fixes that can properly identify whitelisted domains, whitelisted
domain suffixed, valid known public suffixes, and forcing to visit URI-like
strings that end with a slash, it's time to re-evaluate the URIFixup behavior.
Until now URIFixup considered everything a URI unless it had specific search
characteristics, this patch inverts that behavior.
The scope of this change is to improve the urlbar behavior as the main Search
Access Point, since that's the direction we're moving towards.

This lands with a temporary hidden feature pref browser.fixup.defaultToSearch,
that will be removed once the feature has been released.

Differential Revision: https://phabricator.services.mozilla.com/D76852
2020-05-27 16:55:14 +00:00
Matt Woodrow
5cf1f845a8 Bug 1631405 - Update tests to account for security UI only living in the parent process. r=kmag,ckerschb,webcompat-reviewers,twisniewski
This is mostly changes to handle retrieving the security state asynchronously via the parent process, needing lots of async/await additions.

It also removes the docshell mixed content flag checks (which don't seem to be used in code, only tests), which are mostly still covered by checks of the security UI.

Differential Revision: https://phabricator.services.mozilla.com/D75448
2020-05-27 00:31:25 +00:00
Matt Woodrow
e060a86c42 Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
This removes all docshell nsISecureBrowserUI and mixed content properties, and moves them into CanonicalBrowsingContext/WindowGlobalParent. It makes the mixed content blocker just compute the state for the current load, and then send the results to the parent process, where we update the security state accordingly.

I think we could in the future remove onSecurityChange entirely, and instead just fire an event to the <browser> element notifying it of changes to the queryable securityUI.

Unfortunately we have a lot of existing code that depends on specific ordering between onSecurityChange and onLocationChange, so I had to hook into the RemoteWebProgress implementation in BrowserParent to mimic the same timings.

Differential Revision: https://phabricator.services.mozilla.com/D75447
2020-05-27 00:28:59 +00:00
Matt Woodrow
2083b054bd Bug 1631405 - Make sure we initialize all fields of WindowGlobalParent in the constructor. r=nika
Previously we only set some fields as part of WindowGlobalInit, but WindowGlobalParent sets itself as the current window global on the CanonicalBrowsingContext.

This exposes a period of time where only part of the document state was set, and this was observable to consumers.

This makes OnNewDocument only run when there is a new Document for the same WindowGlobal.

Differential Revision: https://phabricator.services.mozilla.com/D75446
2020-05-27 00:27:30 +00:00
Bogdan Tara
a54ec3073f Backed out 4 changesets (bug 1631405) for multiple mochitest failures CLOSED TREE
Backed out changeset 9963cc0b23cb (bug 1631405)
Backed out changeset 469ac933ed7c (bug 1631405)
Backed out changeset 0c5f55864268 (bug 1631405)
Backed out changeset 20dcbcc2f3b8 (bug 1631405)
2020-05-27 01:30:20 +03:00
Matt Woodrow
d692732bdd Bug 1631405 - Update tests to account for security UI only living in the parent process. r=kmag,ckerschb,webcompat-reviewers,twisniewski
This is mostly changes to handle retrieving the security state asynchronously via the parent process, needing lots of async/await additions.

It also removes the docshell mixed content flag checks (which don't seem to be used in code, only tests), which are mostly still covered by checks of the security UI.

Differential Revision: https://phabricator.services.mozilla.com/D75448
2020-05-26 21:19:28 +00:00
Matt Woodrow
240d417eb6 Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
This removes all docshell nsISecureBrowserUI and mixed content properties, and moves them into CanonicalBrowsingContext/WindowGlobalParent. It makes the mixed content blocker just compute the state for the current load, and then send the results to the parent process, where we update the security state accordingly.

I think we could in the future remove onSecurityChange entirely, and instead just fire an event to the <browser> element notifying it of changes to the queryable securityUI.

Unfortunately we have a lot of existing code that depends on specific ordering between onSecurityChange and onLocationChange, so I had to hook into the RemoteWebProgress implementation in BrowserParent to mimic the same timings.

Differential Revision: https://phabricator.services.mozilla.com/D75447
2020-05-26 21:17:01 +00:00
Matt Woodrow
5b64e9bae2 Bug 1631405 - Make sure we initialize all fields of WindowGlobalParent in the constructor. r=nika
Previously we only set some fields as part of WindowGlobalInit, but WindowGlobalParent sets itself as the current window global on the CanonicalBrowsingContext.

This exposes a period of time where only part of the document state was set, and this was observable to consumers.

This makes OnNewDocument only run when there is a new Document for the same WindowGlobal.

Differential Revision: https://phabricator.services.mozilla.com/D75446
2020-05-26 21:15:42 +00:00
Matt Woodrow
38ffa87e05 Bug 1640160 - Serialize mRequestContextId with BrowsingContext's IPCInitializer to ensure that we don't try to create a request context with an id of 0. r=nika
This was a bit of pain to track down, because some code was allowing an ID of 0, and creating a request context to match, but other code was treating 0 as invalid.

Differential Revision: https://phabricator.services.mozilla.com/D76652
2020-05-26 21:14:27 +00:00
JulianWels
2cc2e49495 Bug 1625156 - Error page for HTTPS Only Mode. r=fluent-reviewers,ckerschb,nhnt11,flod,nika,johannh,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D72129
2020-05-26 11:45:21 +00:00
Nika Layzell
73d17519e7 Bug 1639367 - Clean up TabContext logic for PBrowser, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D76055
2020-05-21 22:38:44 +00:00
Nika Layzell
e6a9e27a19 Bug 1637088 - Delay creating BrowserBridgeChild until after new PBrowser has been created, r=farre,emilio
Differential Revision: https://phabricator.services.mozilla.com/D75614
2020-05-25 06:06:30 +00:00
Christoph Kerschbaumer
6ae4ad1947 Bug 1422284 - Upgrade insecure requests should only apply to top-level same-origin redirects. r=baku,valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D75259
2020-05-25 08:14:10 +00:00
Marco Bonardo
5a5863e4ae Bug 1636583 - Make the urlbar always go through pickResult. r=adw
This changes the urlbar to always generate a result and then confirm it through
pickResult. This way we obtain a consistent behavior independently from whether
the view has a result or an action like Paste&Go happened.
Before this we used to go through getShortcutOrURIAndPostData, that implements
only a part of the urlbar logic, often causing different behavior depending on
the view state, and thus requiring constant maintenance to sync it up.
In a follow-up bug we will evaluate the complete removal of
getShortcutOrURIAndPostData in favor of direct calls to
UrlbarUtils.getHeuristicResultFor().

This also moves up a bit closer to always pass a final url to the docshell, and
stop trying to do complex URIFixup calls in it. For now we still rely
on its fix-ups for browser.fixup.dns_first_for_single_words, where we pass a
url, and if it's invalid it will instead search. See UrlbarUtils.RESULT_TYPE.URL
handling in pickResult().

Differential Revision: https://phabricator.services.mozilla.com/D75911
2020-05-23 13:25:27 +00:00
Marco Bonardo
27e6788fd3 Bug 1636583 - URIFixup should force a visit when an uri-like search string ends with a slash. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D75910
2020-05-23 13:24:44 +00:00
Dorel Luca
86d5322893 Backed out 4 changesets (bug 1637869) for Geckoview failures in org.mozilla.geckoview.test.NavigationDelegateTest.extensionProcessSwitching. CLOSED TREE
Backed out changeset a0c0203ee8c9 (bug 1637869)
Backed out changeset 75359ba23865 (bug 1637869)
Backed out changeset d300b61ed89f (bug 1637869)
Backed out changeset 34389f9c86e4 (bug 1637869)
2020-05-22 19:38:15 +03:00
Dorel Luca
1b427eb7aa Backed out 3 changesets (bug 1636583) for Browser-chrome failures in browser/components/urlbar/tests/browser/browser_handleCommand_fallback.js. CLOSED TREE
Backed out changeset a2e636ff03c2 (bug 1636583)
Backed out changeset 660b7de89215 (bug 1636583)
Backed out changeset 9fd142817919 (bug 1636583)
2020-05-22 19:07:07 +03:00
Jean-Yves Avenard
08a8963053 Bug 1637869 - P4. Access pref via staticpref. r=mattwoodrow,necko-reviewers
It would otherwise triggers browser/base/content/test/performance/browser_preferences_usage.js

That pref would have been checked with every single load, a staticpref is O-1 .

Differential Revision: https://phabricator.services.mozilla.com/D76317
2020-05-22 04:12:42 +00:00
Jean-Yves Avenard
c94f19793d Bug 1637869 - P3. Force about:credits to load in the content process. r=nika
It was apparently overlooked.

Yours truly doesn't even appear on that list :(

Differential Revision: https://phabricator.services.mozilla.com/D76316
2020-05-22 04:12:34 +00:00
Jean-Yves Avenard
d1133de668 Bug 1637869 - P2. Allow ParentProcessDocumentChannel to perform process switching. r=nika,mattwoodrow
The moves all decisions to perform a process switch into the DocumentLoadListerner. This removes the unnecessary need to go via a content process to start the load.

Differential Revision: https://phabricator.services.mozilla.com/D76315
2020-05-22 10:28:41 +00:00
Marco Bonardo
505406e25d Bug 1636583 - Make the urlbar always go through pickResult. r=adw
This changes the urlbar to always generate a result and then confirm it through
pickResult. This way we obtain a consistent behavior independently from whether
the view has a result or an action like Paste&Go happened.
Before this we used to go through getShortcutOrURIAndPostData, that implements
only a part of the urlbar logic, often causing different behavior depending on
the view state, and thus requiring constant maintenance to sync it up.
In a follow-up bug we will evaluate the complete removal of
getShortcutOrURIAndPostData in favor of direct calls to
UrlbarUtils.getHeuristicResultFor().

This also moves up a bit closer to always pass a final url to the docshell, and
stop trying to do complex URIFixup calls in it. For now we still rely
on its fix-ups for browser.fixup.dns_first_for_single_words, where we pass a
url, and if it's invalid it will instead search. See UrlbarUtils.RESULT_TYPE.URL
handling in pickResult().

Differential Revision: https://phabricator.services.mozilla.com/D75911
2020-05-21 15:00:08 +00:00
Marco Bonardo
36118c93a3 Bug 1636583 - URIFixup should force a visit when an uri-like search string ends with a slash. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D75910
2020-05-21 14:58:15 +00:00
Barret Rennie
f5258e1188 Bug 1603185 - Collect per tab unique site origin telemetry r=Dexter,Gijs,nika
Top-level content WindowGlobalParents now keep track of the site origins of the
documents in their document tree. When the WindowGlobalParent is torn down, the
maximum of the number of unique site origins is submitted for telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D71493
2020-05-22 00:34:17 +00:00
Sid Stamm
a69fe1db1b Bug 1002724 - Test that HTTPS is tried if typed host name doesn't respond via HTTP. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D75085
2020-05-21 17:33:30 +00:00
Sid Stamm
935f681bed Bug 1002724 - add pref for fallback to https. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D75084
2020-05-21 17:33:27 +00:00
Sid Stamm
c90deaa1bc Bug 1002724 - try https if http connections are rejected. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D75083
2020-05-21 17:33:23 +00:00
Matt Woodrow
b7105cc963 Bug 1627533 - Create LoadGroups for docshells using the BrowsingContext's request context id. r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D75885
2020-05-21 03:38:37 +00:00
Matt Woodrow
56206beda8 Bug 1627533 - Create a request context id for each BrowsingContext. r=nika,dragana,necko-reviewers
Previously we created a new request context id for each LoadGroup, which meant we didn't have a constant value across process switches.
The next patch uses this request context id when creating a new LoadGroup for an nsDocShell, so that all docshell/loadgroups for a BrowsingContext share the same id.

Differential Revision: https://phabricator.services.mozilla.com/D75884
2020-05-21 03:38:14 +00:00
Noemi Erli
3adaaeb800 Backed out 3 changesets (bug 1627533) for causing assertions in RequestContextService.cpp CLOSED TREE
Backed out changeset 3b35a1852a60 (bug 1627533)
Backed out changeset 70fa5e075269 (bug 1627533)
Backed out changeset 0d1046670534 (bug 1627533)
2020-05-21 04:16:21 +03:00
Matt Woodrow
f8b14e22ba Bug 1627533 - Create LoadGroups for docshells using the BrowsingContext's request context id. r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D75885
2020-05-20 23:41:36 +00:00
Matt Woodrow
d958cab047 Bug 1627533 - Create a request context id for each BrowsingContext. r=nika,dragana,necko-reviewers
Previously we created a new request context id for each LoadGroup, which meant we didn't have a constant value across process switches.
The next patch uses this request context id when creating a new LoadGroup for an nsDocShell, so that all docshell/loadgroups for a BrowsingContext share the same id.

Differential Revision: https://phabricator.services.mozilla.com/D75884
2020-05-20 23:41:13 +00:00
Peter Van der Beken
2c8f84716d Bug 1570255 - Forward ChildSHistory::Go to the parent. r=smaug
This enables navigating by index in session history go through the
session history in the parent (if enabled with the pref).

If the pref is enabled, then ChildSHistory::Go will send an IPC message
to the parent with the index to navigate to. The parent calls the
existing nsSHistory implementation and starts the loads, and
asynchronously returns the index that we actually navigated to. The
child process then uses that result to update the session history
implementation in the child process (this part is temporary, while we
have session history both in parent and in child). We also make the
parent send an updated length to the child process over IPC, so that
history.length always the length for the implementation in the parent.

Differential Revision: https://phabricator.services.mozilla.com/D65330
2020-05-20 09:15:31 +00:00
Peter Van der Beken
f38cc0e952 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-20 09:09:12 +00:00
Peter Van der Beken
1990918ebe Bug 1570255 - Remove sync session history implementation. r=smaug,nika
Differential Revision: https://phabricator.services.mozilla.com/D65326
2020-05-20 09:09:06 +00:00
Tom Tung
d9d34b2983 Bug 1605176 - Send a error message data and cause a message error on the receiver side when the message data contains a shared memory object in BrowsingContext::PostMessageMoz; r=baku,kmag
Differential Revision: https://phabricator.services.mozilla.com/D75035
2020-05-20 08:27:16 +00:00
Tim Huang
f522897351 Bug 1639195 - Part 2: Add a test. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75966
2020-05-19 18:59:36 +00:00
Dan Glastonbury
b4dde7ce2a Bug 1633459 - Marshal customUserAgent setting via nsDocShell. r=geckoview-reviewers,esawin,nika
Reinstate customUserAgent interface for nsIDocShell. This is so it can be used
as a choke-point to catch setting values on docshells which are in the process
of changing process. We don't want to send changes which will be rejected on the
parent side.

This code should be removed once callers setting customUserAgent are refactored
to only occur from parent process.

Differential Revision: https://phabricator.services.mozilla.com/D75006
2020-05-20 00:19:59 +00:00
Nika Layzell
6d57f777b5 Bug 1637057 - Part 1: Ensure that ChromeFlags are propagated consistently between content owners, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D75610
2020-05-18 18:23:35 +00:00
Peter Van der Beken
ef557497ca Bug 1629866 - Store ChildSHistory on the BrowsingContext. r=nika,smaug
Differential Revision: https://phabricator.services.mozilla.com/D70997
2020-05-19 08:57:44 +00:00
Peter Van der Beken
2edf11cb1e Bug 1629866 - Set the srcdoc to a void string if INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, to appease assertion in DocumentChannelChild::RecvRedirectToRealChannel. r=mattwoodrow
Bug 1598523 added an assertion that if INTERNAL_LOAD_FLAGS_IS_SRCDOC is not set
in a load state's load flags, then the srcdoc must be a void string.
nsDocShell::Reload never set srcdoc to a void string in that case, and wasn't
fixed up.

Differential Revision: https://phabricator.services.mozilla.com/D75908
2020-05-19 20:11:44 +00:00
Noemi Erli
c1cca03e21 Backed out 6 changesets (bug 1002724) for failing in browser_fall_back_to_https.js CLOSED TREE
Backed out changeset e487b4cd9223 (bug 1002724)
Backed out changeset 37473a8ba1fd (bug 1002724)
Backed out changeset e868f1e0af0e (bug 1002724)
Backed out changeset 1c57f8717b15 (bug 1002724)
Backed out changeset 782808a05ff8 (bug 1002724)
Backed out changeset c60c48d170e1 (bug 1002724)
2020-05-18 19:22:19 +03:00
Sid Stamm
4f2852cbc8 Bug 1002724 - Test that HTTPS is tried if typed host name doesn't respond via HTTP. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D75085
2020-05-18 15:08:32 +00:00
Sid Stamm
485d080bae Bug 1002724 - add pref for fallback to https. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D75084
2020-05-18 15:08:24 +00:00