Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8a8e30b authored by Alex Vakulenko's avatar Alex Vakulenko Committed by chrome-internal-fetch
Browse files

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: default avatarBen Chan <benchan@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: default avatarAlex Vakulenko <avakulenko@chromium.org>
parent f05ab40a
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -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.
+2 −2
Original line number Diff line number Diff line
@@ -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,
+1 −2
Original line number Diff line number Diff line
@@ -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.
  //
+1 −1
Original line number Diff line number Diff line
@@ -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_
+1 −1
Original line number Diff line number Diff line
@@ -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_; }
Loading