OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "base/shared_memory.h" | 5 #include "base/shared_memory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/win_util.h" | 8 #include "base/win_util.h" |
9 | 9 |
| 10 namespace base { |
| 11 |
10 SharedMemory::SharedMemory() | 12 SharedMemory::SharedMemory() |
11 : mapped_file_(NULL), | 13 : mapped_file_(NULL), |
12 memory_(NULL), | 14 memory_(NULL), |
13 read_only_(false), | 15 read_only_(false), |
14 max_size_(0), | 16 max_size_(0), |
15 lock_(NULL) { | 17 lock_(NULL) { |
16 } | 18 } |
17 | 19 |
18 SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only) | 20 SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only) |
19 : mapped_file_(handle), | 21 : mapped_file_(handle), |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 156 } |
155 } | 157 } |
156 WaitForSingleObject(lock_, INFINITE); | 158 WaitForSingleObject(lock_, INFINITE); |
157 } | 159 } |
158 | 160 |
159 void SharedMemory::Unlock() { | 161 void SharedMemory::Unlock() { |
160 DCHECK(lock_ != NULL); | 162 DCHECK(lock_ != NULL); |
161 ReleaseMutex(lock_); | 163 ReleaseMutex(lock_); |
162 } | 164 } |
163 | 165 |
| 166 } // namespace base |
OLD | NEW |