New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use appropriate site instance for cross-site nav's #15821
Merged
zcbenz
merged 19 commits into
electron:master
from
ppontes:ppontes/8100-use-proper-site-instance-candidate
Dec 5, 2018
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cb2d31c
fix: use Chromium's determined new site instance as candidate when na…
ppontes 7530af6
Revert "fix: use Chromium's determined new site instance as candidate…
ppontes 6e03731
fix: delegate site instance creation back to content when sandboxed.
ppontes 694e51b
fix: ensure site isolation is on
ppontes bd857e9
test: adapt ut for cross-site navigation
ppontes e799fe0
fix: register pending processes during a navigation.
ppontes 9271a39
refactor: dont call loadURL for a window constructed from an existing…
ppontes 5aae695
test: add sandboxed affinity UT's.
ppontes 2225c0b
fix: check affinity before deciding if to force a new site instance.
ppontes 6d02359
chore: adapt subsequent patch.
ppontes f85ad5c
refactor: constify logically const methods.
ppontes 220b722
fix: do not reuse site instances when navigation redirects cross-site.
ppontes f4e3036
test: ensure localStorage accessible after x-site redirect.
ppontes c30f003
test: adapt localStorage acess denied UT for site isolation.
ppontes d8d16a5
fix: do not send render-view-deleted for speculative frames.
ppontes 9829b19
chore: amend tests after rebase.
ppontes c56311f
test: add ut for webContents' render-view-deleted emission
ppontes 14daf67
fix: introduce current-render-view-deleted for current RVH's deletions.
ppontes 8b4e030
refactor: style and comments fixed.
ppontes File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
|
@@ -781,8 +781,29 @@ void WebContents::RenderViewCreated(content::RenderViewHost* render_view_host) { | |
impl->disable_hidden_ = !background_throttling_; | ||
} | ||
|
||
void WebContents::RenderViewHostChanged(content::RenderViewHost* old_host, | ||
content::RenderViewHost* new_host) { | ||
currently_committed_process_id_ = new_host->GetProcess()->GetID(); | ||
} | ||
|
||
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) { | ||
// This event is necessary for tracking any states with respect to | ||
// intermediate render view hosts aka speculative render view hosts. Currently | ||
// used by object-registry.js to ref count remote objects. | ||
Emit("render-view-deleted", render_view_host->GetProcess()->GetID()); | ||
|
||
if (-1 == currently_committed_process_id_ || | ||
render_view_host->GetProcess()->GetID() == | ||
currently_committed_process_id_) { | ||
currently_committed_process_id_ = -1; | ||
|
||
// When the RVH that has been deleted is the current RVH it means that the | ||
// the web contents are being closed. This is communicated by this event. | ||
// Currently tracked by guest-window-manager.js to destroy the | ||
// BrowserWindow. | ||
Emit("current-render-view-deleted", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better name for this event? |
||
render_view_host->GetProcess()->GetID()); | ||
} | ||
} | ||
|
||
void WebContents::RenderProcessGone(base::TerminationStatus status) { | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little comment stating that this event is necessary for tracking any states with respect to intermediate render view hosts aka speculative render view hosts. Currently used by
object-registry.js
to ref count remote objects.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added.