diff options
author | thestig <thestig@chromium.org> | 2015-09-14 20:42:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-15 03:42:41 +0000 |
commit | d0deb21e9c8442fdab00f8a709817e6cff88709f (patch) | |
tree | fbbc4bd04f6bcf0f8232c4b300e9a42181434fb8 /base/memory/shared_memory.h | |
parent | 40eeb7ab654466217dcbd444bd7d853cba8b3348 (diff) | |
download | chromium_src-d0deb21e9c8442fdab00f8a709817e6cff88709f.zip chromium_src-d0deb21e9c8442fdab00f8a709817e6cff88709f.tar.gz chromium_src-d0deb21e9c8442fdab00f8a709817e6cff88709f.tar.bz2 |
Remove named SharedMemory usage on Mac.
- Only users are unit tests.
- Ifdef out tests that are no longer relevant for Mac.
BUG=345734
Review URL: https://codereview.chromium.org/1340223002
Cr-Commit-Position: refs/heads/master@{#348835}
Diffstat (limited to 'base/memory/shared_memory.h')
-rw-r--r-- | base/memory/shared_memory.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/base/memory/shared_memory.h b/base/memory/shared_memory.h index 4326758..cbd159e 100644 --- a/base/memory/shared_memory.h +++ b/base/memory/shared_memory.h @@ -33,27 +33,34 @@ class FilePath; // Options for creating a shared memory object. struct SharedMemoryCreateOptions { SharedMemoryCreateOptions() - : name_deprecated(NULL), - size(0), - open_existing_deprecated(false), + : size(0), executable(false), - share_read_only(false) {} + share_read_only(false) { +#if !defined(OS_MACOSX) + name_deprecated = nullptr; + open_existing_deprecated = false; +#endif + } +#if !defined(OS_MACOSX) // DEPRECATED (crbug.com/345734): // If NULL, the object is anonymous. This pointer is owned by the caller // and must live through the call to Create(). const std::string* name_deprecated; +#endif // Size of the shared memory object to be created. // When opening an existing object, this has no effect. size_t size; +#if !defined(OS_MACOSX) // DEPRECATED (crbug.com/345734): // If true, and the shared memory already exists, Create() will open the // existing shared memory and ignore the size parameter. If false, // shared memory must not exist. This flag is meaningless unless // name_deprecated is non-NULL. bool open_existing_deprecated; +#endif // If true, mappings might need to be made executable later. bool executable; @@ -138,6 +145,7 @@ class BASE_EXPORT SharedMemory { return Create(options); } +#if !defined(OS_MACOSX) // DEPRECATED (crbug.com/345734): // Creates or opens a shared memory segment based on a name. // If open_existing is true, and the shared memory already exists, @@ -162,6 +170,7 @@ class BASE_EXPORT SharedMemory { // If read_only is true, opens for read-only access. // Returns true on success, false on failure. bool Open(const std::string& name, bool read_only); +#endif // !defined(OS_MACOSX) // Maps the shared memory into the caller's address space. // Returns true on success, false otherwise. The memory address @@ -191,7 +200,7 @@ class BASE_EXPORT SharedMemory { // Gets a pointer to the opened memory space if it has been // Mapped via Map(). Returns NULL if it is not mapped. - void *memory() const { return memory_; } + void* memory() const { return memory_; } // Returns the underlying OS handle for this segment. // Use of this handle for anything other than an opaque |