diff --git a/browser/fxr/content/fxrui.js b/browser/fxr/content/fxrui.js index 63ee22eb7ce5..4eb723d95ad0 100644 --- a/browser/fxr/content/fxrui.js +++ b/browser/fxr/content/fxrui.js @@ -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"; diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 902b8cfcb088..dc630e663d1d 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -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; @@ -1489,61 +1488,15 @@ already_AddRefed Navigator::GetVRDisplays(ErrorResult& aRv) { return nullptr; } - RefPtr browser(BrowserChild::GetFrom(mWindow)); - if (!browser) { - MOZ_ASSERT(XRE_IsParentProcess()); - FinishGetVRDisplays(true, p); - } else { - RefPtr self(this); - int browserID = browser->ChromeOuterWindowID(); - - browser->SendIsWindowSupportingWebVR(browserID)->Then( - GetCurrentThreadSerialEventTarget(), __func__, - [self, p](bool isSupported) { - self->FinishGetVRDisplays(isSupported, p); - }, - [](const mozilla::ipc::ResponseRejectReason) { - MOZ_CRASH("Failed to make IPC call to IsWindowSupportingWebVR"); - }); + // 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(); } - return p.forget(); -} - -void Navigator::FinishGetVRDisplays(bool isWebVRSupportedInwindow, Promise* p) { - if (isWebVRSupportedInwindow) { - nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(mWindow); - - // Since FinishGetVRDisplays can be called asynchronously after an IPC - // response, it's possible that the Window can be torn down before this - // call. In that case, the Window's cyclic references to VR objects are - // also torn down and should not be recreated via - // NotifyVREventListenerAdded. - if (!win->IsDying()) { - 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->MaybeRejectWithTypeError(u"Failed to find attached VR displays."); - } else { - // Succeeded, so cache the promise to resolve later - mVRGetDisplaysPromises.AppendElement(p); - } - } else { - // The Window has been torn down, so there is no further work that can - // be done. - p->MaybeRejectWithTypeError( - u"Unable to return VRDisplays for a closed window."); - } - } else { - // WebVR in this window is not supported, so resolve the promise - // with no displays available - nsTArray> vrDisplaysEmpty; - p->MaybeResolve(vrDisplaysEmpty); - } mVRGetDisplaysPromises.AppendElement(p); + return p.forget(); } void Navigator::GetActiveVRDisplays( diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index fa22c7979fc7..8c7e756c7ed0 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -179,7 +179,6 @@ class Navigator final : public nsISupports, public nsWrapperCache { void GetGamepads(nsTArray>& aGamepads, ErrorResult& aRv); GamepadServiceTest* RequestGamepadServiceTest(); already_AddRefed GetVRDisplays(ErrorResult& aRv); - void FinishGetVRDisplays(bool isWebVRSupportedInwindow, Promise* p); void GetActiveVRDisplays(nsTArray>& aDisplays) const; VRServiceTest* RequestVRServiceTest(); bool IsWebVRContentDetected() const; diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index 9508092404f6..db4130f1d2de 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -4092,7 +4092,6 @@ void nsGlobalWindowInner::DisableGamepadUpdates() { } void nsGlobalWindowInner::EnableVRUpdates() { - MOZ_ASSERT(!IsDying()); if (mHasVREvents && !mVREventObserver) { mVREventObserver = new VREventObserver(this); nsPIDOMWindowOuter* outer = GetOuterWindow(); diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index f3ee1da95b0c..5cec39318a29 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -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 diff --git a/dom/ipc/BrowserParent.h b/dom/ipc/BrowserParent.h index 1e8fad8a449e..a9389053de6e 100644 --- a/dom/ipc/BrowserParent.h +++ b/dom/ipc/BrowserParent.h @@ -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); diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index 6fb2e8b1ef1f..38747fee7591 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -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); diff --git a/gfx/vr/nsFxrCommandLineHandler.cpp b/gfx/vr/nsFxrCommandLineHandler.cpp index 94c3dad9b36d..ae09450baf47 100644 --- a/gfx/vr/nsFxrCommandLineHandler.cpp +++ b/gfx/vr/nsFxrCommandLineHandler.cpp @@ -65,10 +65,6 @@ nsFxrCommandLineHandler::Handle(nsICommandLine* aCmdLine) { nsresult result = aCmdLine->HandleFlag(NS_LITERAL_STRING("fxr"), false, &handleFlagRetVal); if (result == NS_OK && handleFlagRetVal) { - if (XRE_IsParentProcess() && !XRE_IsE10sParentProcess()) { - MOZ_CRASH("--fxr not supported without e10s"); - } - aCmdLine->SetPreventDefault(true); nsCOMPtr wwatch =