metrics: Replace 'OVERRIDE' with 'override' and fix linter

Replace OVERRIDE macro with native C++ 'override' keyword.
Also fixed the style issue of using both 'override' and 'virtual'
on member function overrides. Only one is required and cpplint
complains if both are specified now.

And since gobi-chromo-plugin is the only project that uses
libmetrics and is not C++11 yet, enabled C++11 features
in its makefile to allow for the 'override' keywords to
compile in the included metrics/metrics_library.h header.

BUG=None
TEST=USE="cellular buffet" ./build_packages

Change-Id: I28dace6dc4bcb07386632eaed890ce41564e8144
Reviewed-on: https://chromium-review.googlesource.com/212494
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
This commit is contained in:
Alex Vakulenko 2014-08-14 12:56:21 -07:00 committed by chrome-internal-fetch
parent f05ab40ab9
commit e8a8e30b25
7 changed files with 14 additions and 17 deletions

View File

@ -34,7 +34,7 @@ class MetricsLibrary : public MetricsLibraryInterface {
virtual ~MetricsLibrary();
// Initializes the library.
virtual void Init() OVERRIDE;
void Init() override;
// Returns whether or not the machine is running in guest mode.
bool IsGuestMode();
@ -76,15 +76,13 @@ class MetricsLibrary : public MetricsLibraryInterface {
// histogram is proportional to the number of buckets. Therefore, it
// is strongly recommended to keep this number low (e.g., 50 is
// normal, while 100 is high).
virtual bool SendEnumToUMA(const std::string& name,
int sample,
int max) OVERRIDE;
bool SendEnumToUMA(const std::string& name, int sample, int max) override;
// Sends sparse histogram sample to Chrome for transport to UMA. Returns
// true on success.
//
// |sample| is the 32-bit integer value to be recorded.
virtual bool SendSparseToUMA(const std::string& name, int sample) OVERRIDE;
bool SendSparseToUMA(const std::string& name, int sample) override;
// Sends a user action to Chrome for transport to UMA and returns true on
// success. This method results in the equivalent of an asynchronous
@ -96,7 +94,7 @@ class MetricsLibrary : public MetricsLibraryInterface {
// chrome/browser/chromeos/external_metrics.cc.
//
// |action| is the user-generated event (e.g., "MuteKeyPressed").
virtual bool SendUserActionToUMA(const std::string& action) OVERRIDE;
bool SendUserActionToUMA(const std::string& action) override;
// Sends a signal to UMA that a crash of the given |crash_kind|
// has occurred. Used by UMA to generate stability statistics.

View File

@ -16,12 +16,12 @@ const char kBackingFilePattern[] = "*.pibakf";
using chromeos_metrics::PersistentInteger;
class PersistentIntegerTest : public testing::Test {
virtual void SetUp() OVERRIDE {
void SetUp() override {
// Set testing mode.
chromeos_metrics::PersistentInteger::SetTestingMode(true);
}
virtual void TearDown() OVERRIDE {
void TearDown() override {
// Remove backing files. The convention is that they all end in ".pibakf".
base::FileEnumerator f_enum(base::FilePath("."),
false,

View File

@ -17,8 +17,7 @@ class CurlSender : public Sender {
// Sends |content| whose SHA1 hash is |hash| to server_url with a synchronous
// POST request to server_url.
virtual bool Send(const std::string& content,
const std::string& hash) OVERRIDE;
bool Send(const std::string& content, const std::string& hash) override;
// Static callback required by curl to retrieve the response data.
//

View File

@ -14,7 +14,7 @@ class ChromeUserMetricsExtension;
// Mock profile setter used for testing.
class MockSystemProfileSetter : public SystemProfileSetter {
public:
void Populate(metrics::ChromeUserMetricsExtension* profile_proto) OVERRIDE {}
void Populate(metrics::ChromeUserMetricsExtension* profile_proto) override {}
};
#endif // METRICS_UPLOADER_MOCK_MOCK_SYSTEM_PROFILE_SETTER_H_

View File

@ -15,7 +15,7 @@ class SenderMock : public Sender {
public:
SenderMock();
bool Send(const std::string& content, const std::string& hash) OVERRIDE;
bool Send(const std::string& content, const std::string& hash) override;
void Reset();
bool is_good_proto() { return is_good_proto_; }

View File

@ -39,7 +39,7 @@ class SystemProfileCache : public SystemProfileSetter {
SystemProfileCache();
// Populates the ProfileSystem protobuf with system information.
void Populate(metrics::ChromeUserMetricsExtension* profile_proto) OVERRIDE;
void Populate(metrics::ChromeUserMetricsExtension* profile_proto) override;
// Converts a string representation of the channel (|channel|-channel) to a
// SystemProfileProto_Channel

View File

@ -74,10 +74,10 @@ class UploadService : public base::HistogramFlattener {
// Implements inconsistency detection to match HistogramFlattener's
// interface.
void InconsistencyDetected(
base::HistogramBase::Inconsistency problem) OVERRIDE {}
base::HistogramBase::Inconsistency problem) override {}
void UniqueInconsistencyDetected(
base::HistogramBase::Inconsistency problem) OVERRIDE {}
void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE {}
base::HistogramBase::Inconsistency problem) override {}
void InconsistencyDetectedInLoggedCount(int amount) override {}
private:
friend class UploadServiceTest;
@ -117,7 +117,7 @@ class UploadService : public base::HistogramFlattener {
// Callback for HistogramSnapshotManager to store the histograms.
void RecordDelta(const base::HistogramBase& histogram,
const base::HistogramSamples& snapshot) OVERRIDE;
const base::HistogramSamples& snapshot) override;
// Compiles all the samples received into a single protobuf and adds all
// system information.