Skip to content

Commit

Permalink
cc: Remove readability/inheritance exception for linter in cc.
Browse files Browse the repository at this point in the history
And make cc/ all linter clean.

R=enne
BUG=422353

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

Cr-Commit-Position: refs/heads/master@{#304136}
  • Loading branch information
danakj authored and Commit bot committed Nov 14, 2014
1 parent a1d7400 commit aeb9506
Show file tree
Hide file tree
Showing 44 changed files with 110 additions and 131 deletions.
4 changes: 0 additions & 4 deletions cc/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ def CheckChangeLintsClean(input_api, output_api):
input_api.AffectedSourceFiles(source_filter)]
level = 1 # strict, but just warn

# TODO(danakj): Temporary, while the OVERRIDE and FINAL fixup is in progress.
# crbug.com/422353
input_api.cpplint._SetFilters('-readability/inheritance')

for file_name in files:
input_api.cpplint.ProcessFile(file_name, level)

Expand Down
2 changes: 1 addition & 1 deletion cc/base/delayed_unique_notifier_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DelayedUniqueNotifierTest : public testing::Test {
public:
DelayedUniqueNotifierTest() : notification_count_(0) {}

virtual void SetUp() override {
void SetUp() override {
notification_count_ = 0;
task_runner_ = make_scoped_refptr(new base::TestSimpleTaskRunner);
}
Expand Down
2 changes: 1 addition & 1 deletion cc/base/unique_notifier_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UniqueNotifierTest : public testing::Test {
public:
UniqueNotifierTest() : notification_count_(0) {}

virtual void SetUp() override { ResetNotificationCount(); }
void SetUp() override { ResetNotificationCount(); }

void Notify() { ++notification_count_; }

Expand Down
6 changes: 3 additions & 3 deletions cc/blink/web_external_bitmap_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class WebExternalBitmapImpl : public blink::WebExternalBitmap {
virtual ~WebExternalBitmapImpl();

// blink::WebExternalBitmap implementation.
virtual blink::WebSize size() override;
virtual void setSize(blink::WebSize size) override;
virtual uint8* pixels() override;
blink::WebSize size() override;
void setSize(blink::WebSize size) override;
uint8* pixels() override;

base::SharedMemory* shared_memory() { return shared_memory_.get(); }

Expand Down
12 changes: 6 additions & 6 deletions cc/blink/web_layer_impl_fixed_bounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class WebLayerImplFixedBounds : public WebLayerImpl {
virtual ~WebLayerImplFixedBounds();

// WebLayerImpl overrides.
virtual void invalidateRect(const blink::WebRect& rect) override;
virtual void setTransformOrigin(
void invalidateRect(const blink::WebRect& rect) override;
void setTransformOrigin(
const blink::WebFloatPoint3D& transform_origin) override;
virtual void setBounds(const blink::WebSize& bounds) override;
virtual blink::WebSize bounds() const override;
virtual void setTransform(const SkMatrix44& transform) override;
virtual SkMatrix44 transform() const override;
void setBounds(const blink::WebSize& bounds) override;
blink::WebSize bounds() const override;
void setTransform(const SkMatrix44& transform) override;
SkMatrix44 transform() const override;

CC_BLINK_EXPORT void SetFixedBounds(gfx::Size bounds);

Expand Down
4 changes: 2 additions & 2 deletions cc/debug/micro_benchmark_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MicroBenchmarkControllerTest : public testing::Test {
MicroBenchmarkControllerTest()
: layer_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D) {}

virtual void SetUp() override {
void SetUp() override {
impl_proxy_ = make_scoped_ptr(new FakeImplProxy);
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
layer_tree_host_impl_ = make_scoped_ptr(new FakeLayerTreeHostImpl(
Expand All @@ -32,7 +32,7 @@ class MicroBenchmarkControllerTest : public testing::Test {
layer_tree_host_->InitializeForTesting(scoped_ptr<Proxy>(new FakeProxy));
}

virtual void TearDown() override {
void TearDown() override {
layer_tree_host_impl_ = nullptr;
layer_tree_host_ = nullptr;
impl_proxy_ = nullptr;
Expand Down
1 change: 1 addition & 0 deletions cc/debug/rendering_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define CC_DEBUG_RENDERING_STATS_H_

#include <list>
#include <vector>

#include "base/basictypes.h"
#include "base/debug/trace_event_argument.h"
Expand Down
4 changes: 1 addition & 3 deletions cc/debug/ring_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ namespace cc {
template<typename T, size_t kSize>
class RingBuffer {
public:
explicit RingBuffer()
: current_index_(0) {
}
RingBuffer() : current_index_(0) {}

size_t BufferSize() const {
return kSize;
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/delegated_frame_provider_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ class DelegatedFrameProviderTest
false);
}

virtual void SetUp() override {
void SetUp() override {
resource_collection_ = new DelegatedFrameResourceCollection;
resource_collection_->SetClient(this);
}

virtual void TearDown() override { resource_collection_->SetClient(nullptr); }
void TearDown() override { resource_collection_->SetClient(nullptr); }

void UnusedResourcesAreAvailable() override {
resources_available_ = true;
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/delegated_frame_resource_collection_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class DelegatedFrameResourceCollectionTest
protected:
DelegatedFrameResourceCollectionTest() : resources_available_(false) {}

virtual void SetUp() override { CreateResourceCollection(); }
void SetUp() override { CreateResourceCollection(); }

virtual void TearDown() override { DestroyResourceCollection(); }
void TearDown() override { DestroyResourceCollection(); }

void CreateResourceCollection() {
DCHECK(!resource_collection_.get());
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/layer_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class LayerPerfTest : public testing::Test {
kTimeCheckInterval) {}

protected:
virtual void SetUp() override {
void SetUp() override {
layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
layer_tree_host_->InitializeSingleThreaded(
&fake_client_, base::MessageLoopProxy::current(), nullptr);
}

virtual void TearDown() override {
void TearDown() override {
layer_tree_host_->SetRootLayer(nullptr);
layer_tree_host_ = nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ class LayerTest : public testing::Test {
fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {}

protected:
virtual void SetUp() override {
void SetUp() override {
layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_));
}

virtual void TearDown() override {
void TearDown() override {
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber());
parent_ = nullptr;
Expand Down
22 changes: 11 additions & 11 deletions cc/layers/layer_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
#include "cc/base/cc_export.h"

namespace gfx {
class BoxF;
class BoxF;
} // namespace gfx

namespace cc {
class LayerImpl;
class LayerImpl;

class CC_EXPORT LayerUtils {
public:
// Computes a box in screen space that should entirely contain the layer's
// bounds through the entirety of the layer's current animation. Returns
// true and sets |out| to the inflation if there are animations that can
// inflate bounds in the path to the root layer and that it was able to
// inflate correctly. Returns false otherwise.
static bool GetAnimationBounds(const LayerImpl& layer, gfx::BoxF* out);
};
class CC_EXPORT LayerUtils {
public:
// Computes a box in screen space that should entirely contain the layer's
// bounds through the entirety of the layer's current animation. Returns
// true and sets |out| to the inflation if there are animations that can
// inflate bounds in the path to the root layer and that it was able to
// inflate correctly. Returns false otherwise.
static bool GetAnimationBounds(const LayerImpl& layer, gfx::BoxF* out);
};

} // namespace cc

Expand Down
12 changes: 6 additions & 6 deletions cc/layers/layer_utils_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LayerUtilsGetAnimationBoundsTest : public testing::Test {
public:
LayerUtilsGetAnimationBoundsTest()
: host_impl_(&proxy_, &shared_bitmap_manager_),
root_(CreateThreeNodeTree(host_impl_)),
root_(CreateThreeNodeTree(&host_impl_)),
parent_(root_->children()[0]),
child_(parent_->children()[0]) {}

Expand All @@ -35,11 +35,11 @@ class LayerUtilsGetAnimationBoundsTest : public testing::Test {

private:
static scoped_ptr<LayerImpl> CreateThreeNodeTree(
LayerTreeHostImpl& host_impl) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
root->AddChild(LayerImpl::Create(host_impl.active_tree(), 2));
root->children()[0]
->AddChild(LayerImpl::Create(host_impl.active_tree(), 3));
LayerTreeHostImpl* host_impl) {
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl->active_tree(), 1);
root->AddChild(LayerImpl::Create(host_impl->active_tree(), 2));
root->children()[0]->AddChild(
LayerImpl::Create(host_impl->active_tree(), 3));
return root.Pass();
}

Expand Down
2 changes: 1 addition & 1 deletion cc/layers/picture_layer_impl_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PictureLayerImplPerfTest : public testing::Test {
base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
kTimeCheckInterval) {}

virtual void SetUp() override {
void SetUp() override {
host_impl_.InitializeRenderer(FakeOutputSurface::Create3d());
}

Expand Down
6 changes: 2 additions & 4 deletions cc/layers/picture_layer_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ class PictureLayerImplTest : public testing::Test {
virtual ~PictureLayerImplTest() {
}

virtual void SetUp() override {
InitializeRenderer();
}
void SetUp() override { InitializeRenderer(); }

virtual void InitializeRenderer() {
host_impl_.InitializeRenderer(FakeOutputSurface::Create3d());
Expand Down Expand Up @@ -2474,7 +2472,7 @@ class DeferredInitPictureLayerImplTest : public PictureLayerImplTest {
delegated_rendering));
}

virtual void SetUp() override {
void SetUp() override {
PictureLayerImplTest::SetUp();

// Create some default active and pending trees.
Expand Down
3 changes: 3 additions & 0 deletions cc/layers/surface_layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <set>
#include <vector>

#include "base/message_loop/message_loop_proxy.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/surface_layer.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/layers/tiled_layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TiledLayerTest : public testing::Test {
settings_.layer_transforms_should_scale_layer_contents = true;
}

virtual void SetUp() {
void SetUp() override {
impl_thread_.Start();
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
layer_tree_host_ = SynchronousOutputSurfaceLayerTreeHost::Create(
Expand Down
40 changes: 11 additions & 29 deletions cc/output/geometry_binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ GeometryBinding::GeometryBinding(gpu::gles2::GLES2Interface* gl,
uint16 data[6];
};

COMPILE_ASSERT(sizeof(Quad) == 24 * sizeof(float), // NOLINT(runtime/sizeof)
COMPILE_ASSERT(sizeof(Quad) == 24 * sizeof(float), struct_is_densely_packed);
COMPILE_ASSERT(sizeof(QuadIndex) == 6 * sizeof(uint16_t),
struct_is_densely_packed);
COMPILE_ASSERT(
sizeof(QuadIndex) == 6 * sizeof(uint16_t), // NOLINT(runtime/sizeof)
struct_is_densely_packed);

Quad quad_list[8];
QuadIndex quad_index_list[8];
Expand Down Expand Up @@ -79,33 +77,17 @@ void GeometryBinding::PrepareForDraw() {
// "const GLvoid*" even though it is actually an offset into the buffer
// object's data store and not a pointer to the client's address space.
const void* offsets[3] = {
0, reinterpret_cast<const void*>(
3 * sizeof(float)), // NOLINT(runtime/sizeof)
reinterpret_cast<const void*>(5 *
sizeof(float)), // NOLINT(runtime/sizeof)
0,
reinterpret_cast<const void*>(3 * sizeof(float)),
reinterpret_cast<const void*>(5 * sizeof(float)),
};

GLC(gl_,
gl_->VertexAttribPointer(PositionAttribLocation(),
3,
GL_FLOAT,
false,
6 * sizeof(float), // NOLINT(runtime/sizeof)
offsets[0]));
GLC(gl_,
gl_->VertexAttribPointer(TexCoordAttribLocation(),
2,
GL_FLOAT,
false,
6 * sizeof(float), // NOLINT(runtime/sizeof)
offsets[1]));
GLC(gl_,
gl_->VertexAttribPointer(TriangleIndexAttribLocation(),
1,
GL_FLOAT,
false,
6 * sizeof(float), // NOLINT(runtime/sizeof)
offsets[2]));
GLC(gl_, gl_->VertexAttribPointer(PositionAttribLocation(), 3, GL_FLOAT,
false, 6 * sizeof(float), offsets[0]));
GLC(gl_, gl_->VertexAttribPointer(TexCoordAttribLocation(), 2, GL_FLOAT,
false, 6 * sizeof(float), offsets[1]));
GLC(gl_, gl_->VertexAttribPointer(TriangleIndexAttribLocation(), 1, GL_FLOAT,
false, 6 * sizeof(float), offsets[2]));
GLC(gl_, gl_->EnableVertexAttribArray(PositionAttribLocation()));
GLC(gl_, gl_->EnableVertexAttribArray(TexCoordAttribLocation()));
GLC(gl_, gl_->EnableVertexAttribArray(TriangleIndexAttribLocation()));
Expand Down
2 changes: 1 addition & 1 deletion cc/output/overlay_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ class OverlayInfoRendererGL : public GLRenderer {

using GLRenderer::BeginDrawingFrame;

virtual void FinishDrawingFrame(DrawingFrame* frame) override {
void FinishDrawingFrame(DrawingFrame* frame) override {
GLRenderer::FinishDrawingFrame(frame);

if (!expect_overlays_) {
Expand Down
2 changes: 1 addition & 1 deletion cc/output/renderer_pixeltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class VideoGLRendererPixelTest : public GLRendererPixelTest {
color_space);
}

virtual void SetUp() override {
void SetUp() override {
GLRendererPixelTest::SetUp();
video_resource_updater_.reset(new VideoResourceUpdater(
output_surface_->context_provider(), resource_provider_.get()));
Expand Down
7 changes: 3 additions & 4 deletions cc/quads/list_container_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ class SimpleDrawQuadConstructMagicNumberTwo : public SimpleDrawQuad {

class MockDrawQuad : public DrawQuad {
public:
virtual ~MockDrawQuad() { Destruct(); }
virtual void IterateResources(
const ResourceIteratorCallback& callback) override {}
virtual void ExtendValue(base::debug::TracedValue* value) const override {}
~MockDrawQuad() override { Destruct(); }
void IterateResources(const ResourceIteratorCallback& callback) override {}
void ExtendValue(base::debug::TracedValue* value) const override {}
MOCK_METHOD0(Destruct, void());
};

Expand Down
6 changes: 2 additions & 4 deletions cc/resources/picture_layer_tiling_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PictureLayerTilingPerfTest : public testing::Test {
1).Pass();
}

virtual void SetUp() override {
void SetUp() override {
picture_layer_tiling_client_.SetTileSize(gfx::Size(256, 256));
picture_layer_tiling_client_.set_max_tiles_for_interest_area(250);
picture_layer_tiling_client_.set_tree(PENDING_TREE);
Expand All @@ -52,9 +52,7 @@ class PictureLayerTilingPerfTest : public testing::Test {
picture_layer_tiling_->CreateAllTilesForTesting();
}

virtual void TearDown() override {
picture_layer_tiling_.reset(NULL);
}
void TearDown() override { picture_layer_tiling_.reset(NULL); }

void RunInvalidateTest(const std::string& test_name, const Region& region) {
timer_.Reset();
Expand Down
2 changes: 2 additions & 0 deletions cc/resources/picture_pile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#define CC_RESOURCES_PICTURE_PILE_H_

#include <bitset>
#include <utility>

#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "cc/base/tiling_data.h"
#include "cc/resources/recording_source.h"
Expand Down
4 changes: 2 additions & 2 deletions cc/resources/picture_pile_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PicturePileTestBase {

class PicturePileTest : public PicturePileTestBase, public testing::Test {
public:
virtual void SetUp() override { InitializeData(); }
void SetUp() override { InitializeData(); }
};

TEST_F(PicturePileTest, InvalidationOnTileBorderOutsideInterestRect) {
Expand Down Expand Up @@ -531,7 +531,7 @@ enum Corner {
class PicturePileResizeCornerTest : public PicturePileTestBase,
public testing::TestWithParam<Corner> {
protected:
virtual void SetUp() override { InitializeData(); }
void SetUp() override { InitializeData(); }

static gfx::Rect CornerSinglePixelRect(Corner corner, const gfx::Size& s) {
switch (corner) {
Expand Down
Loading

0 comments on commit aeb9506

Please sign in to comment.