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>
diff --git a/metrics/metrics_library.h b/metrics/metrics_library.h
index 9e4be89..97b2b72 100644
--- a/metrics/metrics_library.h
+++ b/metrics/metrics_library.h
@@ -34,7 +34,7 @@
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 @@
// 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 @@
// 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.
diff --git a/metrics/persistent_integer_test.cc b/metrics/persistent_integer_test.cc
index 7d9e21c..097ec7d 100644
--- a/metrics/persistent_integer_test.cc
+++ b/metrics/persistent_integer_test.cc
@@ -16,12 +16,12 @@
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,
diff --git a/metrics/uploader/curl_sender.h b/metrics/uploader/curl_sender.h
index 0113601..fc5b0f4 100644
--- a/metrics/uploader/curl_sender.h
+++ b/metrics/uploader/curl_sender.h
@@ -17,8 +17,7 @@
// 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.
//
diff --git a/metrics/uploader/mock/mock_system_profile_setter.h b/metrics/uploader/mock/mock_system_profile_setter.h
index 0614eb9..c6e8f0d 100644
--- a/metrics/uploader/mock/mock_system_profile_setter.h
+++ b/metrics/uploader/mock/mock_system_profile_setter.h
@@ -14,7 +14,7 @@
// 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_
diff --git a/metrics/uploader/mock/sender_mock.h b/metrics/uploader/mock/sender_mock.h
index f6f19b9..4845f9d 100644
--- a/metrics/uploader/mock/sender_mock.h
+++ b/metrics/uploader/mock/sender_mock.h
@@ -15,7 +15,7 @@
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_; }
diff --git a/metrics/uploader/system_profile_cache.h b/metrics/uploader/system_profile_cache.h
index 2839179..03e92fc 100644
--- a/metrics/uploader/system_profile_cache.h
+++ b/metrics/uploader/system_profile_cache.h
@@ -39,7 +39,7 @@
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
diff --git a/metrics/uploader/upload_service.h b/metrics/uploader/upload_service.h
index 7c17488..ed5ab85 100644
--- a/metrics/uploader/upload_service.h
+++ b/metrics/uploader/upload_service.h
@@ -74,10 +74,10 @@
// 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 @@
// 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.