summaryrefslogtreecommitdiffstats
path: root/ui/compositor/layer_animator_unittest.cc
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-29 13:07:24 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-29 20:07:50 +0000
commitbc07fa0200dee43bf23c3963357ea7fb41cd91c3 (patch)
tree237476f9f00b31535d9d5d00586db015dcc4e13e /ui/compositor/layer_animator_unittest.cc
parente06ac71b008ed40a81c2152382a31c23e537934d (diff)
downloadchromium_src-bc07fa0200dee43bf23c3963357ea7fb41cd91c3.zip
chromium_src-bc07fa0200dee43bf23c3963357ea7fb41cd91c3.tar.gz
chromium_src-bc07fa0200dee43bf23c3963357ea7fb41cd91c3.tar.bz2
Standardize usage of virtual/override/final specifiers.
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. BUG=417463 R=sky@chromium.org Review URL: https://codereview.chromium.org/670923003 Cr-Commit-Position: refs/heads/master@{#301914}
Diffstat (limited to 'ui/compositor/layer_animator_unittest.cc')
-rw-r--r--ui/compositor/layer_animator_unittest.cc41
1 files changed, 16 insertions, 25 deletions
diff --git a/ui/compositor/layer_animator_unittest.cc b/ui/compositor/layer_animator_unittest.cc
index ad4ff61..99d2426 100644
--- a/ui/compositor/layer_animator_unittest.cc
+++ b/ui/compositor/layer_animator_unittest.cc
@@ -80,11 +80,11 @@ class TestImplicitAnimationObserver : public ImplicitAnimationObserver {
private:
// ImplicitAnimationObserver implementation
- virtual void OnImplicitAnimationsCompleted() override {
+ void OnImplicitAnimationsCompleted() override {
animations_completed_ = true;
}
- virtual bool RequiresNotificationWhenAnimatorDestroyed() const override {
+ bool RequiresNotificationWhenAnimatorDestroyed() const override {
return notify_when_animator_destructed_;
}
@@ -101,19 +101,15 @@ class DeletingLayerAnimationObserver : public LayerAnimationObserver {
: animator_(animator) {
}
- virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) override {
+ void OnLayerAnimationEnded(LayerAnimationSequence* sequence) override {
animator_->StopAnimating();
}
- virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) override {
+ void OnLayerAnimationAborted(LayerAnimationSequence* sequence) override {
animator_->StopAnimating();
}
- virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) override {
- }
+ void OnLayerAnimationScheduled(LayerAnimationSequence* sequence) override {}
private:
LayerAnimator* animator_;
@@ -151,14 +147,14 @@ class TestLayerAnimator : public LayerAnimator {
}
protected:
- virtual ~TestLayerAnimator() {
+ ~TestLayerAnimator() override {
if (destruction_observer_) {
destruction_observer_->NotifyAnimatorDeleted();
}
}
- virtual void ProgressAnimation(LayerAnimationSequence* sequence,
- base::TimeTicks now) override {
+ void ProgressAnimation(LayerAnimationSequence* sequence,
+ base::TimeTicks now) override {
EXPECT_TRUE(HasAnimation(sequence));
LayerAnimator::ProgressAnimation(sequence, now);
}
@@ -180,9 +176,7 @@ class TestLayerAnimationSequence : public LayerAnimationSequence {
(*num_live_instances_)++;
}
- virtual ~TestLayerAnimationSequence() {
- (*num_live_instances_)--;
- }
+ ~TestLayerAnimationSequence() override { (*num_live_instances_)--; }
private:
int* num_live_instances_;
@@ -1948,7 +1942,7 @@ TEST(LayerAnimatorTest, CallbackDeletesAnimationInProgress) {
max_width_(max_width) {
}
- virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) override {
+ void SetBoundsFromAnimation(const gfx::Rect& bounds) override {
TestLayerAnimationDelegate::SetBoundsFromAnimation(bounds);
if (bounds.width() > max_width_)
animator_->StopAnimating();
@@ -2252,7 +2246,7 @@ public:
animator()->AddObserver(this);
}
- virtual ~DeletingObserver() {
+ ~DeletingObserver() override {
animator()->RemoveObserver(this);
*was_deleted_ = true;
}
@@ -2281,20 +2275,17 @@ public:
}
// LayerAnimationObserver implementation.
- virtual void OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) override {
+ void OnLayerAnimationEnded(LayerAnimationSequence* sequence) override {
if (delete_on_animation_ended_)
delete this;
}
- virtual void OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) override {
+ void OnLayerAnimationAborted(LayerAnimationSequence* sequence) override {
if (delete_on_animation_aborted_)
delete this;
}
- virtual void OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) override {
+ void OnLayerAnimationScheduled(LayerAnimationSequence* sequence) override {
if (delete_on_animation_scheduled_)
delete this;
}
@@ -2505,10 +2496,10 @@ TEST(LayerAnimatorTest, TestScopedCounterAnimation) {
class CollectionLayerAnimationDelegate : public TestLayerAnimationDelegate {
public:
CollectionLayerAnimationDelegate() : collection(NULL) {}
- virtual ~CollectionLayerAnimationDelegate() {}
+ ~CollectionLayerAnimationDelegate() override {}
// LayerAnimationDelegate:
- virtual LayerAnimatorCollection* GetLayerAnimatorCollection() override {
+ LayerAnimatorCollection* GetLayerAnimatorCollection() override {
return &collection;
}