1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef gfx_SharedDIB_h__
7 #define gfx_SharedDIB_h__
9 #include "base/shared_memory.h"
18 typedef base::SharedMemoryHandle Handle
;
24 // Create and allocate a new shared dib.
25 nsresult
Create(uint32_t aSize
);
27 // Destroy or release resources associated with this dib.
30 // Returns true if this object contains a valid dib.
33 // Wrap a new shared dib around allocated shared memory. Note aHandle must point
34 // to a memory section large enough to hold a dib of size aSize, otherwise this
36 nsresult
Attach(Handle aHandle
, uint32_t aSize
);
38 // Returns a SharedMemoryHandle suitable for sharing with another process.
39 nsresult
ShareToProcess(base::ProcessHandle aChildProcess
, Handle
*aChildHandle
);
42 base::SharedMemory
*mShMem
;