summaryrefslogtreecommitdiffstats
path: root/base/shared_memory.h
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 17:44:42 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 17:44:42 +0000
commitb6128aaba9e7c148d1a71710b1d7de5d101f9967 (patch)
treedca19e0d51b91edcd5e2203de2f3158c64bcdb5c /base/shared_memory.h
parenta65b0ba084b3b197f817b88bd21b275e1790a629 (diff)
downloadchromium_src-b6128aaba9e7c148d1a71710b1d7de5d101f9967.zip
chromium_src-b6128aaba9e7c148d1a71710b1d7de5d101f9967.tar.gz
chromium_src-b6128aaba9e7c148d1a71710b1d7de5d101f9967.tar.bz2
Move common code into process_util.cc.
Fix namespace usage. Change ProcessEntry to have a common interface accross platforms and change ProcessFilter::Includes() to make use of it. Split NamedProcessIterator in two. BUG=none TEST=none Review URL: http://codereview.chromium.org/1689012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/shared_memory.h')
-rw-r--r--base/shared_memory.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 48ba857..e2077ae 100644
--- a/base/shared_memory.h
+++ b/base/shared_memory.h
@@ -40,7 +40,6 @@ typedef ino_t SharedMemoryId;
// around the OS primitive for a memory mapped file.
class SharedMemory {
public:
- // Create a new SharedMemory object.
SharedMemory();
// Create a new SharedMemory object from an existing, open
@@ -51,19 +50,19 @@ class SharedMemory {
// shared memory file that was created by a remote process and not shared
// to the current process.
SharedMemory(SharedMemoryHandle handle, bool read_only,
- base::ProcessHandle process);
+ ProcessHandle process);
- // Destructor. Will close any open files.
+ // Closes any open files.
~SharedMemory();
// Return true iff the given handle is valid (i.e. not the distingished
// invalid value; NULL for a HANDLE and -1 for a file descriptor)
static bool IsHandleValid(const SharedMemoryHandle& handle);
- // Return invalid handle (see comment above for exact definition).
+ // Returns invalid handle (see comment above for exact definition).
static SharedMemoryHandle NULLHandle();
- // Close a shared memory handle.
+ // Closes a shared memory handle.
static void CloseHandle(const SharedMemoryHandle& handle);
// Creates or opens a shared memory segment based on a name.
@@ -106,13 +105,13 @@ class SharedMemory {
// Mapped via Map(). Returns NULL if it is not mapped.
void *memory() const { return memory_; }
- // Get access to the underlying OS handle for this segment.
+ // Returns the underlying OS handle for this segment.
// Use of this handle for anything other than an opaque
// identifier is not portable.
SharedMemoryHandle handle() const;
#if defined(OS_POSIX)
- // Return a unique identifier for this shared memory segment. Inode numbers
+ // Returns a unique identifier for this shared memory segment. Inode numbers
// are technically only unique to a single filesystem. However, we always
// allocate shared memory backing files from the same directory, so will end
// up on the same filesystem.
@@ -123,13 +122,13 @@ class SharedMemory {
// It is safe to call Close repeatedly.
void Close();
- // Share the shared memory to another process. Attempts
+ // Shares the shared memory to another process. Attempts
// to create a platform-specific new_handle which can be
// used in a remote process to access the shared memory
// file. new_handle is an ouput parameter to receive
// the handle for use in the remote process.
// Returns true on success, false otherwise.
- bool ShareToProcess(base::ProcessHandle process,
+ bool ShareToProcess(ProcessHandle process,
SharedMemoryHandle* new_handle) {
return ShareToProcessCommon(process, new_handle, false);
}
@@ -145,7 +144,7 @@ class SharedMemory {
return ShareToProcessCommon(process, new_handle, true);
}
- // Lock the shared memory.
+ // Locks the shared memory.
// This is a cross-process lock which may be recursively
// locked by the same thread.
// TODO(port):
@@ -156,7 +155,7 @@ class SharedMemory {
// across Mac and Linux.
void Lock();
- // Release the shared memory lock.
+ // Releases the shared memory lock.
void Unlock();
private: