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

Unified Diff: base/memory/shared_memory_win.cc

Issue 27265002: Implement SharedMemory::NewAnonymousReadOnly(contents). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Try to fix Android and Windows 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
Index: base/memory/shared_memory_win.cc
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc
index 42e0b046b96e5818d3cfe05546e32a8857a91012..65d7a5d16277e1b8fd1f7ba7b8a04337c71a302c 100644
--- a/base/memory/shared_memory_win.cc
+++ b/base/memory/shared_memory_win.cc
@@ -188,13 +188,14 @@ bool SharedMemory::Unmap() {
bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
SharedMemoryHandle *new_handle,
- bool close_self) {
+ bool close_self,
+ ShareMode share_mode) {
*new_handle = 0;
DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ;
DWORD options = 0;
HANDLE mapped_file = mapped_file_;
HANDLE result;
- if (!read_only_)
+ if (share_mode == SHARE_CURRENT_MODE && !read_only_)
access |= FILE_MAP_WRITE;
if (close_self) {
// DUPLICATE_CLOSE_SOURCE causes DuplicateHandle to close mapped_file.

Powered by Google App Engine
This is Rietveld 408576698