Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc

Issue 668663006: Standardize usage of virtual/override/final in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
index 058667fb3d57c9db47a2a6ee7694a37b821be835..57ec78a47bd383594730d1ae36bcb34a187ea432 100644
--- a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
@@ -19,7 +19,7 @@ class ErrorObserver : public ErrorHandler {
bool encountered_error() const { return encountered_error_; }
- virtual void OnConnectionError() override { encountered_error_ = true; }
+ void OnConnectionError() override { encountered_error_ = true; }
private:
bool encountered_error_;
@@ -27,20 +27,20 @@ class ErrorObserver : public ErrorHandler {
class MathCalculatorImpl : public InterfaceImpl<math::Calculator> {
public:
- virtual ~MathCalculatorImpl() {}
+ ~MathCalculatorImpl() override {}
MathCalculatorImpl() : total_(0.0), got_connection_(false) {}
- virtual void OnConnectionEstablished() override { got_connection_ = true; }
+ void OnConnectionEstablished() override { got_connection_ = true; }
- virtual void Clear() override { client()->Output(total_); }
+ void Clear() override { client()->Output(total_); }
- virtual void Add(double value) override {
+ void Add(double value) override {
total_ += value;
client()->Output(total_);
}
- virtual void Multiply(double value) override {
+ void Multiply(double value) override {
total_ *= value;
client()->Output(total_);
}
@@ -77,7 +77,7 @@ class MathCalculatorUIImpl : public math::CalculatorUI {
private:
// math::CalculatorUI implementation:
- virtual void Output(double value) override { output_ = value; }
+ void Output(double value) override { output_ = value; }
math::CalculatorPtr calculator_;
double output_;
@@ -99,9 +99,9 @@ class SelfDestructingMathCalculatorUIImpl : public math::CalculatorUI {
static int num_instances() { return num_instances_; }
private:
- virtual ~SelfDestructingMathCalculatorUIImpl() { --num_instances_; }
+ ~SelfDestructingMathCalculatorUIImpl() override { --num_instances_; }
- virtual void Output(double value) override {
+ void Output(double value) override {
if (--nesting_level_ > 0) {
// Add some more and wait for re-entrant call to Output!
calculator_->Add(1.0);
@@ -121,20 +121,20 @@ int SelfDestructingMathCalculatorUIImpl::num_instances_ = 0;
class ReentrantServiceImpl : public InterfaceImpl<sample::Service> {
public:
- virtual ~ReentrantServiceImpl() {}
+ ~ReentrantServiceImpl() override {}
ReentrantServiceImpl()
: got_connection_(false), call_depth_(0), max_call_depth_(0) {}
- virtual void OnConnectionEstablished() override { got_connection_ = true; }
+ void OnConnectionEstablished() override { got_connection_ = true; }
bool got_connection() const { return got_connection_; }
int max_call_depth() { return max_call_depth_; }
- virtual void Frobinate(sample::FooPtr foo,
- sample::Service::BazOptions baz,
- sample::PortPtr port) override {
+ void Frobinate(sample::FooPtr foo,
+ sample::Service::BazOptions baz,
+ sample::PortPtr port) override {
max_call_depth_ = std::max(++call_depth_, max_call_depth_);
if (call_depth_ == 1) {
EXPECT_TRUE(WaitForIncomingMethodCall());
@@ -142,7 +142,7 @@ class ReentrantServiceImpl : public InterfaceImpl<sample::Service> {
call_depth_--;
}
- virtual void GetPort(mojo::InterfaceRequest<sample::Port> port) override {}
+ void GetPort(mojo::InterfaceRequest<sample::Port> port) override {}
private:
bool got_connection_;
« no previous file with comments | « mojo/public/cpp/bindings/tests/handle_passing_unittest.cc ('k') | mojo/public/cpp/bindings/tests/request_response_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698