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

Side by Side Diff: base/shared_memory_win.cc

Issue 8368009: Replace most LOG statements with DLOG statements in base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/shared_memory_posix.cc ('k') | base/sync_socket_posix.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) 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/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 void SharedMemory::Lock() { 199 void SharedMemory::Lock() {
200 Lock(INFINITE, NULL); 200 Lock(INFINITE, NULL);
201 } 201 }
202 202
203 bool SharedMemory::Lock(uint32 timeout_ms, SECURITY_ATTRIBUTES* sec_attr) { 203 bool SharedMemory::Lock(uint32 timeout_ms, SECURITY_ATTRIBUTES* sec_attr) {
204 if (lock_ == NULL) { 204 if (lock_ == NULL) {
205 std::wstring name = name_; 205 std::wstring name = name_;
206 name.append(L"lock"); 206 name.append(L"lock");
207 lock_ = CreateMutex(sec_attr, FALSE, name.c_str()); 207 lock_ = CreateMutex(sec_attr, FALSE, name.c_str());
208 if (lock_ == NULL) { 208 if (lock_ == NULL) {
209 PLOG(ERROR) << "Could not create mutex."; 209 DPLOG(ERROR) << "Could not create mutex.";
210 return false; // there is nothing good we can do here. 210 return false; // there is nothing good we can do here.
211 } 211 }
212 } 212 }
213 DWORD result = WaitForSingleObject(lock_, timeout_ms); 213 DWORD result = WaitForSingleObject(lock_, timeout_ms);
214 214
215 // Return false for WAIT_ABANDONED, WAIT_TIMEOUT or WAIT_FAILED. 215 // Return false for WAIT_ABANDONED, WAIT_TIMEOUT or WAIT_FAILED.
216 return (result == WAIT_OBJECT_0); 216 return (result == WAIT_OBJECT_0);
217 } 217 }
218 218
219 void SharedMemory::Unlock() { 219 void SharedMemory::Unlock() {
220 DCHECK(lock_ != NULL); 220 DCHECK(lock_ != NULL);
221 ReleaseMutex(lock_); 221 ReleaseMutex(lock_);
222 } 222 }
223 223
224 SharedMemoryHandle SharedMemory::handle() const { 224 SharedMemoryHandle SharedMemory::handle() const {
225 return mapped_file_; 225 return mapped_file_;
226 } 226 }
227 227
228 } // namespace base 228 } // namespace base
OLDNEW
« no previous file with comments | « base/shared_memory_posix.cc ('k') | base/sync_socket_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698