diff options
author | dcheng <dcheng@chromium.org> | 2014-10-27 14:47:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-27 21:48:18 +0000 |
commit | 67be2b1f8dbb8fe664365ce33cd6ccf2832e0663 (patch) | |
tree | 463de616ca38e98329059fff1709f9f0b8aa5a80 /net/ocsp | |
parent | acfeaee6661ddd4cb0309a6faed1f4aeb8d24853 (diff) | |
download | chromium_src-67be2b1f8dbb8fe664365ce33cd6ccf2832e0663.zip chromium_src-67be2b1f8dbb8fe664365ce33cd6ccf2832e0663.tar.gz chromium_src-67be2b1f8dbb8fe664365ce33cd6ccf2832e0663.tar.bz2 |
Standardize usage of virtual/override/final specifiers.
The Google C++ style guide states:
Explicitly annotate overrides of virtual functions or virtual
destructors with an override or (less frequently) final specifier.
Older (pre-C++11) code will use the virtual keyword as an inferior
alternative annotation. For clarity, use exactly one of override,
final, or virtual when declaring an override.
To better conform to these guidelines, the following constructs have
been rewritten:
- if a base class has a virtual destructor, then:
virtual ~Foo(); -> ~Foo() override;
- virtual void Foo() override; -> void Foo() override;
- virtual void Foo() override final; -> void Foo() final;
This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.
BUG=417463
R=pauljensen@chromium.org
Review URL: https://codereview.chromium.org/663043004
Cr-Commit-Position: refs/heads/master@{#301452}
Diffstat (limited to 'net/ocsp')
-rw-r--r-- | net/ocsp/nss_ocsp.cc | 13 | ||||
-rw-r--r-- | net/ocsp/nss_ocsp_unittest.cc | 10 |
2 files changed, 11 insertions, 12 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index 02eb2c7..61c65ee 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -283,9 +283,9 @@ class OCSPRequestSession return data_; } - virtual void OnReceivedRedirect(URLRequest* request, - const RedirectInfo& redirect_info, - bool* defer_redirect) override { + void OnReceivedRedirect(URLRequest* request, + const RedirectInfo& redirect_info, + bool* defer_redirect) override { DCHECK_EQ(request_.get(), request); DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); @@ -296,7 +296,7 @@ class OCSPRequestSession } } - virtual void OnResponseStarted(URLRequest* request) override { + void OnResponseStarted(URLRequest* request) override { DCHECK_EQ(request_.get(), request); DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); @@ -310,8 +310,7 @@ class OCSPRequestSession OnReadCompleted(request_.get(), bytes_read); } - virtual void OnReadCompleted(URLRequest* request, - int bytes_read) override { + void OnReadCompleted(URLRequest* request, int bytes_read) override { DCHECK_EQ(request_.get(), request); DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); @@ -359,7 +358,7 @@ class OCSPRequestSession private: friend class base::RefCountedThreadSafe<OCSPRequestSession>; - virtual ~OCSPRequestSession() { + ~OCSPRequestSession() override { // When this destructor is called, there should be only one thread that has // a reference to this object, and so that thread doesn't need to lock // |lock_| here. diff --git a/net/ocsp/nss_ocsp_unittest.cc b/net/ocsp/nss_ocsp_unittest.cc index acbb785..745741e 100644 --- a/net/ocsp/nss_ocsp_unittest.cc +++ b/net/ocsp/nss_ocsp_unittest.cc @@ -44,10 +44,10 @@ class AiaResponseHandler : public net::URLRequestInterceptor { public: AiaResponseHandler(const std::string& headers, const std::string& cert_data) : headers_(headers), cert_data_(cert_data), request_count_(0) {} - virtual ~AiaResponseHandler() {} + ~AiaResponseHandler() override {} // net::URLRequestInterceptor implementation: - virtual net::URLRequestJob* MaybeInterceptRequest( + net::URLRequestJob* MaybeInterceptRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { ++const_cast<AiaResponseHandler*>(this)->request_count_; @@ -75,9 +75,9 @@ class NssHttpTest : public ::testing::Test { handler_(NULL), verify_proc_(new CertVerifyProcNSS), verifier_(new MultiThreadedCertVerifier(verify_proc_.get())) {} - virtual ~NssHttpTest() {} + ~NssHttpTest() override {} - virtual void SetUp() { + void SetUp() override { std::string file_contents; ASSERT_TRUE(base::ReadFileToString( GetTestCertsDirectory().AppendASCII("aia-intermediate.der"), @@ -97,7 +97,7 @@ class NssHttpTest : public ::testing::Test { EnsureNSSHttpIOInit(); } - virtual void TearDown() { + void TearDown() override { ShutdownNSSHttpIO(); if (handler_) |