diff options
Diffstat (limited to 'base/synchronization')
-rw-r--r-- | base/synchronization/condition_variable_unittest.cc | 4 | ||||
-rw-r--r-- | base/synchronization/lock_unittest.cc | 12 | ||||
-rw-r--r-- | base/synchronization/waitable_event_posix.cc | 4 | ||||
-rw-r--r-- | base/synchronization/waitable_event_unittest.cc | 8 | ||||
-rw-r--r-- | base/synchronization/waitable_event_watcher_posix.cc | 4 | ||||
-rw-r--r-- | base/synchronization/waitable_event_watcher_unittest.cc | 6 |
6 files changed, 21 insertions, 17 deletions
diff --git a/base/synchronization/condition_variable_unittest.cc b/base/synchronization/condition_variable_unittest.cc index 49716e1..4162d4f 100644 --- a/base/synchronization/condition_variable_unittest.cc +++ b/base/synchronization/condition_variable_unittest.cc @@ -62,10 +62,10 @@ class ConditionVariableTest : public PlatformTest { class WorkQueue : public PlatformThread::Delegate { public: explicit WorkQueue(int thread_count); - ~WorkQueue(); + virtual ~WorkQueue(); // PlatformThread::Delegate interface. - void ThreadMain(); + virtual void ThreadMain() OVERRIDE; //---------------------------------------------------------------------------- // Worker threads only call the following methods. diff --git a/base/synchronization/lock_unittest.cc b/base/synchronization/lock_unittest.cc index 1dae49b..a048f85 100644 --- a/base/synchronization/lock_unittest.cc +++ b/base/synchronization/lock_unittest.cc @@ -1,10 +1,12 @@ -// 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. +#include "base/synchronization/lock.h" + #include <stdlib.h> -#include "base/synchronization/lock.h" +#include "base/compiler_specific.h" #include "base/threading/platform_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +18,7 @@ class BasicLockTestThread : public PlatformThread::Delegate { public: BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} - virtual void ThreadMain() { + virtual void ThreadMain() OVERRIDE { for (int i = 0; i < 10; i++) { lock_->Acquire(); acquired_++; @@ -91,7 +93,7 @@ class TryLockTestThread : public PlatformThread::Delegate { public: TryLockTestThread(Lock* lock) : lock_(lock), got_lock_(false) {} - virtual void ThreadMain() { + virtual void ThreadMain() OVERRIDE { got_lock_ = lock_->Try(); if (got_lock_) lock_->Release(); @@ -160,7 +162,7 @@ class MutexLockTestThread : public PlatformThread::Delegate { } } - virtual void ThreadMain() { + virtual void ThreadMain() OVERRIDE { DoStuff(lock_, value_); } diff --git a/base/synchronization/waitable_event_posix.cc b/base/synchronization/waitable_event_posix.cc index 01077ff..fbf8d10 100644 --- a/base/synchronization/waitable_event_posix.cc +++ b/base/synchronization/waitable_event_posix.cc @@ -91,7 +91,7 @@ class SyncWaiter : public WaitableEvent::Waiter { cv_(&lock_) { } - bool Fire(WaitableEvent* signaling_event) { + virtual bool Fire(WaitableEvent* signaling_event) OVERRIDE { base::AutoLock locked(lock_); if (fired_) @@ -117,7 +117,7 @@ class SyncWaiter : public WaitableEvent::Waiter { // These waiters are always stack allocated and don't delete themselves. Thus // there's no problem and the ABA tag is the same as the object pointer. // --------------------------------------------------------------------------- - bool Compare(void* tag) { + virtual bool Compare(void* tag) OVERRIDE { return this == tag; } diff --git a/base/synchronization/waitable_event_unittest.cc b/base/synchronization/waitable_event_unittest.cc index f253265..d00adc7 100644 --- a/base/synchronization/waitable_event_unittest.cc +++ b/base/synchronization/waitable_event_unittest.cc @@ -1,9 +1,11 @@ -// 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. -#include "base/time.h" #include "base/synchronization/waitable_event.h" + +#include "base/compiler_specific.h" +#include "base/time.h" #include "base/threading/platform_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -76,7 +78,7 @@ class WaitableEventSignaler : public PlatformThread::Delegate { ev_(ev) { } - void ThreadMain() { + virtual void ThreadMain() OVERRIDE { PlatformThread::Sleep(TimeDelta::FromSeconds(static_cast<int>(seconds_))); ev_->Signal(); } diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc index 5a17999..3180b4b 100644 --- a/base/synchronization/waitable_event_watcher_posix.cc +++ b/base/synchronization/waitable_event_watcher_posix.cc @@ -65,7 +65,7 @@ class AsyncWaiter : public WaitableEvent::Waiter { callback_(callback), flag_(flag) { } - bool Fire(WaitableEvent* event) { + virtual bool Fire(WaitableEvent* event) OVERRIDE { // Post the callback if we haven't been cancelled. if (!flag_->value()) { message_loop_->PostTask(FROM_HERE, callback_); @@ -81,7 +81,7 @@ class AsyncWaiter : public WaitableEvent::Waiter { } // See StopWatching for discussion - bool Compare(void* tag) { + virtual bool Compare(void* tag) OVERRIDE { return tag == flag_.get(); } diff --git a/base/synchronization/waitable_event_watcher_unittest.cc b/base/synchronization/waitable_event_watcher_unittest.cc index ee9478a..c48333a 100644 --- a/base/synchronization/waitable_event_watcher_unittest.cc +++ b/base/synchronization/waitable_event_watcher_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. @@ -14,7 +14,7 @@ namespace { class QuitDelegate : public WaitableEventWatcher::Delegate { public: - virtual void OnWaitableEventSignaled(WaitableEvent* event) { + virtual void OnWaitableEventSignaled(WaitableEvent* event) OVERRIDE { MessageLoop::current()->Quit(); } }; @@ -23,7 +23,7 @@ class DecrementCountDelegate : public WaitableEventWatcher::Delegate { public: explicit DecrementCountDelegate(int* counter) : counter_(counter) { } - virtual void OnWaitableEventSignaled(WaitableEvent* object) { + virtual void OnWaitableEventSignaled(WaitableEvent* object) OVERRIDE { --(*counter_); } private: |