diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-06 03:53:02 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-06 03:53:02 +0000 |
commit | 441061813c0a5c13392fa1ceff763639cccf3233 (patch) | |
tree | 7e4b83ec66c53ac08f22725ec1b2ca6d632213f6 /base/memory | |
parent | f493d9f1ce7f520fbbe4fbe4bce282242941783c (diff) | |
download | chromium_src-441061813c0a5c13392fa1ceff763639cccf3233.zip chromium_src-441061813c0a5c13392fa1ceff763639cccf3233.tar.gz chromium_src-441061813c0a5c13392fa1ceff763639cccf3233.tar.bz2 |
Add virtual and OVERRIDE to base/ implementation files
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/10004001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/memory')
-rw-r--r-- | base/memory/linked_ptr_unittest.cc | 8 | ||||
-rw-r--r-- | base/memory/scoped_ptr_unittest.cc | 4 | ||||
-rw-r--r-- | base/memory/scoped_vector_unittest.cc | 7 | ||||
-rw-r--r-- | base/memory/singleton_unittest.cc | 6 | ||||
-rw-r--r-- | base/memory/weak_ptr_unittest.cc | 6 |
5 files changed, 15 insertions, 16 deletions
diff --git a/base/memory/linked_ptr_unittest.cc b/base/memory/linked_ptr_unittest.cc index ae10fc28..4550350 100644 --- a/base/memory/linked_ptr_unittest.cc +++ b/base/memory/linked_ptr_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,8 +25,10 @@ struct A { // Subclass struct B: public A { B() { history += base::StringPrintf("B%d ctor\n", mynum); } - ~B() { history += base::StringPrintf("B%d dtor\n", mynum); } - virtual void Use() { history += base::StringPrintf("B%d use\n", mynum); } + virtual ~B() { history += base::StringPrintf("B%d dtor\n", mynum); } + virtual void Use() OVERRIDE { + history += base::StringPrintf("B%d use\n", mynum); + } }; } // namespace diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc index 63125db..06c6a50 100644 --- a/base/memory/scoped_ptr_unittest.cc +++ b/base/memory/scoped_ptr_unittest.cc @@ -23,9 +23,9 @@ class ConDecLogger : public ConDecLoggerParent { explicit ConDecLogger(int* ptr) { set_ptr(ptr); } virtual ~ConDecLogger() { --*ptr_; } - virtual void set_ptr(int* ptr) { ptr_ = ptr; ++*ptr_; } + virtual void set_ptr(int* ptr) OVERRIDE { ptr_ = ptr; ++*ptr_; } - virtual int SomeMeth(int x) const { return x; } + virtual int SomeMeth(int x) const OVERRIDE { return x; } private: int* ptr_; diff --git a/base/memory/scoped_vector_unittest.cc b/base/memory/scoped_vector_unittest.cc index e10cb83..f6c7167 100644 --- a/base/memory/scoped_vector_unittest.cc +++ b/base/memory/scoped_vector_unittest.cc @@ -62,12 +62,11 @@ class LifeCycleWatcher : public LifeCycleObject::Observer { LifeCycleWatcher() : life_cycle_state_(LC_INITIAL), constructed_life_cycle_object_(NULL) {} - ~LifeCycleWatcher() { - } + virtual ~LifeCycleWatcher() {} // Assert INITIAL -> CONSTRUCTED and no LifeCycleObject associated with this // LifeCycleWatcher. - virtual void OnLifeCycleConstruct(LifeCycleObject* object) { + virtual void OnLifeCycleConstruct(LifeCycleObject* object) OVERRIDE { ASSERT_EQ(LC_INITIAL, life_cycle_state_); ASSERT_EQ(NULL, constructed_life_cycle_object_.get()); life_cycle_state_ = LC_CONSTRUCTED; @@ -76,7 +75,7 @@ class LifeCycleWatcher : public LifeCycleObject::Observer { // Assert CONSTRUCTED -> DESTROYED and the |object| being destroyed is the // same one we saw constructed. - virtual void OnLifeCycleDestroy(LifeCycleObject* object) { + virtual void OnLifeCycleDestroy(LifeCycleObject* object) OVERRIDE { ASSERT_EQ(LC_CONSTRUCTED, life_cycle_state_); LifeCycleObject* constructed_life_cycle_object = constructed_life_cycle_object_.release(); diff --git a/base/memory/singleton_unittest.cc b/base/memory/singleton_unittest.cc index 33928a7..d9892cb 100644 --- a/base/memory/singleton_unittest.cc +++ b/base/memory/singleton_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -153,9 +153,9 @@ CallbackFunc* GetStaticSingleton() { class SingletonTest : public testing::Test { public: - SingletonTest() { } + SingletonTest() {} - virtual void SetUp() { + virtual void SetUp() OVERRIDE { non_leak_called_ = false; leaky_called_ = false; static_called_ = false; diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc index 8f42664..f2e53ef 100644 --- a/base/memory/weak_ptr_unittest.cc +++ b/base/memory/weak_ptr_unittest.cc @@ -44,11 +44,9 @@ struct Consumer { WeakPtr<Producer> producer; }; // and delete objects on a background thread. class BackgroundThread : public Thread { public: - BackgroundThread() - : Thread("owner_thread") { - } + BackgroundThread() : Thread("owner_thread") {} - ~BackgroundThread() { + virtual ~BackgroundThread() { Stop(); } |