Skip to content

Commit

Permalink
Update virtual/final usage in tools/gn/.
Browse files Browse the repository at this point in the history
Also some #include fixes (from OVERRIDE -> override conversion).

BUG=417463
TBR=brettw@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#300635}
  • Loading branch information
viettrungluu-cr committed Oct 22, 2014
1 parent ed17d81 commit 50df3ed
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 127 deletions.
4 changes: 2 additions & 2 deletions tools/gn/action_target_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_GN_ACTION_TARGET_GENERATOR_H_
#define TOOLS_GN_ACTION_TARGET_GENERATOR_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/target_generator.h"

// Populates a Target with the values from an action[_foreach] rule.
Expand All @@ -19,7 +19,7 @@ class ActionTargetGenerator : public TargetGenerator {
virtual ~ActionTargetGenerator();

protected:
virtual void DoRun() override;
void DoRun() override;

private:
bool FillScript();
Expand Down
4 changes: 2 additions & 2 deletions tools/gn/binary_target_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_GN_BINARY_TARGET_GENERATOR_H_
#define TOOLS_GN_BINARY_TARGET_GENERATOR_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/target_generator.h"

// Populates a Target with the values from a binary rule (executable, shared
Expand All @@ -20,7 +20,7 @@ class BinaryTargetGenerator : public TargetGenerator {
virtual ~BinaryTargetGenerator();

protected:
virtual void DoRun() override;
void DoRun() override;

private:
bool FillCheckIncludes();
Expand Down
18 changes: 7 additions & 11 deletions tools/gn/builder_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ class MockLoader : public Loader {
}

// Loader implementation:
virtual void Load(const SourceFile& file,
const LocationRange& origin,
const Label& toolchain_name) override {
void Load(const SourceFile& file,
const LocationRange& origin,
const Label& toolchain_name) override {
files_.push_back(file);
}
virtual void ToolchainLoaded(const Toolchain* toolchain) override {
}
virtual Label GetDefaultToolchain() const override {
return Label();
}
virtual const Settings* GetToolchainSettings(
const Label& label) const override {
void ToolchainLoaded(const Toolchain* toolchain) override {}
Label GetDefaultToolchain() const override { return Label(); }
const Settings* GetToolchainSettings(const Label& label) const override {
return NULL;
}

Expand All @@ -52,7 +48,7 @@ class MockLoader : public Loader {
}

private:
virtual ~MockLoader() {}
~MockLoader() override {}

std::vector<SourceFile> files_;
};
Expand Down
8 changes: 4 additions & 4 deletions tools/gn/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
#ifndef TOOLS_GN_CONFIG_H_
#define TOOLS_GN_CONFIG_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/config_values.h"
#include "tools/gn/item.h"

// Represents a named config in the dependency graph.
class Config : public Item {
public:
Config(const Settings* settings, const Label& label);
virtual ~Config();
~Config() override;

virtual Config* AsConfig() override;
virtual const Config* AsConfig() const override;
Config* AsConfig() override;
const Config* AsConfig() const override;

ConfigValues& config_values() { return config_values_; }
const ConfigValues& config_values() const { return config_values_; }
Expand Down
4 changes: 2 additions & 2 deletions tools/gn/copy_target_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_GN_COPY_TARGET_GENERATOR_H_
#define TOOLS_GN_COPY_TARGET_GENERATOR_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/target_generator.h"

// Populates a Target with the values from a copy rule.
Expand All @@ -18,7 +18,7 @@ class CopyTargetGenerator : public TargetGenerator {
virtual ~CopyTargetGenerator();

protected:
virtual void DoRun() override;
void DoRun() override;

private:
void FillDestDir();
Expand Down
4 changes: 2 additions & 2 deletions tools/gn/group_target_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_GN_GROUP_TARGET_GENERATOR_H_
#define TOOLS_GN_GROUP_TARGET_GENERATOR_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/target_generator.h"

// Populates a Target with the values for a group rule.
Expand All @@ -18,7 +18,7 @@ class GroupTargetGenerator : public TargetGenerator {
virtual ~GroupTargetGenerator();

protected:
virtual void DoRun() override;
void DoRun() override;

private:
DISALLOW_COPY_AND_ASSIGN(GroupTargetGenerator);
Expand Down
15 changes: 7 additions & 8 deletions tools/gn/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,12 @@ class LoaderImpl : public Loader {
LoaderImpl(const BuildSettings* build_settings);

// Loader implementation.
virtual void Load(const SourceFile& file,
const LocationRange& origin,
const Label& toolchain_name) override;
virtual void ToolchainLoaded(const Toolchain* toolchain) override;
virtual Label GetDefaultToolchain() const override;
virtual const Settings* GetToolchainSettings(
const Label& label) const override;
void Load(const SourceFile& file,
const LocationRange& origin,
const Label& toolchain_name) override;
void ToolchainLoaded(const Toolchain* toolchain) override;
Label GetDefaultToolchain() const override;
const Settings* GetToolchainSettings(const Label& label) const override;

// Sets the message loop corresponding to the main thread. By default this
// class will use the thread active during construction, but there is not
Expand All @@ -115,7 +114,7 @@ class LoaderImpl : public Loader {
struct LoadID;
struct ToolchainRecord;

virtual ~LoaderImpl();
~LoaderImpl() override;

// Schedules the input file manager to load the given file.
void ScheduleLoadFile(const Settings* settings,
Expand Down
6 changes: 3 additions & 3 deletions tools/gn/ninja_action_target_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <vector>

#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "tools/gn/ninja_target_writer.h"

class OutputFile;
Expand All @@ -17,9 +17,9 @@ class OutputFile;
class NinjaActionTargetWriter : public NinjaTargetWriter {
public:
NinjaActionTargetWriter(const Target* target, std::ostream& out);
virtual ~NinjaActionTargetWriter();
~NinjaActionTargetWriter() override;

virtual void Run() override;
void Run() override;

private:
FRIEND_TEST_ALL_PREFIXES(NinjaActionTargetWriter,
Expand Down
6 changes: 3 additions & 3 deletions tools/gn/ninja_binary_target_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_
#define TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/config_values.h"
#include "tools/gn/ninja_target_writer.h"
#include "tools/gn/toolchain.h"
Expand All @@ -18,9 +18,9 @@ struct EscapeOptions;
class NinjaBinaryTargetWriter : public NinjaTargetWriter {
public:
NinjaBinaryTargetWriter(const Target* target, std::ostream& out);
virtual ~NinjaBinaryTargetWriter();
~NinjaBinaryTargetWriter() override;

virtual void Run() override;
void Run() override;

private:
typedef std::set<OutputFile> OutputFileSet;
Expand Down
6 changes: 3 additions & 3 deletions tools/gn/ninja_copy_target_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_GN_NINJA_COPY_TARGET_WRITER_H_
#define TOOLS_GN_NINJA_COPY_TARGET_WRITER_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/ninja_target_writer.h"

class Tool;
Expand All @@ -14,9 +14,9 @@ class Tool;
class NinjaCopyTargetWriter : public NinjaTargetWriter {
public:
NinjaCopyTargetWriter(const Target* target, std::ostream& out);
virtual ~NinjaCopyTargetWriter();
~NinjaCopyTargetWriter() override;

virtual void Run() override;
void Run() override;

private:
// Writes the rules top copy the file(s), putting the computed output file
Expand Down
6 changes: 3 additions & 3 deletions tools/gn/ninja_group_target_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#ifndef TOOLS_GN_NINJA_GROUP_TARGET_WRITER_H_
#define TOOLS_GN_NINJA_GROUP_TARGET_WRITER_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "tools/gn/ninja_target_writer.h"

// Writes a .ninja file for a group target type.
class NinjaGroupTargetWriter : public NinjaTargetWriter {
public:
NinjaGroupTargetWriter(const Target* target, std::ostream& out);
virtual ~NinjaGroupTargetWriter();
~NinjaGroupTargetWriter() override;

virtual void Run() override;
void Run() override;

private:
DISALLOW_COPY_AND_ASSIGN(NinjaGroupTargetWriter);
Expand Down
2 changes: 1 addition & 1 deletion tools/gn/ninja_target_writer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestingNinjaTargetWriter : public NinjaTargetWriter {
: NinjaTargetWriter(target, out) {
}

virtual void Run() override {}
void Run() override {}

// Make this public so the test can call it.
OutputFile WriteInputDepsStampAndGetDep(
Expand Down
Loading

0 comments on commit 50df3ed

Please sign in to comment.