зеркало из 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 */
|
||||
|
||||
// Configuration vars
|
||||
let homeURL = "https://webxr.today/";
|
||||
let homeURL = "https://www.mozilla.org/en-US/";
|
||||
// Bug 1586294 - Localize the privacy policy URL (Services.urlFormatter?)
|
||||
let privacyPolicyURL = "https://www.mozilla.org/en-US/privacy/firefox/";
|
||||
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.
|
||||
// Unfortunately, both Chrome and Safari behave this way, so interop wins.
|
||||
// https://github.com/w3c/web-share/pull/118
|
||||
if (StaticPrefs::dom_webshare_requireinteraction() &&
|
||||
!UserActivation::IsHandlingUserInput()) {
|
||||
if (StaticPrefs::dom_webshare_requireinteraction() && !UserActivation::IsHandlingUserInput()) {
|
||||
NS_WARNING("Attempt to share not triggered by user activation");
|
||||
aRv.Throw(NS_ERROR_DOM_NOT_ALLOWED_ERR);
|
||||
return nullptr;
|
||||
|
@ -1481,47 +1480,22 @@ already_AddRefed<Promise> Navigator::GetVRDisplays(ErrorResult& aRv) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(mWindow);
|
||||
win->NotifyVREventListenerAdded();
|
||||
|
||||
RefPtr<Promise> p = Promise::Create(mWindow->AsGlobal(), aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Navigator> self(this);
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
RefPtr<BrowserChild> browser(BrowserChild::GetFrom(mWindow));
|
||||
int browserID = browser->ChromeOuterWindowID();
|
||||
|
||||
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
|
||||
// We pass mWindow's id to RefreshVRDisplays, so NotifyVRDisplaysUpdated will
|
||||
// be called asynchronously, resolving the promises in mVRGetDisplaysPromises.
|
||||
if (!VRDisplay::RefreshVRDisplays(win->WindowID())) {
|
||||
p->MaybeReject(NS_ERROR_FAILURE);
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
mVRGetDisplaysPromises.AppendElement(p);
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -3996,19 +3996,5 @@ mozilla::ipc::IPCResult BrowserParent::RecvIsWindowSupportingProtectedMedia(
|
|||
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 mozilla
|
||||
|
|
|
@ -507,10 +507,6 @@ class BrowserParent final : public PBrowserParent,
|
|||
const uint64_t& aOuterWindowID,
|
||||
IsWindowSupportingProtectedMediaResolver&& aResolve);
|
||||
|
||||
mozilla::ipc::IPCResult RecvIsWindowSupportingWebVR(
|
||||
const uint64_t& aOuterWindowID,
|
||||
IsWindowSupportingWebVRResolver&& aResolve);
|
||||
|
||||
void LoadURL(nsIURI* aURI);
|
||||
|
||||
void ResumeLoad(uint64_t aPendingSwitchID);
|
||||
|
|
|
@ -1035,11 +1035,6 @@ parent:
|
|||
*/
|
||||
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. */
|
||||
async VisitURI(URIParams aURI, URIParams? aLastVisitedURI,
|
||||
uint32_t aFlags);
|
||||
|
|
Загрузка…
Ссылка в новой задаче