Bug 606976 - Don't map the memory from a SharedDIB: CreateDIBSection creates another mapping, and we don't actually use the mapping for anything, r=jimm
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 25 Oct 2010 13:22:43 -0400
changeset 57208 da433c7320abe71c4d2d51bffd6a213ef61e3ac4
parent 57207 f7b85d9a0900caf0983551fb0ff0a579c212524e
child 57209 94324cad0457d50276216fec9cd21bdbc191580e
push id16846
push userbsmedberg@mozilla.com
push dateWed, 10 Nov 2010 15:29:47 +0000
treeherdermozilla-central@bdbef533364f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs606976
milestone2.0b8pre
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 606976 - Don't map the memory from a SharedDIB: CreateDIBSection creates another mapping, and we don't actually use the mapping for anything, r=jimm
gfx/ipc/SharedDIB.cpp
--- a/gfx/ipc/SharedDIB.cpp
+++ b/gfx/ipc/SharedDIB.cpp
@@ -55,20 +55,16 @@ nsresult
 SharedDIB::Create(PRUint32 aSize)
 {
   Close();
 
   mShMem = new base::SharedMemory();
   if (!mShMem || !mShMem->Create("", false, false, aSize))
     return NS_ERROR_OUT_OF_MEMORY;
 
-  // Map the entire section
-  if (!mShMem->Map(0))
-    return NS_ERROR_FAILURE;
-
   return NS_OK;
 }
 
 bool
 SharedDIB::IsValid()
 {
   if (!mShMem)
     return false;
@@ -91,19 +87,16 @@ nsresult
 SharedDIB::Attach(Handle aHandle, PRUint32 aSize)
 {
   Close();
 
   mShMem = new base::SharedMemory(aHandle, false);
   if(!mShMem)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  if (!mShMem->Map(aSize))
-    return NS_ERROR_FAILURE;
-
   return NS_OK;
 }
 
 nsresult
 SharedDIB::ShareToProcess(base::ProcessHandle aChildProcess, Handle *aChildHandle)
 {
   if (!mShMem)
     return NS_ERROR_UNEXPECTED;