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

Unified Diff: base/shared_memory.h

Issue 1689012: Move common code into process_util.cc (Closed)
Patch Set: More fixes Created 10 years, 8 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 | « base/process_util_win.cc ('k') | chrome/browser/memory_details_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory.h
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 48ba857daa6659cd279be2e61bd72179ce3faa07..e2077ae0b02ef6d302178d778329c5a2b8a56395 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:
« no previous file with comments | « base/process_util_win.cc ('k') | chrome/browser/memory_details_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698