Bug 1524065 - part1 : implement the way to resume delayed autoplay media via browsing context. r=farre

After enable Fission, we're not able to resume media in the different process, because the current way we use can only notify one process and would cause the media on other process can't be resumed.

Therefore, we should use the browsing context to notify the web content which might be on different processes.

Differential Revision: https://phabricator.services.mozilla.com/D18136
This commit is contained in:
Alastor Wu
2019-03-20 03:15:36 +00:00
parent 52785f2bef
commit 4f26766702
10 changed files with 93 additions and 0 deletions

View File

@@ -985,6 +985,15 @@ nsDocShell::DispatchLocationChangeEvent() {
&nsDocShell::FireDummyOnLocationChange));
}
NS_IMETHODIMP
nsDocShell::StartDelayedAutoplayMediaComponents() {
RefPtr<nsPIDOMWindowOuter> outerWindow = GetWindow();
if (outerWindow) {
outerWindow->SetMediaSuspend(nsISuspendedTypes::NONE_SUSPENDED);
}
return NS_OK;
}
bool nsDocShell::MaybeInitTiming() {
if (mTiming && !mBlankTiming) {
return false;