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

Side by Side Diff: base/shared_memory.h

Issue 5012001: Chrome Frame: Add explicit object security attributes to the Chrome Frame ver... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/shared_memory_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_SHARED_MEMORY_H_ 5 #ifndef BASE_SHARED_MEMORY_H_
6 #define BASE_SHARED_MEMORY_H_ 6 #define BASE_SHARED_MEMORY_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // locked by the same thread. 166 // locked by the same thread.
167 // TODO(port): 167 // TODO(port):
168 // WARNING: on POSIX the lock only works across processes, not 168 // WARNING: on POSIX the lock only works across processes, not
169 // across threads. 2 threads in the same process can both grab the 169 // across threads. 2 threads in the same process can both grab the
170 // lock at the same time. There are several solutions for this 170 // lock at the same time. There are several solutions for this
171 // (futex, lockf+anon_semaphore) but none are both clean and common 171 // (futex, lockf+anon_semaphore) but none are both clean and common
172 // across Mac and Linux. 172 // across Mac and Linux.
173 void Lock(); 173 void Lock();
174 174
175 #if defined(OS_WIN) 175 #if defined(OS_WIN)
176 // A Lock() implementation with a timeout. Returns true if the Lock() has 176 // A Lock() implementation with a timeout that also allows setting
177 // been acquired, false if the timeout was reached. 177 // security attributes on the mutex. sec_attr may be NULL.
178 bool Lock(uint32 timeout_ms); 178 // Returns true if the Lock() has been acquired, false if the timeout was
179 // reached.
180 bool Lock(uint32 timeout_ms, SECURITY_ATTRIBUTES* sec_attr);
179 #endif 181 #endif
180 182
181 // Releases the shared memory lock. 183 // Releases the shared memory lock.
182 void Unlock(); 184 void Unlock();
183 185
184 private: 186 private:
185 #if defined(OS_POSIX) 187 #if defined(OS_POSIX)
186 bool PrepareMapFile(FILE *fp); 188 bool PrepareMapFile(FILE *fp);
187 bool FilePathForMemoryName(const std::string& mem_name, FilePath* path); 189 bool FilePathForMemoryName(const std::string& mem_name, FilePath* path);
188 void LockOrUnlockCommon(int function); 190 void LockOrUnlockCommon(int function);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 225 }
224 226
225 private: 227 private:
226 SharedMemory* shared_memory_; 228 SharedMemory* shared_memory_;
227 DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLock); 229 DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLock);
228 }; 230 };
229 231
230 } // namespace base 232 } // namespace base
231 233
232 #endif // BASE_SHARED_MEMORY_H_ 234 #endif // BASE_SHARED_MEMORY_H_
OLDNEW
« no previous file with comments | « no previous file | base/shared_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698