зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1589913) on request from bz on a CLOSED TREE
Backed out changeset e8ee20fdf6ac (bug 1589913) Backed out changeset 12d046056948 (bug 1589913)
This commit is contained in:
Родитель
a09e970f02
Коммит
3d0252d00b
|
@ -6,7 +6,7 @@
|
||||||
/* import-globals-from common.js */
|
/* import-globals-from common.js */
|
||||||
|
|
||||||
// Configuration vars
|
// Configuration vars
|
||||||
let homeURL = "https://webxr.today/";
|
let homeURL = "https://www.mozilla.org/en-US/";
|
||||||
// Bug 1586294 - Localize the privacy policy URL (Services.urlFormatter?)
|
// Bug 1586294 - Localize the privacy policy URL (Services.urlFormatter?)
|
||||||
let privacyPolicyURL = "https://www.mozilla.org/en-US/privacy/firefox/";
|
let privacyPolicyURL = "https://www.mozilla.org/en-US/privacy/firefox/";
|
||||||
let reportIssueURL = "https://mzl.la/fxr";
|
let reportIssueURL = "https://mzl.la/fxr";
|
||||||
|
|
|
@ -1402,8 +1402,7 @@ Promise* Navigator::Share(const ShareData& aData, ErrorResult& aRv) {
|
||||||
// The spec does the "triggered by user activation" after the data checks.
|
// The spec does the "triggered by user activation" after the data checks.
|
||||||
// Unfortunately, both Chrome and Safari behave this way, so interop wins.
|
// Unfortunately, both Chrome and Safari behave this way, so interop wins.
|
||||||
// https://github.com/w3c/web-share/pull/118
|
// https://github.com/w3c/web-share/pull/118
|
||||||
if (StaticPrefs::dom_webshare_requireinteraction() &&
|
if (StaticPrefs::dom_webshare_requireinteraction() && !UserActivation::IsHandlingUserInput()) {
|
||||||
!UserActivation::IsHandlingUserInput()) {
|
|
||||||
NS_WARNING("Attempt to share not triggered by user activation");
|
NS_WARNING("Attempt to share not triggered by user activation");
|
||||||
aRv.Throw(NS_ERROR_DOM_NOT_ALLOWED_ERR);
|
aRv.Throw(NS_ERROR_DOM_NOT_ALLOWED_ERR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -1481,47 +1480,22 @@ already_AddRefed<Promise> Navigator::GetVRDisplays(ErrorResult& aRv) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(mWindow);
|
||||||
|
win->NotifyVREventListenerAdded();
|
||||||
|
|
||||||
RefPtr<Promise> p = Promise::Create(mWindow->AsGlobal(), aRv);
|
RefPtr<Promise> p = Promise::Create(mWindow->AsGlobal(), aRv);
|
||||||
if (aRv.Failed()) {
|
if (aRv.Failed()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Navigator> self(this);
|
// We pass mWindow's id to RefreshVRDisplays, so NotifyVRDisplaysUpdated will
|
||||||
#ifndef MOZ_WIDGET_ANDROID
|
// be called asynchronously, resolving the promises in mVRGetDisplaysPromises.
|
||||||
RefPtr<BrowserChild> browser(BrowserChild::GetFrom(mWindow));
|
if (!VRDisplay::RefreshVRDisplays(win->WindowID())) {
|
||||||
int browserID = browser->ChromeOuterWindowID();
|
p->MaybeReject(NS_ERROR_FAILURE);
|
||||||
|
return p.forget();
|
||||||
browser->SendIsWindowSupportingWebVR(browserID)->Then(
|
}
|
||||||
GetCurrentThreadSerialEventTarget(), __func__,
|
|
||||||
[self, p](bool isSupportedLambda) {
|
|
||||||
if (isSupportedLambda) {
|
|
||||||
#endif
|
|
||||||
nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(self->mWindow);
|
|
||||||
win->NotifyVREventListenerAdded();
|
|
||||||
// We pass mWindow's id to RefreshVRDisplays, so
|
|
||||||
// NotifyVRDisplaysUpdated will be called asynchronously, resolving
|
|
||||||
// the promises in mVRGetDisplaysPromises.
|
|
||||||
if (!VRDisplay::RefreshVRDisplays(win->WindowID())) {
|
|
||||||
// Failed to refresh, reject the promise now
|
|
||||||
p->MaybeReject(NS_ERROR_FAILURE);
|
|
||||||
} else {
|
|
||||||
// Succeeded, so cache the promise to resolve later
|
|
||||||
|
|
||||||
self->mVRGetDisplaysPromises.AppendElement(p);
|
|
||||||
}
|
|
||||||
#ifndef MOZ_WIDGET_ANDROID
|
|
||||||
} else {
|
|
||||||
// WebVR in this window is not supported, so resolve the promise
|
|
||||||
// with no displays available
|
|
||||||
nsTArray<RefPtr<VRDisplay>> vrDisplaysEmpty;
|
|
||||||
p->MaybeResolve(vrDisplaysEmpty);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[](const mozilla::ipc::ResponseRejectReason) {
|
|
||||||
MOZ_CRASH("Failed to make IPC call to IsWindowSupportingWebVR");
|
|
||||||
});
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
mVRGetDisplaysPromises.AppendElement(p);
|
||||||
return p.forget();
|
return p.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3996,19 +3996,5 @@ mozilla::ipc::IPCResult BrowserParent::RecvIsWindowSupportingProtectedMedia(
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::ipc::IPCResult BrowserParent::RecvIsWindowSupportingWebVR(
|
|
||||||
const uint64_t& aOuterWindowID,
|
|
||||||
IsWindowSupportingWebVRResolver&& aResolve) {
|
|
||||||
#ifdef XP_WIN
|
|
||||||
bool isFxrWindow =
|
|
||||||
FxRWindowManager::GetInstance()->IsFxRWindow(aOuterWindowID);
|
|
||||||
aResolve(!isFxrWindow);
|
|
||||||
#else
|
|
||||||
aResolve(true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return IPC_OK();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -507,10 +507,6 @@ class BrowserParent final : public PBrowserParent,
|
||||||
const uint64_t& aOuterWindowID,
|
const uint64_t& aOuterWindowID,
|
||||||
IsWindowSupportingProtectedMediaResolver&& aResolve);
|
IsWindowSupportingProtectedMediaResolver&& aResolve);
|
||||||
|
|
||||||
mozilla::ipc::IPCResult RecvIsWindowSupportingWebVR(
|
|
||||||
const uint64_t& aOuterWindowID,
|
|
||||||
IsWindowSupportingWebVRResolver&& aResolve);
|
|
||||||
|
|
||||||
void LoadURL(nsIURI* aURI);
|
void LoadURL(nsIURI* aURI);
|
||||||
|
|
||||||
void ResumeLoad(uint64_t aPendingSwitchID);
|
void ResumeLoad(uint64_t aPendingSwitchID);
|
||||||
|
|
|
@ -1035,11 +1035,6 @@ parent:
|
||||||
*/
|
*/
|
||||||
async IsWindowSupportingProtectedMedia(uint64_t aOuterWindowID) returns(bool isSupported);
|
async IsWindowSupportingProtectedMedia(uint64_t aOuterWindowID) returns(bool isSupported);
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetches whether this window supports WebVR, which is sent back in response.
|
|
||||||
*/
|
|
||||||
async IsWindowSupportingWebVR(uint64_t aOuterWindowID) returns(bool isSupported);
|
|
||||||
|
|
||||||
/** Records a history visit. */
|
/** Records a history visit. */
|
||||||
async VisitURI(URIParams aURI, URIParams? aLastVisitedURI,
|
async VisitURI(URIParams aURI, URIParams? aLastVisitedURI,
|
||||||
uint32_t aFlags);
|
uint32_t aFlags);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче