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

Side by Side Diff: ceee/testing/utils/instance_count_mixin.cc

Issue 6336010: Add missing base::lock usage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
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 // Implementation of instance count mixin base class. 5 // Implementation of instance count mixin base class.
6 #include "ceee/testing/utils/instance_count_mixin.h" 6 #include "ceee/testing/utils/instance_count_mixin.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gtest/gtest.h" 8 #include "gtest/gtest.h"
9 9
10 namespace { 10 namespace {
11 // Set of existing instances. 11 // Set of existing instances.
12 testing::InstanceCountMixinBase::InstanceSet instances; 12 testing::InstanceCountMixinBase::InstanceSet instances;
13 }; 13 };
14 14
15 namespace testing { 15 namespace testing {
16 16
17 Lock InstanceCountMixinBase::lock_; 17 base::Lock InstanceCountMixinBase::lock_;
18 18
19 InstanceCountMixinBase::InstanceCountMixinBase() { 19 InstanceCountMixinBase::InstanceCountMixinBase() {
20 base::AutoLock lock(lock_); 20 base::AutoLock lock(lock_);
21 21
22 instances.insert(this); 22 instances.insert(this);
23 } 23 }
24 24
25 InstanceCountMixinBase::~InstanceCountMixinBase() { 25 InstanceCountMixinBase::~InstanceCountMixinBase() {
26 base::AutoLock lock(lock_); 26 base::AutoLock lock(lock_);
27 27
(...skipping 27 matching lines...) Expand all
55 55
56 InstanceSet::const_iterator InstanceCountMixinBase::begin() { 56 InstanceSet::const_iterator InstanceCountMixinBase::begin() {
57 return instances.begin(); 57 return instances.begin();
58 } 58 }
59 59
60 InstanceSet::const_iterator InstanceCountMixinBase::end() { 60 InstanceSet::const_iterator InstanceCountMixinBase::end() {
61 return instances.end(); 61 return instances.end();
62 } 62 }
63 63
64 } // namespace testing 64 } // namespace testing
OLDNEW
« no previous file with comments | « ceee/ie/plugin/bho/window_message_source.cc ('k') | chrome/browser/enumerate_modules_model_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698