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

Unified Diff: base/shared_memory.h

Issue 12537014: Make SharedMemory track the size that was actually mapped (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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/shared_memory_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory.h
===================================================================
--- base/shared_memory.h (revision 190994)
+++ base/shared_memory.h (working copy)
@@ -159,16 +159,12 @@
// memory is not mapped.
bool Unmap();
- // Get the size of the shared memory backing file.
- // Note: This size is only available to the creator of the
- // shared memory, and not to those that opened shared memory
- // created externally.
- // Returns 0 if not created or unknown.
- // Deprecated method, please keep track of the size yourself if you created
- // it.
- // http://crbug.com/60821
- size_t created_size() const { return created_size_; }
+ // The size requested when the map is first created.
+ size_t requested_size() const { return requested_size_; }
+ // The actual size of the mapped memory (may be larger than requested).
+ size_t mapped_size() const { return mapped_size_; }
+
// 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_; }
@@ -246,12 +242,12 @@
HANDLE mapped_file_;
#elif defined(OS_POSIX)
int mapped_file_;
- size_t mapped_size_;
ino_t inode_;
#endif
+ size_t mapped_size_;
void* memory_;
bool read_only_;
- size_t created_size_;
+ size_t requested_size_;
#if !defined(OS_POSIX)
SharedMemoryLock lock_;
#endif
« no previous file with comments | « no previous file | base/shared_memory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698