OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/multi_process_lock.h" | 5 #include "chrome/common/multi_process_lock.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
9 #include "base/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
10 | 11 |
11 class MultiProcessLockWin : public MultiProcessLock { | 12 class MultiProcessLockWin : public MultiProcessLock { |
12 public: | 13 public: |
13 explicit MultiProcessLockWin(const std::string& name) : name_(name) { } | 14 explicit MultiProcessLockWin(const std::string& name) : name_(name) { } |
14 | 15 |
15 ~MultiProcessLockWin() override { | 16 ~MultiProcessLockWin() override { |
16 if (event_.Get() != NULL) { | 17 if (event_.Get() != NULL) { |
17 Unlock(); | 18 Unlock(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 51 |
51 private: | 52 private: |
52 std::string name_; | 53 std::string name_; |
53 base::win::ScopedHandle event_; | 54 base::win::ScopedHandle event_; |
54 DISALLOW_COPY_AND_ASSIGN(MultiProcessLockWin); | 55 DISALLOW_COPY_AND_ASSIGN(MultiProcessLockWin); |
55 }; | 56 }; |
56 | 57 |
57 MultiProcessLock* MultiProcessLock::Create(const std::string &name) { | 58 MultiProcessLock* MultiProcessLock::Create(const std::string &name) { |
58 return new MultiProcessLockWin(name); | 59 return new MultiProcessLockWin(name); |
59 } | 60 } |
OLD | NEW |