Backed out 2 changesets (bug 1501869) for causing wpt failures on webvr-enabled-by-feature-policy-attribute-redirect-on-load

Backed out changeset 56896b0e10d3 (bug 1501869)
Backed out changeset cdb87cbfe882 (bug 1501869)
This commit is contained in:
Cosmin Sabou 2018-10-27 00:51:10 +03:00
parent f95f851da5
commit fbde123ca1
13 changed files with 5 additions and 111 deletions

View File

@ -4446,22 +4446,6 @@ nsGlobalWindowInner::ResetVRTelemetry(bool aUpdate)
}
}
void
nsGlobalWindowInner::StartVRActivity()
{
if (mVREventObserver) {
mVREventObserver->StartActivity();
}
}
void
nsGlobalWindowInner::StopVRActivity()
{
if (mVREventObserver) {
mVREventObserver->StopActivity();
}
}
#ifndef XP_WIN // This guard should match the guard at the callsite.
static bool ShouldShowFocusRingIfFocusedByMouse(nsIContent* aNode)
{

View File

@ -559,9 +559,6 @@ public:
// false for only resetting the timestamp.
void ResetVRTelemetry(bool aUpdate);
void StartVRActivity();
void StopVRActivity();
// Update the VR displays for this window
bool UpdateVRDisplays(nsTArray<RefPtr<mozilla::dom::VRDisplay>>& aDisplays);

View File

@ -6635,7 +6635,6 @@ nsGlobalWindowOuter::SetIsBackground(bool aIsBackground)
// the background window.
if (inner && changed) {
inner->StopGamepadHaptics();
inner->StopVRActivity();
// true is for asking to set the delta time to
// the telemetry.
inner->ResetVRTelemetry(true);
@ -6648,7 +6647,6 @@ nsGlobalWindowOuter::SetIsBackground(bool aIsBackground)
// false is for only resetting the timestamp.
inner->ResetVRTelemetry(false);
inner->SyncGamepadState();
inner->StartVRActivity();
}
}

View File

@ -26,7 +26,6 @@ VREventObserver::VREventObserver(nsGlobalWindowInner* aGlobalWindow)
: mWindow(aGlobalWindow)
, mIs2DView(true)
, mHasReset(false)
, mStopActivity(false)
{
MOZ_ASSERT(aGlobalWindow);
@ -56,7 +55,6 @@ VREventObserver::DisconnectFromOwner()
VRManagerChild* vmc = VRManagerChild::Get();
vmc->RemoveListener(this);
}
mStopActivity = true;
}
void
@ -79,28 +77,6 @@ VREventObserver::UpdateSpentTimeIn2DTelemetry(bool aUpdate)
}
}
void
VREventObserver::StartActivity()
{
mStopActivity = false;
VRManagerChild* vmc = VRManagerChild::Get();
vmc->StartActivity();
}
void
VREventObserver::StopActivity()
{
mStopActivity = true;
VRManagerChild* vmc = VRManagerChild::Get();
vmc->StopActivity();
}
bool
VREventObserver::GetStopActivityStatus()
{
return mStopActivity;
}
void
VREventObserver::NotifyAfterLoad()
{

View File

@ -33,9 +33,6 @@ public:
void DisconnectFromOwner();
void UpdateSpentTimeIn2DTelemetry(bool aUpdate);
void StartActivity();
void StopActivity();
bool GetStopActivityStatus();
private:
~VREventObserver();
@ -46,7 +43,6 @@ private:
TimeStamp mSpendTimeIn2DView;
bool mIs2DView;
bool mHasReset;
bool mStopActivity;
};
} // namespace dom

View File

@ -166,6 +166,7 @@ VRManager::Shutdown()
void
VRManager::Init()
{
StartTasks();
mInitialized = true;
}
@ -446,7 +447,6 @@ VRManager::NotifyVRVsync(const uint32_t& aDisplayID)
void
VRManager::EnumerateVRDisplays()
{
StartTasks();
/**
* Throttle the rate of enumeration to the interval set in
* VRDisplayEnumerateInterval

View File

@ -67,8 +67,6 @@ parent:
async NewPoseMoveToMockController(uint32_t aDeviceID, GamepadPoseState aPose);
async StartVRNavigation(uint32_t aDeviceID);
async StopVRNavigation(uint32_t aDeviceID, TimeDuration aDuration);
async StartActivity();
async StopActivity();
child:
// Notify children of updated VR display enumeration and details. This will

View File

@ -618,25 +618,6 @@ VRManagerChild::RemoveListener(dom::VREventObserver* aObserver)
}
}
void
VRManagerChild::StartActivity()
{
Unused << SendStartActivity();
}
void
VRManagerChild::StopActivity()
{
for (auto& listener : mListeners) {
if (!listener->GetStopActivityStatus()) {
// We are still showing VR in the active window.
return;
}
}
Unused << SendStopActivity();
}
void
VRManagerChild::HandleFatalError(const char* aMsg) const
{

View File

@ -42,8 +42,6 @@ public:
void AddListener(dom::VREventObserver* aObserver);
// Indicate that an observer should no longer receive VR events.
void RemoveListener(dom::VREventObserver* aObserver);
void StartActivity();
void StopActivity();
bool GetVRDisplays(nsTArray<RefPtr<VRDisplayClient> >& aDisplays);
bool RefreshVRDisplaysWithCallback(uint64_t aWindowId);

View File

@ -24,7 +24,6 @@ VRManagerParent::VRManagerParent(ProcessId aChildProcessId, bool aIsContentChild
, mHaveEventListener(false)
, mHaveControllerListener(false)
, mIsContentChild(aIsContentChild)
, mVRActiveStatus(true)
{
MOZ_COUNT_CTOR(VRManagerParent);
MOZ_ASSERT(NS_IsMainThread());
@ -205,10 +204,6 @@ VRManagerParent::RecvSetGroupMask(const uint32_t& aDisplayID, const uint32_t& aG
bool
VRManagerParent::HaveEventListener()
{
if (!mVRActiveStatus) {
return false;
}
return mHaveEventListener;
}
@ -218,12 +213,6 @@ VRManagerParent::HaveControllerListener()
return mHaveControllerListener;
}
bool
VRManagerParent::GetVRActiveStatus()
{
return mVRActiveStatus;
}
mozilla::ipc::IPCResult
VRManagerParent::RecvSetHaveEventListener(const bool& aHaveEventListener)
{
@ -480,19 +469,5 @@ VRManagerParent::RecvStopVRNavigation(const uint32_t& aDeviceID, const TimeDurat
return IPC_OK();
}
mozilla::ipc::IPCResult
VRManagerParent::RecvStartActivity()
{
mVRActiveStatus = true;
return IPC_OK();
}
mozilla::ipc::IPCResult
VRManagerParent::RecvStopActivity()
{
mVRActiveStatus = false;
return IPC_OK();
}
} // namespace gfx
} // namespace mozilla

View File

@ -39,7 +39,6 @@ public:
bool IsSameProcess() const;
bool HaveEventListener();
bool HaveControllerListener();
bool GetVRActiveStatus();
bool SendGamepadUpdate(const GamepadChangeEvent& aGamepadEvent);
bool SendReplyGamepadVibrateHaptic(const uint32_t& aPromiseID);
@ -76,9 +75,6 @@ protected:
virtual mozilla::ipc::IPCResult RecvNewPoseMoveToMockController(const uint32_t& aDeviceID, const GamepadPoseState& pose) override;
virtual mozilla::ipc::IPCResult RecvStartVRNavigation(const uint32_t& aDeviceID) override;
virtual mozilla::ipc::IPCResult RecvStopVRNavigation(const uint32_t& aDeviceID, const TimeDuration& aTimeout) override;
virtual mozilla::ipc::IPCResult RecvStartActivity() override;
virtual mozilla::ipc::IPCResult RecvStopActivity() override;
private:
void RegisterWithManager();
void UnregisterFromManager();
@ -103,10 +99,6 @@ private:
bool mHaveEventListener;
bool mHaveControllerListener;
bool mIsContentChild;
// When VR tabs are switched the background, we won't need to
// initialize its session in VRService thread.
bool mVRActiveStatus;
};
class VRManagerPromise final

View File

@ -236,15 +236,16 @@ OculusSession::~OculusSession()
bool
OculusSession::Initialize(mozilla::gfx::VRSystemState& aSystemState)
{
if (!LoadOvrLib()) {
return false;
}
if (!CreateD3DObjects()) {
return false;
}
if (!CreateShaders()) {
return false;
}
if (!LoadOvrLib()) {
return false;
}
// We start off with an invisible session, then re-initialize
// with visible session once WebVR content starts rendering.
if (!ChangeVisibility(false)) {

View File

@ -134,7 +134,6 @@ VRService::Start()
options.permanent_hang_timeout = 2048; // milliseconds
if (!mServiceThread->StartWithOptions(options)) {
mServiceThread->Stop();
delete mServiceThread;
mServiceThread = nullptr;
return;
@ -152,7 +151,6 @@ VRService::Stop()
{
if (mServiceThread) {
mShutdownRequested = true;
mServiceThread->Stop();
delete mServiceThread;
mServiceThread = nullptr;
}