Backed out changeset e0034670b26a (bug 1514417) as requested by daoshengmu

This commit is contained in:
Coroiu Cristina 2019-01-26 01:46:32 +02:00
parent a1377d8c37
commit 77de4f7263
4 changed files with 2 additions and 17 deletions

View File

@ -426,8 +426,8 @@ VRSystemManagerExternal::VRSystemManagerExternal(
VRExternalShmem* aAPIShmem /* = nullptr*/)
: mExternalShmem(aAPIShmem)
#if !defined(MOZ_WIDGET_ANDROID)
, mMutex("VRSystemManagerExternal::mMutex")
, mSameProcess(aAPIShmem != nullptr)
,
mSameProcess(aAPIShmem != nullptr)
#endif
{
#if defined(XP_MACOSX)
@ -844,10 +844,6 @@ void VRSystemManagerExternal::PushState(VRBrowserState* aBrowserState,
pthread_mutex_unlock((pthread_mutex_t*)&(mExternalShmem->browserMutex));
}
#else
// We need this MutexAutoLock to avoid mAPIShmem happens deadlock issue
// when both of VRService and VRSubmitFrame threads are writing/reading
// it from the memory.
MutexAutoLock lock(mMutex);
mExternalShmem->browserGenerationA++;
memcpy((void*)&(mExternalShmem->browserState), (void*)aBrowserState,
sizeof(VRBrowserState));

View File

@ -134,7 +134,6 @@ class VRSystemManagerExternal : public VRSystemManager {
volatile VRExternalShmem* mExternalShmem;
#if !defined(MOZ_WIDGET_ANDROID)
Mutex mMutex;
bool mSameProcess;
#endif
TimeStamp mEarliestRestartTime;

View File

@ -68,9 +68,6 @@ VRService::VRService()
mTargetShmemFile(0),
mLastHapticState{},
mFrameStartTime{},
#if !defined(MOZ_WIDGET_ANDROID)
mMutex("VRService::mMutex"),
#endif
mVRProcessEnabled(gfxPrefs::VRProcessEnabled()) {
// When we have the VR process, we map the memory
// of mAPIShmem from GPU process.
@ -459,10 +456,6 @@ void VRService::PullState(mozilla::gfx::VRBrowserState& aState) {
pthread_mutex_unlock((pthread_mutex_t*)&(mExternalShmem->browserMutex));
}
#else
// We need this MutexAutoLock to avoid mAPIShmem happens deadlock issue
// when both of VRService and VRSubmitFrame threads are writing/reading
// it from the memory.
MutexAutoLock lock(mMutex);
VRExternalShmem tmp;
if (mAPIShmem->browserGenerationA != mBrowserGeneration) {
memcpy(&tmp, mAPIShmem, sizeof(VRExternalShmem));

View File

@ -63,9 +63,6 @@ class VRService {
base::ProcessHandle mTargetShmemFile;
VRHapticState mLastHapticState[kVRHapticsMaxCount];
TimeStamp mFrameStartTime[kVRFrameTimingHistoryDepth];
#if !defined(MOZ_WIDGET_ANDROID)
Mutex mMutex;
#endif
// We store the value of gfxPrefs::VRProcessEnabled() in mVRProcessEnabled.
// This allows us to read the value in the VRService destructor, after
// gfxPrefs has been shut down. We should investigate why gfxPrefs