Skip to content

Commit

Permalink
Chrome style plugin: enable virtual specifier checks for Gmock object…
Browse files Browse the repository at this point in the history
…s in //gpu

Previously, the plugin completely skipped virtual specifier checks on
Gmock objects since it wasn't smart enough to filter out warnings caused
by Gmock macros. In preparation for making the plugin smarter, this CL
fixes existing virtual specifier warnings in //gpu.

R=piman@chromium.org

Bug: 837148
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ica08fb44c7c548c3467d96b13888b4ce87956350
Reviewed-on: https://chromium-review.googlesource.com/1031191
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554277}
  • Loading branch information
zetafunction authored and Commit Bot committed Apr 27, 2018
1 parent e80ef29 commit c50b3f0
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions gpu/command_buffer/client/client_test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class MockClientCommandBuffer : public CommandBuffer,
class MockClientCommandBufferMockFlush : public MockClientCommandBuffer {
public:
MockClientCommandBufferMockFlush();
virtual ~MockClientCommandBufferMockFlush();
~MockClientCommandBufferMockFlush() override;

MOCK_METHOD1(Flush, void(int32_t put_offset));
MOCK_METHOD1(OrderingBarrier, void(int32_t put_offset));
Expand All @@ -99,7 +99,7 @@ class MockClientCommandBufferMockFlush : public MockClientCommandBuffer {
class MockClientGpuControl : public GpuControl {
public:
MockClientGpuControl();
virtual ~MockClientGpuControl();
~MockClientGpuControl() override;

MOCK_METHOD1(SetGpuControlClient, void(GpuControlClient*));
MOCK_CONST_METHOD0(GetCapabilities, const Capabilities&());
Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/client/cmd_buffer_helper_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const int32_t kUnusedCommandId = 5; // we use 0 and 2 currently.
// interface (calling it directly, not through the RPC mechanism).
class CommandBufferHelperTest : public testing::Test {
protected:
virtual void SetUp() {
void SetUp() override {
transfer_buffer_manager_ = std::make_unique<TransferBufferManager>(nullptr);
command_buffer_.reset(
new CommandBufferDirectLocked(transfer_buffer_manager_.get()));
Expand All @@ -59,7 +59,7 @@ class CommandBufferHelperTest : public testing::Test {
test_command_next_id_ = kUnusedCommandId;
}

virtual void TearDown() {
void TearDown() override {
// If the CommandExecutor posts any tasks, this forces them to run.
base::RunLoop().RunUntilIdle();
test_command_args_.clear();
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/client/transfer_buffer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ TEST_F(TransferBufferTest, Flush) {
class MockClientCommandBufferCanFail : public MockClientCommandBufferMockFlush {
public:
MockClientCommandBufferCanFail() = default;
virtual ~MockClientCommandBufferCanFail() = default;
~MockClientCommandBufferCanFail() override = default;

MOCK_METHOD2(CreateTransferBuffer,
scoped_refptr<Buffer>(size_t size, int32_t* id));
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/error_state_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace gles2 {
class MockErrorState : public ErrorState {
public:
MockErrorState();
virtual ~MockErrorState();
~MockErrorState() override;

MOCK_METHOD0(GetGLError, uint32_t());
MOCK_METHOD5(SetGLError, void(
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/gl_context_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GLContextMock : public gl::GLContextStub {
MOCK_METHOD1(MakeCurrent, bool(gl::GLSurface* surface));

protected:
virtual ~GLContextMock();
~GLContextMock() override;
};

} // namespace gpu
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/gl_surface_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GLSurfaceMock : public gl::GLSurface {
MOCK_METHOD0(GetFormat, gl::GLSurfaceFormat());

protected:
virtual ~GLSurfaceMock();
~GLSurfaceMock() override;

private:
DISALLOW_COPY_AND_ASSIGN(GLSurfaceMock);
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/gles2_cmd_decoder_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MockGLES2Decoder : public GLES2Decoder {
public:
MockGLES2Decoder(CommandBufferServiceBase* command_buffer_service,
Outputter* outputter);
virtual ~MockGLES2Decoder();
~MockGLES2Decoder() override;

base::WeakPtr<DecoderContext> AsWeakPtr() override;

Expand Down
5 changes: 2 additions & 3 deletions gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,7 @@ class SizeOnlyMemoryTracker : public MemoryTracker {
// Ensure a certain amount of GPU memory is free. Returns true on success.
MOCK_METHOD1(EnsureGPUMemoryAvailable, bool(size_t size_needed));

virtual void TrackMemoryAllocatedChange(size_t old_size,
size_t new_size) {
void TrackMemoryAllocatedChange(size_t old_size, size_t new_size) override {
pool_info_.size += new_size - old_size;
}

Expand All @@ -1100,7 +1099,7 @@ class SizeOnlyMemoryTracker : public MemoryTracker {
uint64_t ShareGroupTracingGUID() const override { return 0; }

private:
virtual ~SizeOnlyMemoryTracker() = default;
~SizeOnlyMemoryTracker() override = default;
struct PoolInfo {
PoolInfo() : initial_size(0), size(0) {}
size_t initial_size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,7 @@ class MockGLImage : public gl::GLImage {
const std::string&));

protected:
virtual ~MockGLImage() = default;
~MockGLImage() override = default;
};

TEST_P(GLES2DecoderWithShaderTest, CopyTexImage) {
Expand Down
6 changes: 3 additions & 3 deletions gpu/command_buffer/service/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AsyncAPIMock : public AsyncAPIInterface {
public:
explicit AsyncAPIMock(bool default_do_commands,
CommandBufferServiceBase* command_buffer_service);
virtual ~AsyncAPIMock();
~AsyncAPIMock() override;

error::Error FakeDoCommands(unsigned int num_commands,
const volatile void* buffer,
Expand Down Expand Up @@ -119,7 +119,7 @@ class MockShaderTranslator : public ShaderTranslatorInterface {
class MockProgramCache : public ProgramCache {
public:
MockProgramCache();
virtual ~MockProgramCache();
~MockProgramCache() override;

MOCK_METHOD7(LoadLinkedProgram,
ProgramLoadResult(
Expand Down Expand Up @@ -160,7 +160,7 @@ class MockMemoryTracker : public MemoryTracker {
private:
friend class ::testing::StrictMock<MockMemoryTracker>;
friend class base::RefCounted< ::testing::StrictMock<MockMemoryTracker> >;
virtual ~MockMemoryTracker();
~MockMemoryTracker() override;
};

} // namespace gles2
Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/raster_decoder_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MockMemoryTracker : public gles2::MemoryTracker {
uint64_t ShareGroupTracingGUID() const override { return 0; }

private:
virtual ~MockMemoryTracker() = default;
~MockMemoryTracker() override = default;
};

} // namespace
Expand Down

0 comments on commit c50b3f0

Please sign in to comment.