Skip to content

Commit

Permalink
Standardize usage of virtual/override/final in cc/
Browse files Browse the repository at this point in the history
BUG=417463
TBR=enne@chromium.org

Review URL: https://codereview.chromium.org/645853008

Cr-Commit-Position: refs/heads/master@{#300439}
  • Loading branch information
zetafunction authored and Commit bot committed Oct 21, 2014
1 parent 6c879fb commit 716bedf
Show file tree
Hide file tree
Showing 220 changed files with 2,890 additions and 3,251 deletions.
16 changes: 8 additions & 8 deletions cc/animation/animation_curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ class CC_EXPORT AnimationCurve {

class CC_EXPORT ColorAnimationCurve : public AnimationCurve {
public:
virtual ~ColorAnimationCurve() {}
~ColorAnimationCurve() override {}

virtual SkColor GetValue(double t) const = 0;

// Partial Animation implementation.
virtual CurveType Type() const override;
CurveType Type() const override;
};

class CC_EXPORT FloatAnimationCurve : public AnimationCurve {
public:
virtual ~FloatAnimationCurve() {}
~FloatAnimationCurve() override {}

virtual float GetValue(double t) const = 0;

// Partial Animation implementation.
virtual CurveType Type() const override;
CurveType Type() const override;
};

class CC_EXPORT TransformAnimationCurve : public AnimationCurve {
public:
virtual ~TransformAnimationCurve() {}
~TransformAnimationCurve() override {}

virtual gfx::Transform GetValue(double t) const = 0;

Expand All @@ -90,18 +90,18 @@ class CC_EXPORT TransformAnimationCurve : public AnimationCurve {
float* max_scale) const = 0;

// Partial Animation implementation.
virtual CurveType Type() const override;
CurveType Type() const override;
};

class CC_EXPORT FilterAnimationCurve : public AnimationCurve {
public:
virtual ~FilterAnimationCurve() {}
~FilterAnimationCurve() override {}

virtual FilterOperations GetValue(double t) const = 0;
virtual bool HasFilterThatMovesPixels() const = 0;

// Partial Animation implementation.
virtual CurveType Type() const override;
CurveType Type() const override;
};

} // namespace cc
Expand Down
54 changes: 27 additions & 27 deletions cc/animation/keyframed_animation_curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CC_EXPORT ColorKeyframe : public Keyframe {
double time,
SkColor value,
scoped_ptr<TimingFunction> timing_function);
virtual ~ColorKeyframe();
~ColorKeyframe() override;

SkColor Value() const;

Expand All @@ -57,7 +57,7 @@ class CC_EXPORT FloatKeyframe : public Keyframe {
double time,
float value,
scoped_ptr<TimingFunction> timing_function);
virtual ~FloatKeyframe();
~FloatKeyframe() override;

float Value() const;

Expand All @@ -77,7 +77,7 @@ class CC_EXPORT TransformKeyframe : public Keyframe {
double time,
const TransformOperations& value,
scoped_ptr<TimingFunction> timing_function);
virtual ~TransformKeyframe();
~TransformKeyframe() override;

const TransformOperations& Value() const;

Expand All @@ -98,7 +98,7 @@ class CC_EXPORT FilterKeyframe : public Keyframe {
double time,
const FilterOperations& value,
scoped_ptr<TimingFunction> timing_function);
virtual ~FilterKeyframe();
~FilterKeyframe() override;

const FilterOperations& Value() const;

Expand All @@ -118,19 +118,19 @@ class CC_EXPORT KeyframedColorAnimationCurve : public ColorAnimationCurve {
// It is required that the keyframes be sorted by time.
static scoped_ptr<KeyframedColorAnimationCurve> Create();

virtual ~KeyframedColorAnimationCurve();
~KeyframedColorAnimationCurve() override;

void AddKeyframe(scoped_ptr<ColorKeyframe> keyframe);
void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) {
timing_function_ = timing_function.Pass();
}

// AnimationCurve implementation
virtual double Duration() const override;
virtual scoped_ptr<AnimationCurve> Clone() const override;
double Duration() const override;
scoped_ptr<AnimationCurve> Clone() const override;

// BackgrounColorAnimationCurve implementation
virtual SkColor GetValue(double t) const override;
SkColor GetValue(double t) const override;

private:
KeyframedColorAnimationCurve();
Expand All @@ -148,19 +148,19 @@ class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve {
// It is required that the keyframes be sorted by time.
static scoped_ptr<KeyframedFloatAnimationCurve> Create();

virtual ~KeyframedFloatAnimationCurve();
~KeyframedFloatAnimationCurve() override;

void AddKeyframe(scoped_ptr<FloatKeyframe> keyframe);
void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) {
timing_function_ = timing_function.Pass();
}

// AnimationCurve implementation
virtual double Duration() const override;
virtual scoped_ptr<AnimationCurve> Clone() const override;
double Duration() const override;
scoped_ptr<AnimationCurve> Clone() const override;

// FloatAnimationCurve implementation
virtual float GetValue(double t) const override;
float GetValue(double t) const override;

private:
KeyframedFloatAnimationCurve();
Expand All @@ -179,25 +179,25 @@ class CC_EXPORT KeyframedTransformAnimationCurve
// It is required that the keyframes be sorted by time.
static scoped_ptr<KeyframedTransformAnimationCurve> Create();

virtual ~KeyframedTransformAnimationCurve();
~KeyframedTransformAnimationCurve() override;

void AddKeyframe(scoped_ptr<TransformKeyframe> keyframe);
void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) {
timing_function_ = timing_function.Pass();
}

// AnimationCurve implementation
virtual double Duration() const override;
virtual scoped_ptr<AnimationCurve> Clone() const override;
double Duration() const override;
scoped_ptr<AnimationCurve> Clone() const override;

// TransformAnimationCurve implementation
virtual gfx::Transform GetValue(double t) const override;
virtual bool AnimatedBoundsForBox(const gfx::BoxF& box,
gfx::BoxF* bounds) const override;
virtual bool AffectsScale() const override;
virtual bool IsTranslation() const override;
virtual bool MaximumTargetScale(bool forward_direction,
float* max_scale) const override;
gfx::Transform GetValue(double t) const override;
bool AnimatedBoundsForBox(const gfx::BoxF& box,
gfx::BoxF* bounds) const override;
bool AffectsScale() const override;
bool IsTranslation() const override;
bool MaximumTargetScale(bool forward_direction,
float* max_scale) const override;

private:
KeyframedTransformAnimationCurve();
Expand All @@ -216,20 +216,20 @@ class CC_EXPORT KeyframedFilterAnimationCurve
// It is required that the keyframes be sorted by time.
static scoped_ptr<KeyframedFilterAnimationCurve> Create();

virtual ~KeyframedFilterAnimationCurve();
~KeyframedFilterAnimationCurve() override;

void AddKeyframe(scoped_ptr<FilterKeyframe> keyframe);
void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) {
timing_function_ = timing_function.Pass();
}

// AnimationCurve implementation
virtual double Duration() const override;
virtual scoped_ptr<AnimationCurve> Clone() const override;
double Duration() const override;
scoped_ptr<AnimationCurve> Clone() const override;

// FilterAnimationCurve implementation
virtual FilterOperations GetValue(double t) const override;
virtual bool HasFilterThatMovesPixels() const override;
FilterOperations GetValue(double t) const override;
bool HasFilterThatMovesPixels() const override;

private:
KeyframedFilterAnimationCurve();
Expand Down
13 changes: 6 additions & 7 deletions cc/animation/layer_animation_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -859,16 +859,15 @@ class FakeAnimationDelegate : public AnimationDelegate {
: started_(false),
finished_(false) {}

virtual void NotifyAnimationStarted(TimeTicks monotonic_time,
Animation::TargetProperty target_property,
int group) override {
void NotifyAnimationStarted(TimeTicks monotonic_time,
Animation::TargetProperty target_property,
int group) override {
started_ = true;
}

virtual void NotifyAnimationFinished(
TimeTicks monotonic_time,
Animation::TargetProperty target_property,
int group) override {
void NotifyAnimationFinished(TimeTicks monotonic_time,
Animation::TargetProperty target_property,
int group) override {
finished_ = true;
}

Expand Down
8 changes: 4 additions & 4 deletions cc/animation/scroll_offset_animation_curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve {
const gfx::ScrollOffset& target_value,
scoped_ptr<TimingFunction> timing_function);

virtual ~ScrollOffsetAnimationCurve();
~ScrollOffsetAnimationCurve() override;

void SetInitialValue(const gfx::ScrollOffset& initial_value);
gfx::ScrollOffset GetValue(double t) const;
gfx::ScrollOffset target_value() const { return target_value_; }
void UpdateTarget(double t, const gfx::ScrollOffset& new_target);

// AnimationCurve implementation
virtual double Duration() const override;
virtual CurveType Type() const override;
virtual scoped_ptr<AnimationCurve> Clone() const override;
double Duration() const override;
CurveType Type() const override;
scoped_ptr<AnimationCurve> Clone() const override;

private:
ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value,
Expand Down
6 changes: 3 additions & 3 deletions cc/animation/scrollbar_animation_controller_linear_fade.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class CC_EXPORT ScrollbarAnimationControllerLinearFade
base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);

virtual ~ScrollbarAnimationControllerLinearFade();
~ScrollbarAnimationControllerLinearFade() override;

virtual void DidScrollUpdate(bool on_resize) override;
void DidScrollUpdate(bool on_resize) override;

protected:
ScrollbarAnimationControllerLinearFade(
Expand All @@ -34,7 +34,7 @@ class CC_EXPORT ScrollbarAnimationControllerLinearFade
base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);

virtual void RunAnimationFrame(float progress) override;
void RunAnimationFrame(float progress) override;

private:
float OpacityAtTime(base::TimeTicks now) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ class ScrollbarAnimationControllerLinearFadeTest
ScrollbarAnimationControllerLinearFadeTest()
: host_impl_(&proxy_, &shared_bitmap_manager_), needs_frame_count_(0) {}

virtual void PostDelayedScrollbarFade(const base::Closure& start_fade,
base::TimeDelta delay) override {
void PostDelayedScrollbarFade(const base::Closure& start_fade,
base::TimeDelta delay) override {
start_fade_ = start_fade;
delay_ = delay;
}
virtual void SetNeedsScrollbarAnimationFrame() override {
needs_frame_count_++;
}
void SetNeedsScrollbarAnimationFrame() override { needs_frame_count_++; }

protected:
virtual void SetUp() {
Expand Down Expand Up @@ -83,7 +81,7 @@ class ScrollbarAnimationControllerLinearFadeTest
class VerticalScrollbarAnimationControllerLinearFadeTest
: public ScrollbarAnimationControllerLinearFadeTest {
protected:
virtual ScrollbarOrientation orientation() const override { return VERTICAL; }
ScrollbarOrientation orientation() const override { return VERTICAL; }
};

TEST_F(ScrollbarAnimationControllerLinearFadeTest, DelayAnimationOnResize) {
Expand Down
10 changes: 5 additions & 5 deletions cc/animation/scrollbar_animation_controller_thinning.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ class CC_EXPORT ScrollbarAnimationControllerThinning
base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);

virtual ~ScrollbarAnimationControllerThinning();
~ScrollbarAnimationControllerThinning() override;

void set_mouse_move_distance_for_test(float distance) {
mouse_move_distance_to_trigger_animation_ = distance;
}
bool mouse_is_over_scrollbar() const { return mouse_is_over_scrollbar_; }
bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; }

virtual void DidScrollUpdate(bool on_resize) override;
virtual void DidMouseMoveOffScrollbar() override;
virtual void DidMouseMoveNear(float distance) override;
void DidScrollUpdate(bool on_resize) override;
void DidMouseMoveOffScrollbar() override;
void DidMouseMoveNear(float distance) override;

protected:
ScrollbarAnimationControllerThinning(
Expand All @@ -44,7 +44,7 @@ class CC_EXPORT ScrollbarAnimationControllerThinning
base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);

virtual void RunAnimationFrame(float progress) override;
void RunAnimationFrame(float progress) override;

private:
// Describes whether the current animation should INCREASE (darken / thicken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class ScrollbarAnimationControllerThinningTest
ScrollbarAnimationControllerThinningTest()
: host_impl_(&proxy_, &shared_bitmap_manager_) {}

virtual void PostDelayedScrollbarFade(const base::Closure& start_fade,
base::TimeDelta delay) override {
void PostDelayedScrollbarFade(const base::Closure& start_fade,
base::TimeDelta delay) override {
start_fade_ = start_fade;
}
virtual void SetNeedsScrollbarAnimationFrame() override {}
void SetNeedsScrollbarAnimationFrame() override {}

protected:
virtual void SetUp() {
Expand Down
10 changes: 5 additions & 5 deletions cc/animation/timing_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class CC_EXPORT CubicBezierTimingFunction : public TimingFunction {
public:
static scoped_ptr<CubicBezierTimingFunction> Create(double x1, double y1,
double x2, double y2);
virtual ~CubicBezierTimingFunction();
~CubicBezierTimingFunction() override;

// TimingFunction implementation.
virtual float GetValue(double time) const override;
virtual float Velocity(double time) const override;
virtual void Range(float* min, float* max) const override;
virtual scoped_ptr<TimingFunction> Clone() const override;
float GetValue(double time) const override;
float Velocity(double time) const override;
void Range(float* min, float* max) const override;
scoped_ptr<TimingFunction> Clone() const override;

protected:
CubicBezierTimingFunction(double x1, double y1, double x2, double y2);
Expand Down
4 changes: 2 additions & 2 deletions cc/base/delayed_unique_notifier_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class TestNotifier : public DelayedUniqueNotifier {
const base::Closure& closure,
const base::TimeDelta& delay)
: DelayedUniqueNotifier(task_runner, closure, delay) {}
virtual ~TestNotifier() {}
~TestNotifier() override {}

// Overridden from DelayedUniqueNotifier:
virtual base::TimeTicks Now() const override { return now_; }
base::TimeTicks Now() const override { return now_; }

void SetNow(base::TimeTicks now) { now_ = now; }

Expand Down
8 changes: 4 additions & 4 deletions cc/base/latency_info_swap_promise.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ namespace cc {
class CC_EXPORT LatencyInfoSwapPromise : public SwapPromise {
public:
explicit LatencyInfoSwapPromise(const ui::LatencyInfo& latency_info);
virtual ~LatencyInfoSwapPromise();
~LatencyInfoSwapPromise() override;

virtual void DidSwap(CompositorFrameMetadata* metadata) override;
virtual void DidNotSwap(DidNotSwapReason reason) override;
void DidSwap(CompositorFrameMetadata* metadata) override;
void DidNotSwap(DidNotSwapReason reason) override;

virtual int64 TraceId() const override;
int64 TraceId() const override;

private:
ui::LatencyInfo latency_;
Expand Down
Loading

0 comments on commit 716bedf

Please sign in to comment.