From 93a52eb4ae8ab7f40624f780f33156f42fcbd140 Mon Sep 17 00:00:00 2001 From: dcheng Date: Mon, 22 Dec 2014 18:14:23 -0800 Subject: Standardize usage of virtual/override/final specifiers in cc/. The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. Several formatting edits by clang-format were manually reverted, due to mangling of some of the more complicate IPC macros. BUG=417463 Review URL: https://codereview.chromium.org/818033004 Cr-Commit-Position: refs/heads/master@{#309520} --- cc/trees/layer_tree_host_common_unittest.cc | 2 +- cc/trees/layer_tree_host_unittest_no_message_loop.cc | 2 +- cc/trees/layer_tree_host_unittest_proxy.cc | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'cc/trees') diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 72eb287..01941c1 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -5672,7 +5672,7 @@ class LCDTextTest : public LayerTreeHostCommonTestBase, public testing::TestWithParam { protected: - virtual void SetUp() { + void SetUp() override { can_use_lcd_text_ = std::tr1::get<0>(GetParam()); layers_always_allowed_lcd_text_ = std::tr1::get<1>(GetParam()); diff --git a/cc/trees/layer_tree_host_unittest_no_message_loop.cc b/cc/trees/layer_tree_host_unittest_no_message_loop.cc index 102e8ac..3e87b55 100644 --- a/cc/trees/layer_tree_host_unittest_no_message_loop.cc +++ b/cc/trees/layer_tree_host_unittest_no_message_loop.cc @@ -51,7 +51,7 @@ class LayerTreeHostNoMessageLoopTest did_commit_and_draw_frame_(false), size_(100, 100), no_loop_thread_(this, "LayerTreeHostNoMessageLoopTest") {} - virtual ~LayerTreeHostNoMessageLoopTest() {} + ~LayerTreeHostNoMessageLoopTest() override {} // LayerTreeHostClient overrides. void WillBeginMainFrame(int frame_id) override {} diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc index f27b553..3135103 100644 --- a/cc/trees/layer_tree_host_unittest_proxy.cc +++ b/cc/trees/layer_tree_host_unittest_proxy.cc @@ -28,7 +28,7 @@ namespace cc { class ProxyTest : public LayerTreeTest { protected: ProxyTest() {} - virtual ~ProxyTest() {} + ~ProxyTest() override {} void Run(bool threaded, bool impl_side_painting) { // We don't need to care about delegating mode. @@ -67,7 +67,7 @@ class ProxyTestScheduledActionsBasic : public ProxyTest { ProxyTestScheduledActionsBasic() : action_phase_(0) { } - virtual ~ProxyTestScheduledActionsBasic() {} + ~ProxyTestScheduledActionsBasic() override {} private: int action_phase_; @@ -80,7 +80,7 @@ PROXY_TEST_SCHEDULED_ACTION(ProxyTestScheduledActionsBasic); class ThreadProxyTest : public ProxyTest { protected: ThreadProxyTest() {} - virtual ~ThreadProxyTest() {} + ~ThreadProxyTest() override {} const ThreadProxy::MainThreadOnly& ThreadProxyMainOnly() const { DCHECK(proxy()); @@ -101,7 +101,7 @@ class ThreadProxyTest : public ProxyTest { class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest { protected: ThreadProxyTestSetNeedsCommit() {} - virtual ~ThreadProxyTestSetNeedsCommit() {} + ~ThreadProxyTestSetNeedsCommit() override {} void BeginTest() override { EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); -- cgit v1.1