Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '21-x-y' into trop/21-x-y-bp-feat-allow-custom-v8-snapsh…
…ots-to-be-used-in-the-main-process-and-the-default-snapshot-in-the-renderer-process-1663273306165
- Loading branch information
Showing
30 changed files
with
342 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14 | ||
16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
21.0.0-beta.5 | ||
21.0.0-beta.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ | |
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"rules": { | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"paths": [ | ||
"electron", | ||
"electron/main", | ||
"electron/renderer" | ||
], | ||
"patterns": [ | ||
"./*", | ||
"../*", | ||
"@electron/internal/browser/*", | ||
"@electron/internal/isolated_renderer/*", | ||
"@electron/internal/renderer/*", | ||
"@electron/internal/sandboxed_worker/*", | ||
"@electron/internal/worker/*" | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"rules": { | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"paths": [ | ||
"electron", | ||
"electron/main" | ||
], | ||
"patterns": [ | ||
"./*", | ||
"../*", | ||
"@electron/internal/browser/*" | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"rules": { | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"paths": [ | ||
"electron", | ||
"electron/main" | ||
], | ||
"patterns": [ | ||
"./*", | ||
"../*", | ||
"@electron/internal/browser/*" | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"rules": { | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"paths": [ | ||
"electron", | ||
"electron/main" | ||
], | ||
"patterns": [ | ||
"./*", | ||
"../*", | ||
"@electron/internal/browser/*" | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"rules": { | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"paths": [ | ||
"electron", | ||
"electron/main" | ||
], | ||
"patterns": [ | ||
"./*", | ||
"../*", | ||
"@electron/internal/browser/*" | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Shelley Vohr <shelley.vohr@gmail.com> | ||
Date: Mon, 29 Aug 2022 11:44:57 +0200 | ||
Subject: fix: crash loading non-standard schemes in iframes | ||
|
||
This fixes a crash that occurs when loading non-standard schemes from | ||
iframes or webviews. This was happening because | ||
ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin contains explicit | ||
exceptions to allow built-in non-standard schemes, but does not check | ||
for non-standard schemes registered by the embedder. | ||
|
||
Upstream, https://bugs.chromium.org/p/chromium/issues/detail?id=1081397 | ||
contains several paths forward - here I chose to swap out the | ||
CHECK in navigation_request.cc from policy->CanAccessDataForOrigin to | ||
policy->CanCommitOriginAndUrl. | ||
|
||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266. | ||
|
||
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc | ||
index 37434a26db44ed035fcbebd9febbda10efa859da..060b310d38db85944e37b8a202493212106d8946 100644 | ||
--- a/content/browser/renderer_host/navigation_request.cc | ||
+++ b/content/browser/renderer_host/navigation_request.cc | ||
@@ -6573,10 +6573,11 @@ std::pair<url::Origin, std::string> NavigationRequest:: | ||
if (IsForMhtmlSubframe()) | ||
return origin_with_debug_info; | ||
|
||
- int process_id = GetRenderFrameHost()->GetProcess()->GetID(); | ||
- auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); | ||
- CHECK( | ||
- policy->CanAccessDataForOrigin(process_id, origin_with_debug_info.first)); | ||
+ CanCommitStatus can_commit = GetRenderFrameHost()->CanCommitOriginAndUrl( | ||
+ origin_with_debug_info.first, GetURL(), IsSameDocument(), IsPdf(), | ||
+ GetUrlInfo().is_sandboxed); | ||
+ CHECK_EQ(CanCommitStatus::CAN_COMMIT_ORIGIN_AND_URL, can_commit); | ||
+ | ||
return origin_with_debug_info; | ||
} | ||
|
||
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h | ||
index 6aff64db8cc09f95d658fe9e0bd54c0b4c6ff433..e1dda0c951f9ea6f28b6d43ab2b9d4481f5d7773 100644 | ||
--- a/content/browser/renderer_host/render_frame_host_impl.h | ||
+++ b/content/browser/renderer_host/render_frame_host_impl.h | ||
@@ -2557,6 +2557,17 @@ class CONTENT_EXPORT RenderFrameHostImpl | ||
HandleAXEvents(tree_id, std::move(updates_and_events), reset_token); | ||
} | ||
|
||
+ // Returns whether the given origin and URL is allowed to commit in the | ||
+ // current RenderFrameHost. The |url| is used to ensure it matches the origin | ||
+ // in cases where it is applicable. This is a more conservative check than | ||
+ // RenderProcessHost::FilterURL, since it will be used to kill processes that | ||
+ // commit unauthorized origins. | ||
+ CanCommitStatus CanCommitOriginAndUrl(const url::Origin& origin, | ||
+ const GURL& url, | ||
+ bool is_same_document_navigation, | ||
+ bool is_pdf, | ||
+ bool is_sandboxed); | ||
+ | ||
protected: | ||
friend class RenderFrameHostFactory; | ||
|
||
@@ -2892,17 +2903,6 @@ class CONTENT_EXPORT RenderFrameHostImpl | ||
// relevant. | ||
void ResetWaitingState(); | ||
|
||
- // Returns whether the given origin and URL is allowed to commit in the | ||
- // current RenderFrameHost. The |url| is used to ensure it matches the origin | ||
- // in cases where it is applicable. This is a more conservative check than | ||
- // RenderProcessHost::FilterURL, since it will be used to kill processes that | ||
- // commit unauthorized origins. | ||
- CanCommitStatus CanCommitOriginAndUrl(const url::Origin& origin, | ||
- const GURL& url, | ||
- bool is_same_document_navigation, | ||
- bool is_pdf, | ||
- bool is_sandboxed); | ||
- | ||
// Returns whether a subframe navigation request should be allowed to commit | ||
// to the current RenderFrameHost. | ||
bool CanSubframeCommitOriginAndUrl(NavigationRequest* navigation_request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.