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

Side by Side Diff: chrome/common/multi_process_lock_mac.cc

Issue 622373003: Replacing the OVERRIDE with override in chrome/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolved Error Created 6 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
« no previous file with comments | « chrome/common/multi_process_lock_linux.cc ('k') | chrome/common/service_process_util_posix.h » ('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) 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/mac/scoped_cftyperef.h" 8 #include "base/mac/scoped_cftyperef.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 10
11 #include <servers/bootstrap.h> 11 #include <servers/bootstrap.h>
12 12
13 class MultiProcessLockMac : public MultiProcessLock { 13 class MultiProcessLockMac : public MultiProcessLock {
14 public: 14 public:
15 explicit MultiProcessLockMac(const std::string& name) : name_(name) { } 15 explicit MultiProcessLockMac(const std::string& name) : name_(name) { }
16 16
17 virtual ~MultiProcessLockMac() { 17 virtual ~MultiProcessLockMac() {
18 if (port_ != NULL) { 18 if (port_ != NULL) {
19 Unlock(); 19 Unlock();
20 } 20 }
21 } 21 }
22 22
23 virtual bool TryLock() OVERRIDE { 23 virtual bool TryLock() override {
24 if (port_ != NULL) { 24 if (port_ != NULL) {
25 DLOG(ERROR) << "MultiProcessLock is already locked - " << name_; 25 DLOG(ERROR) << "MultiProcessLock is already locked - " << name_;
26 return true; 26 return true;
27 } 27 }
28 28
29 if (name_.length() >= BOOTSTRAP_MAX_NAME_LEN) { 29 if (name_.length() >= BOOTSTRAP_MAX_NAME_LEN) {
30 LOG(ERROR) << "Socket name too long (" << name_.length() 30 LOG(ERROR) << "Socket name too long (" << name_.length()
31 << " >= " << BOOTSTRAP_MAX_NAME_LEN << ") - " << name_; 31 << " >= " << BOOTSTRAP_MAX_NAME_LEN << ") - " << name_;
32 return false; 32 return false;
33 } 33 }
34 34
35 CFStringRef cf_name(base::SysUTF8ToCFStringRef(name_)); 35 CFStringRef cf_name(base::SysUTF8ToCFStringRef(name_));
36 base::ScopedCFTypeRef<CFStringRef> scoped_cf_name(cf_name); 36 base::ScopedCFTypeRef<CFStringRef> scoped_cf_name(cf_name);
37 port_.reset(CFMessagePortCreateLocal(NULL, cf_name, NULL, NULL, NULL)); 37 port_.reset(CFMessagePortCreateLocal(NULL, cf_name, NULL, NULL, NULL));
38 return port_ != NULL; 38 return port_ != NULL;
39 } 39 }
40 40
41 virtual void Unlock() OVERRIDE { 41 virtual void Unlock() override {
42 if (port_ == NULL) { 42 if (port_ == NULL) {
43 DLOG(ERROR) << "Over-unlocked MultiProcessLock - " << name_; 43 DLOG(ERROR) << "Over-unlocked MultiProcessLock - " << name_;
44 return; 44 return;
45 } 45 }
46 port_.reset(); 46 port_.reset();
47 } 47 }
48 48
49 private: 49 private:
50 std::string name_; 50 std::string name_;
51 base::ScopedCFTypeRef<CFMessagePortRef> port_; 51 base::ScopedCFTypeRef<CFMessagePortRef> port_;
52 DISALLOW_COPY_AND_ASSIGN(MultiProcessLockMac); 52 DISALLOW_COPY_AND_ASSIGN(MultiProcessLockMac);
53 }; 53 };
54 54
55 MultiProcessLock* MultiProcessLock::Create(const std::string &name) { 55 MultiProcessLock* MultiProcessLock::Create(const std::string &name) {
56 return new MultiProcessLockMac(name); 56 return new MultiProcessLockMac(name);
57 } 57 }
OLDNEW
« no previous file with comments | « chrome/common/multi_process_lock_linux.cc ('k') | chrome/common/service_process_util_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698