Index: base/memory/shared_memory.h |
diff --git a/base/memory/shared_memory.h b/base/memory/shared_memory.h |
index 23f6973374a0da00e1f1fb94cb99f8723ecae352..52843a2e194dd83b60bc6e938785626e6dc111e4 100644 |
--- a/base/memory/shared_memory.h |
+++ b/base/memory/shared_memory.h |
@@ -17,6 +17,7 @@ |
#include "base/base_export.h" |
#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/process/process_handle.h" |
#if defined(OS_POSIX) |
@@ -104,6 +105,11 @@ class BASE_EXPORT SharedMemory { |
// Returns the maximum number of handles that can be open at once per process. |
static size_t GetHandleLimit(); |
+ // Returns a new, read-only, unmapped SharedMemory with |contents| written |
+ // into it. Use this to send data to untrusted processes. Returns NULL if |
+ // creation fails. |
+ static scoped_ptr<SharedMemory> NewAnonymousReadOnly(StringPiece contents); |
+ |
// Creates a shared memory object as described by the options struct. |
// Returns true on success and false on failure. |
bool Create(const SharedMemoryCreateOptions& options); |