Bug 1516554 - Part 5: Allow VR using the existing shmem. r=kip
authorDaosheng Mu <daoshengmu@gmail.com>
Fri, 11 Jan 2019 22:50:03 +0000
changeset 510942 518dbd08c0d75abd6ab5e194c719bcf3179d487b
parent 510941 bff1af3da43332085f4c862c9d8718c17c193e8d
child 510943 ffe71a987b8245db2873918f0aa00b6c8cb5c311
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip
bugs1516554
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516554 - Part 5: Allow VR using the existing shmem. r=kip Differential Revision: https://phabricator.services.mozilla.com/D16259
gfx/vr/gfxVRExternal.cpp
--- a/gfx/vr/gfxVRExternal.cpp
+++ b/gfx/vr/gfxVRExternal.cpp
@@ -481,17 +481,18 @@ void VRSystemManagerExternal::OpenShmem(
   }
 
 #elif defined(XP_WIN)
   if (mShmemFile == NULL) {
     if (gfxPrefs::VRProcessEnabled()) {
       mShmemFile =
           CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
                              sizeof(VRExternalShmem), kShmemName);
-      MOZ_ASSERT(GetLastError() == 0);
+      MOZ_ASSERT(GetLastError() == 0 || GetLastError() == ERROR_ALREADY_EXISTS);
+      MOZ_ASSERT(mShmemFile);
     } else {
       mShmemFile = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, kShmemName);
     }
 
     if (mShmemFile == NULL) {
       // TODO - Implement logging
       CloseShmem();
       return;