update_engine: Cleanup of HardwareInterface - const/override
Made most of the members of HardwareInterface 'const' and
used C++11's override on implementations to guard against method
signature changes.
BUG=None
TEST=Ran all unit tests
Change-Id: I33eecb0e6a0fc662da75fbf8d9953f0bb09cb08d
Reviewed-on: https://chromium-review.googlesource.com/187483
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/hardware.h b/hardware.h
index cd7c8d5..02ed1ea 100644
--- a/hardware.h
+++ b/hardware.h
@@ -15,20 +15,20 @@
class Hardware : public HardwareInterface {
public:
Hardware();
- virtual ~Hardware();
+ virtual ~Hardware() override;
// HardwareInterface methods.
- virtual const std::string BootKernelDevice();
- virtual const std::string BootDevice();
- virtual std::vector<std::string> GetKernelDevices() override;
+ virtual std::string BootKernelDevice() const override;
+ virtual std::string BootDevice() const override;
+ virtual std::vector<std::string> GetKernelDevices() const override;
virtual bool IsKernelBootable(const std::string& kernel_device,
- bool* bootable);
- virtual bool MarkKernelUnbootable(const std::string& kernel_device);
- virtual bool IsOfficialBuild();
- virtual bool IsNormalBootMode();
- virtual std::string GetHardwareClass();
- virtual std::string GetFirmwareVersion();
- virtual std::string GetECVersion();
+ bool* bootable) const override;
+ virtual bool MarkKernelUnbootable(const std::string& kernel_device) override;
+ virtual bool IsOfficialBuild() const override;
+ virtual bool IsNormalBootMode() const override;
+ virtual std::string GetHardwareClass() const override;
+ virtual std::string GetFirmwareVersion() const override;
+ virtual std::string GetECVersion() const override;
private:
DISALLOW_COPY_AND_ASSIGN(Hardware);