Add OVERRIDE to base/.
BUG=104314
TEST=no change
Review URL: http://codereview.chromium.org/8520018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110218 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/file_descriptor_shuffle.h b/base/file_descriptor_shuffle.h
index 335b008..61aac69 100644
--- a/base/file_descriptor_shuffle.h
+++ b/base/file_descriptor_shuffle.h
@@ -25,6 +25,7 @@
#include <vector>
#include "base/base_export.h"
+#include "base/compiler_specific.h"
namespace base {
@@ -48,9 +49,9 @@
// An implementation of the InjectionDelegate interface using the file
// descriptor table of the current process as the domain.
class FileDescriptorTableInjection : public InjectionDelegate {
- virtual bool Duplicate(int* result, int fd);
- virtual bool Move(int src, int dest);
- virtual void Close(int fd);
+ virtual bool Duplicate(int* result, int fd) OVERRIDE;
+ virtual bool Move(int src, int dest) OVERRIDE;
+ virtual void Close(int fd) OVERRIDE;
};
// A single arc of the directed graph which describes an injective multimapping.
diff --git a/base/file_version_info_mac.h b/base/file_version_info_mac.h
index 7c0184a..3560fea 100644
--- a/base/file_version_info_mac.h
+++ b/base/file_version_info_mac.h
@@ -24,22 +24,22 @@
// Accessors to the different version properties.
// Returns an empty string if the property is not found.
- virtual string16 company_name();
- virtual string16 company_short_name();
- virtual string16 product_name();
- virtual string16 product_short_name();
- virtual string16 internal_name();
- virtual string16 product_version();
- virtual string16 private_build();
- virtual string16 special_build();
- virtual string16 comments();
- virtual string16 original_filename();
- virtual string16 file_description();
- virtual string16 file_version();
- virtual string16 legal_copyright();
- virtual string16 legal_trademarks();
- virtual string16 last_change();
- virtual bool is_official_build();
+ virtual string16 company_name() OVERRIDE;
+ virtual string16 company_short_name() OVERRIDE;
+ virtual string16 product_name() OVERRIDE;
+ virtual string16 product_short_name() OVERRIDE;
+ virtual string16 internal_name() OVERRIDE;
+ virtual string16 product_version() OVERRIDE;
+ virtual string16 private_build() OVERRIDE;
+ virtual string16 special_build() OVERRIDE;
+ virtual string16 comments() OVERRIDE;
+ virtual string16 original_filename() OVERRIDE;
+ virtual string16 file_description() OVERRIDE;
+ virtual string16 file_version() OVERRIDE;
+ virtual string16 legal_copyright() OVERRIDE;
+ virtual string16 legal_trademarks() OVERRIDE;
+ virtual string16 last_change() OVERRIDE;
+ virtual bool is_official_build() OVERRIDE;
private:
// Returns a string16 value for a property name.
diff --git a/base/file_version_info_win.h b/base/file_version_info_win.h
index 6a488b4..1e440317 100644
--- a/base/file_version_info_win.h
+++ b/base/file_version_info_win.h
@@ -23,22 +23,22 @@
// Accessors to the different version properties.
// Returns an empty string if the property is not found.
- virtual string16 company_name();
- virtual string16 company_short_name();
- virtual string16 product_name();
- virtual string16 product_short_name();
- virtual string16 internal_name();
- virtual string16 product_version();
- virtual string16 private_build();
- virtual string16 special_build();
- virtual string16 comments();
- virtual string16 original_filename();
- virtual string16 file_description();
- virtual string16 file_version();
- virtual string16 legal_copyright();
- virtual string16 legal_trademarks();
- virtual string16 last_change();
- virtual bool is_official_build();
+ virtual string16 company_name() OVERRIDE;
+ virtual string16 company_short_name() OVERRIDE;
+ virtual string16 product_name() OVERRIDE;
+ virtual string16 product_short_name() OVERRIDE;
+ virtual string16 internal_name() OVERRIDE;
+ virtual string16 product_version() OVERRIDE;
+ virtual string16 private_build() OVERRIDE;
+ virtual string16 special_build() OVERRIDE;
+ virtual string16 comments() OVERRIDE;
+ virtual string16 original_filename() OVERRIDE;
+ virtual string16 file_description() OVERRIDE;
+ virtual string16 file_version() OVERRIDE;
+ virtual string16 legal_copyright() OVERRIDE;
+ virtual string16 legal_trademarks() OVERRIDE;
+ virtual string16 last_change() OVERRIDE;
+ virtual bool is_official_build() OVERRIDE;
// Lets you access other properties not covered above.
BASE_EXPORT bool GetValue(const wchar_t* name, std::wstring* value);
diff --git a/base/files/file_path_watcher.h b/base/files/file_path_watcher.h
index 580ec99f..ed17464 100644
--- a/base/files/file_path_watcher.h
+++ b/base/files/file_path_watcher.h
@@ -61,7 +61,7 @@
delegate_->CancelOnMessageLoopThread();
}
- virtual void Run() {
+ virtual void Run() OVERRIDE {
delegate_->CancelOnMessageLoopThread();
}
private:
diff --git a/base/json/json_value_serializer.h b/base/json/json_value_serializer.h
index 650008ec..82fd9639 100644
--- a/base/json/json_value_serializer.h
+++ b/base/json/json_value_serializer.h
@@ -39,7 +39,7 @@
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the string passed into the constructor.
- virtual bool Serialize(const Value& root);
+ virtual bool Serialize(const Value& root) OVERRIDE;
// Attempt to deserialize the data structure encoded in the string passed
// in to the constructor into a structure of Value objects. If the return
@@ -48,7 +48,8 @@
// If |error_message| is non-null, it will be filled in with a formatted
// error message including the location of the error if appropriate.
// The caller takes ownership of the returned value.
- virtual Value* Deserialize(int* error_code, std::string* error_message);
+ virtual Value* Deserialize(int* error_code,
+ std::string* error_message) OVERRIDE;
void set_pretty_print(bool new_value) { pretty_print_ = new_value; }
bool pretty_print() { return pretty_print_; }
@@ -86,7 +87,7 @@
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the file whose name was passed into the constructor.
- virtual bool Serialize(const Value& root);
+ virtual bool Serialize(const Value& root) OVERRIDE;
// Attempt to deserialize the data structure encoded in the file passed
// in to the constructor into a structure of Value objects. If the return
@@ -95,7 +96,8 @@
// If |error_message| is non-null, it will be filled in with a formatted
// error message including the location of the error if appropriate.
// The caller takes ownership of the returned value.
- virtual Value* Deserialize(int* error_code, std::string* error_message);
+ virtual Value* Deserialize(int* error_code,
+ std::string* error_message) OVERRIDE;
// This enum is designed to safely overlap with JSONReader::JsonParseError.
enum JsonFileError {
diff --git a/base/message_loop.h b/base/message_loop.h
index 00d5ba7..ac3f27a 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -253,7 +253,7 @@
// TODO(jhawkins): Remove once task.h is removed.
class QuitTask : public Task {
public:
- virtual void Run() {
+ virtual void Run() OVERRIDE {
MessageLoop::current()->Quit();
}
};
@@ -480,9 +480,9 @@
void HistogramEvent(int event);
// base::MessagePump::Delegate methods:
- virtual bool DoWork();
- virtual bool DoDelayedWork(base::TimeTicks* next_delayed_work_time);
- virtual bool DoIdleWork();
+ virtual bool DoWork() OVERRIDE;
+ virtual bool DoDelayedWork(base::TimeTicks* next_delayed_work_time) OVERRIDE;
+ virtual bool DoIdleWork() OVERRIDE;
Type type_;
diff --git a/base/message_loop_proxy_impl.h b/base/message_loop_proxy_impl.h
index 2966394..0c44c82 100644
--- a/base/message_loop_proxy_impl.h
+++ b/base/message_loop_proxy_impl.h
@@ -23,33 +23,33 @@
// MessageLoopProxy implementation
virtual bool PostTask(const tracked_objects::Location& from_here,
- Task* task);
+ Task* task) OVERRIDE;
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
Task* task,
- int64 delay_ms);
+ int64 delay_ms) OVERRIDE;
virtual bool PostNonNestableTask(const tracked_objects::Location& from_here,
- Task* task);
+ Task* task) OVERRIDE;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
Task* task,
- int64 delay_ms);
+ int64 delay_ms) OVERRIDE;
virtual bool PostTask(const tracked_objects::Location& from_here,
- const base::Closure& task);
+ const base::Closure& task) OVERRIDE;
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
- int64 delay_ms);
+ int64 delay_ms) OVERRIDE;
virtual bool PostNonNestableTask(const tracked_objects::Location& from_here,
- const base::Closure& task);
+ const base::Closure& task) OVERRIDE;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
- int64 delay_ms);
- virtual bool BelongsToCurrentThread();
+ int64 delay_ms) OVERRIDE;
+ virtual bool BelongsToCurrentThread() OVERRIDE;
protected:
// Override OnDestruct so that we can delete the object on the target message
// loop if it still exists.
- virtual void OnDestruct() const;
+ virtual void OnDestruct() const OVERRIDE;
private:
MessageLoopProxyImpl();
diff --git a/base/message_pump_default.h b/base/message_pump_default.h
index 26bd554..c16abcf 100644
--- a/base/message_pump_default.h
+++ b/base/message_pump_default.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -18,10 +18,10 @@
virtual ~MessagePumpDefault() {}
// MessagePump methods:
- virtual void Run(Delegate* delegate);
- virtual void Quit();
- virtual void ScheduleWork();
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
+ virtual void Run(Delegate* delegate) OVERRIDE;
+ virtual void Quit() OVERRIDE;
+ virtual void ScheduleWork() OVERRIDE;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
private:
// This flag is set to false when Run should return.
diff --git a/base/message_pump_libevent.h b/base/message_pump_libevent.h
index 2af3bcc..b12af70 100644
--- a/base/message_pump_libevent.h
+++ b/base/message_pump_libevent.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/message_pump.h"
#include "base/observer_list.h"
@@ -123,10 +124,10 @@
void RemoveIOObserver(IOObserver* obs);
// MessagePump methods:
- virtual void Run(Delegate* delegate);
- virtual void Quit();
- virtual void ScheduleWork();
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
+ virtual void Run(Delegate* delegate) OVERRIDE;
+ virtual void Quit() OVERRIDE;
+ virtual void ScheduleWork() OVERRIDE;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
private:
friend class MessagePumpLibeventTest;
diff --git a/base/message_pump_mac.h b/base/message_pump_mac.h
index 08d6b83..501d8c6 100644
--- a/base/message_pump_mac.h
+++ b/base/message_pump_mac.h
@@ -65,11 +65,11 @@
// in the DoRun method. MessagePumpCFRunLoopBase::Run calls DoRun directly.
// This arrangement is used because MessagePumpCFRunLoopBase needs to set
// up and tear down things before and after the "meat" of DoRun.
- virtual void Run(Delegate* delegate);
+ virtual void Run(Delegate* delegate) OVERRIDE;
virtual void DoRun(Delegate* delegate) = 0;
- virtual void ScheduleWork();
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
+ virtual void ScheduleWork() OVERRIDE;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
protected:
// Accessors for private data members to be used by subclasses.
@@ -191,11 +191,11 @@
public:
MessagePumpCFRunLoop();
- virtual void DoRun(Delegate* delegate);
- virtual void Quit();
+ virtual void DoRun(Delegate* delegate) OVERRIDE;
+ virtual void Quit() OVERRIDE;
private:
- virtual void EnterExitRunLoop(CFRunLoopActivity activity);
+ virtual void EnterExitRunLoop(CFRunLoopActivity activity) OVERRIDE;
// True if Quit is called to stop the innermost MessagePump
// (innermost_quittable_) but some other CFRunLoopRun loop (nesting_level_)
@@ -210,8 +210,8 @@
MessagePumpNSRunLoop();
virtual ~MessagePumpNSRunLoop();
- virtual void DoRun(Delegate* delegate);
- virtual void Quit();
+ virtual void DoRun(Delegate* delegate) OVERRIDE;
+ virtual void Quit() OVERRIDE;
private:
// A source that doesn't do anything but provide something signalable
@@ -229,12 +229,12 @@
public:
MessagePumpNSApplication();
- virtual void DoRun(Delegate* delegate);
- virtual void Quit();
+ virtual void DoRun(Delegate* delegate) OVERRIDE;
+ virtual void Quit() OVERRIDE;
protected:
// Returns nil if NSApp is currently in the middle of calling -sendEvent.
- virtual NSAutoreleasePool* CreateAutoreleasePool();
+ virtual NSAutoreleasePool* CreateAutoreleasePool() OVERRIDE;
private:
// False after Quit is called.
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 115c9d83..50cd90d 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -674,11 +674,12 @@
Flags flags);
// Overridden from Histogram:
- virtual ClassType histogram_type() const;
+ virtual ClassType histogram_type() const OVERRIDE;
// Store a list of number/text values for use in rendering the histogram.
// The last element in the array has a null in its "description" slot.
- virtual void SetRangeDescriptions(const DescriptionPair descriptions[]);
+ virtual void SetRangeDescriptions(
+ const DescriptionPair descriptions[]) OVERRIDE;
protected:
LinearHistogram(const std::string& name, Sample minimum,
@@ -689,15 +690,15 @@
// Initialize ranges_ mapping in cached_ranges_.
void InitializeBucketRange();
- virtual double GetBucketSize(Count current, size_t i) const;
+ virtual double GetBucketSize(Count current, size_t i) const OVERRIDE;
// If we have a description for a bucket, then return that. Otherwise
// let parent class provide a (numeric) description.
- virtual const std::string GetAsciiBucketRange(size_t i) const;
+ virtual const std::string GetAsciiBucketRange(size_t i) const OVERRIDE;
// Skip printing of name for numeric range if we have a name (and if this is
// an empty bucket).
- virtual bool PrintEmptyBucket(size_t index) const;
+ virtual bool PrintEmptyBucket(size_t index) const OVERRIDE;
private:
// For some ranges, we store a printable description of a bucket range.
@@ -716,9 +717,9 @@
public:
static Histogram* FactoryGet(const std::string& name, Flags flags);
- virtual ClassType histogram_type() const;
+ virtual ClassType histogram_type() const OVERRIDE;
- virtual void AddBoolean(bool value);
+ virtual void AddBoolean(bool value) OVERRIDE;
private:
explicit BooleanHistogram(const std::string& name);
@@ -737,7 +738,7 @@
Flags flags);
// Overridden from Histogram:
- virtual ClassType histogram_type() const;
+ virtual ClassType histogram_type() const OVERRIDE;
// Helper method for transforming an array of valid enumeration values
// to the std::vector<int> expected by HISTOGRAM_CUSTOM_ENUMERATION.
@@ -761,7 +762,7 @@
// Initialize ranges_ mapping in cached_ranges_.
void InitializedCustomBucketRange(const std::vector<Sample>& custom_ranges);
- virtual double GetBucketSize(Count current, size_t i) const;
+ virtual double GetBucketSize(Count current, size_t i) const OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(CustomHistogram);
};
diff --git a/base/metrics/stats_counters.h b/base/metrics/stats_counters.h
index 9ba3517..08c29c3 100644
--- a/base/metrics/stats_counters.h
+++ b/base/metrics/stats_counters.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/base_export.h"
+#include "base/compiler_specific.h"
#include "base/metrics/stats_table.h"
#include "base/time.h"
@@ -164,7 +165,7 @@
explicit StatsRate(const std::string& name);
virtual ~StatsRate();
- virtual void Add(int value);
+ virtual void Add(int value) OVERRIDE;
private:
StatsCounter counter_;
diff --git a/base/process_util.h b/base/process_util.h
index fb2eb44..1143cd8 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -560,7 +560,7 @@
virtual ~NamedProcessIterator();
protected:
- virtual bool IncludeEntry();
+ virtual bool IncludeEntry() OVERRIDE;
private:
FilePath::StringType executable_name_;
diff --git a/base/synchronization/waitable_event_watcher.h b/base/synchronization/waitable_event_watcher.h
index a180d67..5bfe5f7 100644
--- a/base/synchronization/waitable_event_watcher.h
+++ b/base/synchronization/waitable_event_watcher.h
@@ -145,7 +145,7 @@
// ---------------------------------------------------------------------------
// Implementation of MessageLoop::DestructionObserver
// ---------------------------------------------------------------------------
- virtual void WillDestroyCurrentMessageLoop();
+ virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
MessageLoop* message_loop_;
scoped_refptr<Flag> cancel_flag_;
diff --git a/base/task_queue.h b/base/task_queue.h
index 877201c4..984ffd1 100644
--- a/base/task_queue.h
+++ b/base/task_queue.h
@@ -34,7 +34,7 @@
// Run all the tasks in the queue. New tasks pushed onto the queue during
// a run will be run next time |Run| is called.
- virtual void Run();
+ virtual void Run() OVERRIDE;
private:
// The list of tasks we are waiting to run.
diff --git a/base/test/perf_test_suite.h b/base/test/perf_test_suite.h
index 83d5b37..3387892 100644
--- a/base/test/perf_test_suite.h
+++ b/base/test/perf_test_suite.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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,8 +14,8 @@
public:
PerfTestSuite(int argc, char** argv);
- virtual void Initialize();
- virtual void Shutdown();
+ virtual void Initialize() OVERRIDE;
+ virtual void Shutdown() OVERRIDE;
};
} // namespace base
diff --git a/base/test/signaling_task.h b/base/test/signaling_task.h
index 5e64bf8d..f7db5c2 100644
--- a/base/test/signaling_task.h
+++ b/base/test/signaling_task.h
@@ -19,7 +19,7 @@
explicit SignalingTask(base::WaitableEvent* event);
virtual ~SignalingTask();
- virtual void Run();
+ virtual void Run() OVERRIDE;
private:
base::WaitableEvent* event_;
diff --git a/base/threading/simple_thread.h b/base/threading/simple_thread.h
index ae36f26e..c864d467 100644
--- a/base/threading/simple_thread.h
+++ b/base/threading/simple_thread.h
@@ -47,6 +47,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/threading/platform_thread.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
@@ -102,7 +103,7 @@
bool HasBeenJoined() { return joined_; }
// Overridden from PlatformThread::Delegate:
- virtual void ThreadMain();
+ virtual void ThreadMain() OVERRIDE;
// Only set priorities with a careful understanding of the consequences.
// This is meant for very limited use cases.
@@ -136,7 +137,7 @@
const Options& options);
virtual ~DelegateSimpleThread();
- virtual void Run();
+ virtual void Run() OVERRIDE;
private:
Delegate* delegate_;
};
@@ -174,7 +175,7 @@
}
// We implement the Delegate interface, for running our internal threads.
- virtual void Run();
+ virtual void Run() OVERRIDE;
private:
const std::string name_prefix_;
diff --git a/base/threading/thread.h b/base/threading/thread.h
index 7ba3892..3f4fa50b 100644
--- a/base/threading/thread.h
+++ b/base/threading/thread.h
@@ -156,7 +156,7 @@
bool thread_was_started() const { return started_; }
// PlatformThread::Delegate methods:
- virtual void ThreadMain();
+ virtual void ThreadMain() OVERRIDE;
// Whether we successfully started the thread.
bool started_;
diff --git a/base/threading/thread_collision_warner.h b/base/threading/thread_collision_warner.h
index 24f0920..a9dfc0a 100644
--- a/base/threading/thread_collision_warner.h
+++ b/base/threading/thread_collision_warner.h
@@ -8,8 +8,9 @@
#include <memory>
-#include "base/base_export.h"
#include "base/atomicops.h"
+#include "base/base_export.h"
+#include "base/compiler_specific.h"
// A helper class alongside macros to be used to verify assumptions about thread
// safety of a class.
@@ -138,7 +139,7 @@
struct BASE_EXPORT DCheckAsserter : public AsserterBase {
virtual ~DCheckAsserter() {}
- virtual void warn();
+ virtual void warn() OVERRIDE;
};
class BASE_EXPORT ThreadCollisionWarner {
diff --git a/base/threading/watchdog.h b/base/threading/watchdog.h
index 6ee5002..7650b44 100644
--- a/base/threading/watchdog.h
+++ b/base/threading/watchdog.h
@@ -22,6 +22,7 @@
#include <string>
#include "base/base_export.h"
+#include "base/compiler_specific.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/threading/platform_thread.h"
@@ -58,7 +59,7 @@
public:
explicit ThreadDelegate(Watchdog* watchdog) : watchdog_(watchdog) {
}
- virtual void ThreadMain();
+ virtual void ThreadMain() OVERRIDE;
private:
void SetThreadName() const;