Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2470)

Unified Diff: base/memory/shared_memory.h

Issue 27265002: Implement SharedMemory::NewAnonymousReadOnly(contents). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add errno.h Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/memory/shared_memory_posix.cc » ('j') | base/memory/shared_memory_posix.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | base/memory/shared_memory_posix.cc » ('j') | base/memory/shared_memory_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698