Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/media/capture/web_contents_video_capture_device_unittest.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
index 42faca1cba2c399baa37eb998041b3581276654f..e9fa2a2341608c7964d397da7f8b7c298d6aeafa 100644
--- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -163,18 +163,18 @@ class CaptureTestView : public TestRenderWidgetHostView {
: TestRenderWidgetHostView(rwh),
controller_(controller) {}
- virtual ~CaptureTestView() {}
+ ~CaptureTestView() override {}
// TestRenderWidgetHostView overrides.
- virtual gfx::Rect GetViewBounds() const override {
+ gfx::Rect GetViewBounds() const override {
return gfx::Rect(100, 100, 100 + kTestWidth, 100 + kTestHeight);
}
- virtual bool CanCopyToVideoFrame() const override {
+ bool CanCopyToVideoFrame() const override {
return controller_->CanCopyToVideoFrame();
}
- virtual void CopyFromCompositingSurfaceToVideoFrame(
+ void CopyFromCompositingSurfaceToVideoFrame(
const gfx::Rect& src_subrect,
const scoped_refptr<media::VideoFrame>& target,
const base::Callback<void(bool)>& callback) override {
@@ -185,14 +185,12 @@ class CaptureTestView : public TestRenderWidgetHostView {
controller_->SignalCopy();
}
- virtual void BeginFrameSubscription(
+ void BeginFrameSubscription(
scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override {
subscriber_.reset(subscriber.release());
}
- virtual void EndFrameSubscription() override {
- subscriber_.reset();
- }
+ void EndFrameSubscription() override { subscriber_.reset(); }
// Simulate a compositor paint event for our subscriber.
void SimulateUpdate() {
@@ -248,7 +246,7 @@ class CaptureTestRenderViewHost : public TestRenderViewHost {
}
// TestRenderViewHost overrides.
- virtual void CopyFromBackingStore(
+ void CopyFromBackingStore(
const gfx::Rect& src_rect,
const gfx::Size& accelerated_dst_size,
const base::Callback<void(bool, const SkBitmap&)>& callback,
@@ -286,12 +284,10 @@ class CaptureTestRenderViewHostFactory : public RenderViewHostFactory {
RegisterFactory(this);
}
- virtual ~CaptureTestRenderViewHostFactory() {
- UnregisterFactory();
- }
+ ~CaptureTestRenderViewHostFactory() override { UnregisterFactory(); }
// RenderViewHostFactory implementation.
- virtual RenderViewHost* CreateRenderViewHost(
+ RenderViewHost* CreateRenderViewHost(
SiteInstance* instance,
RenderViewHostDelegate* delegate,
RenderWidgetHostDelegate* widget_delegate,
@@ -318,11 +314,11 @@ class StubClient : public media::VideoCaptureDevice::Client {
error_callback_(error_callback) {
buffer_pool_ = new VideoCaptureBufferPool(2);
}
- virtual ~StubClient() {}
+ ~StubClient() override {}
- virtual scoped_refptr<media::VideoCaptureDevice::Client::Buffer>
- ReserveOutputBuffer(media::VideoFrame::Format format,
- const gfx::Size& dimensions) override {
+ scoped_refptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer(
+ media::VideoFrame::Format format,
+ const gfx::Size& dimensions) override {
CHECK_EQ(format, media::VideoFrame::I420);
const size_t frame_bytes =
media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions);
@@ -338,16 +334,15 @@ class StubClient : public media::VideoCaptureDevice::Client {
new PoolBuffer(buffer_pool_, buffer_id, data, size));
}
- virtual void OnIncomingCapturedData(
- const uint8* data,
- int length,
- const media::VideoCaptureFormat& frame_format,
- int rotation,
- base::TimeTicks timestamp) override {
+ void OnIncomingCapturedData(const uint8* data,
+ int length,
+ const media::VideoCaptureFormat& frame_format,
+ int rotation,
+ base::TimeTicks timestamp) override {
FAIL();
}
- virtual void OnIncomingCapturedVideoFrame(
+ void OnIncomingCapturedVideoFrame(
const scoped_refptr<Buffer>& buffer,
const media::VideoCaptureFormat& buffer_format,
const scoped_refptr<media::VideoFrame>& frame,
@@ -364,9 +359,7 @@ class StubClient : public media::VideoCaptureDevice::Client {
color_callback_.Run((SkColorSetRGB(yuv[0], yuv[1], yuv[2])));
}
- virtual void OnError(const std::string& reason) override {
- error_callback_.Run();
- }
+ void OnError(const std::string& reason) override { error_callback_.Run(); }
private:
class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer {
@@ -378,7 +371,7 @@ class StubClient : public media::VideoCaptureDevice::Client {
: Buffer(buffer_id, data, size), pool_(pool) {}
private:
- virtual ~PoolBuffer() { pool_->RelinquishProducerReservation(id()); }
+ ~PoolBuffer() override { pool_->RelinquishProducerReservation(id()); }
const scoped_refptr<VideoCaptureBufferPool> pool_;
};
@@ -476,35 +469,31 @@ class FakeScreen : public gfx::Screen {
FakeScreen() : the_one_display_(0x1337, gfx::Rect(0, 0, 2560, 1440)) {
the_one_display_.set_device_scale_factor(kTestDeviceScaleFactor);
}
- virtual ~FakeScreen() {}
+ ~FakeScreen() override {}
// gfx::Screen implementation (only what's needed for testing).
- virtual bool IsDIPEnabled() override { return true; }
- virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); }
- virtual gfx::NativeWindow GetWindowUnderCursor() override { return NULL; }
- virtual gfx::NativeWindow GetWindowAtScreenPoint(
- const gfx::Point& point) override { return NULL; }
- virtual int GetNumDisplays() const override { return 1; }
- virtual std::vector<gfx::Display> GetAllDisplays() const override {
+ bool IsDIPEnabled() override { return true; }
+ gfx::Point GetCursorScreenPoint() override { return gfx::Point(); }
+ gfx::NativeWindow GetWindowUnderCursor() override { return NULL; }
+ gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
+ return NULL;
+ }
+ int GetNumDisplays() const override { return 1; }
+ std::vector<gfx::Display> GetAllDisplays() const override {
return std::vector<gfx::Display>(1, the_one_display_);
}
- virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView view) const override {
- return the_one_display_;
- }
- virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const override {
+ gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override {
return the_one_display_;
}
- virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const override {
+ gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override {
return the_one_display_;
}
- virtual gfx::Display GetPrimaryDisplay() const override {
+ gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
return the_one_display_;
}
- virtual void AddObserver(gfx::DisplayObserver* observer) override {}
- virtual void RemoveObserver(gfx::DisplayObserver* observer) override {}
+ gfx::Display GetPrimaryDisplay() const override { return the_one_display_; }
+ void AddObserver(gfx::DisplayObserver* observer) override {}
+ void RemoveObserver(gfx::DisplayObserver* observer) override {}
private:
gfx::Display the_one_display_;

Powered by Google App Engine
This is Rietveld 408576698