Commit e6c6db7d authored by dcheng's avatar dcheng Committed by Commit bot

Update {virtual,override,final} to follow C++11 style in net.

The Google style guide states that only one of {virtual,override,final}
should be used for each declaration, since override implies virtual and
final implies both virtual and override.

This patch was automatically generated with an OS=android build using a
variation of https://codereview.chromium.org/598073004.

BUG=417463

Review URL: https://codereview.chromium.org/897423002

Cr-Commit-Position: refs/heads/master@{#314964}
parent c0107ee5
...@@ -77,20 +77,16 @@ class NetworkChangeNotifierAndroid::DnsConfigServiceThread ...@@ -77,20 +77,16 @@ class NetworkChangeNotifierAndroid::DnsConfigServiceThread
// We're only interested in tunnel interface changes. // We're only interested in tunnel interface changes.
base::Bind(NotifyNetworkChangeNotifierObservers)) {} base::Bind(NotifyNetworkChangeNotifierObservers)) {}
virtual ~DnsConfigServiceThread() { ~DnsConfigServiceThread() override { Stop(); }
Stop();
}
virtual void Init() override { void Init() override {
address_tracker_.Init(); address_tracker_.Init();
dns_config_service_ = DnsConfigService::CreateSystemService(); dns_config_service_ = DnsConfigService::CreateSystemService();
dns_config_service_->WatchConfig( dns_config_service_->WatchConfig(
base::Bind(&NetworkChangeNotifier::SetDnsConfig)); base::Bind(&NetworkChangeNotifier::SetDnsConfig));
} }
virtual void CleanUp() override { void CleanUp() override { dns_config_service_.reset(); }
dns_config_service_.reset();
}
static void NotifyNetworkChangeNotifierObservers() { static void NotifyNetworkChangeNotifierObservers() {
NetworkChangeNotifier::NotifyObserversOfIPAddressChange(); NetworkChangeNotifier::NotifyObserversOfIPAddressChange();
......
...@@ -42,17 +42,17 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid ...@@ -42,17 +42,17 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid
: public NetworkChangeNotifier, : public NetworkChangeNotifier,
public NetworkChangeNotifierDelegateAndroid::Observer { public NetworkChangeNotifierDelegateAndroid::Observer {
public: public:
virtual ~NetworkChangeNotifierAndroid(); ~NetworkChangeNotifierAndroid() override;
// NetworkChangeNotifier: // NetworkChangeNotifier:
virtual ConnectionType GetCurrentConnectionType() const override; ConnectionType GetCurrentConnectionType() const override;
// Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link // Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link
// speed. // speed.
virtual double GetCurrentMaxBandwidth() const override; double GetCurrentMaxBandwidth() const override;
// NetworkChangeNotifierDelegateAndroid::Observer: // NetworkChangeNotifierDelegateAndroid::Observer:
virtual void OnConnectionTypeChanged() override; void OnConnectionTypeChanged() override;
virtual void OnMaxBandwidthChanged(double max_bandwidth_mbps) override; void OnMaxBandwidthChanged(double max_bandwidth_mbps) override;
static bool Register(JNIEnv* env); static bool Register(JNIEnv* env);
......
...@@ -25,11 +25,9 @@ class NetworkChangeNotifierDelegateAndroidObserver ...@@ -25,11 +25,9 @@ class NetworkChangeNotifierDelegateAndroidObserver
: type_notifications_count_(0), max_bandwidth_notifications_count_(0) {} : type_notifications_count_(0), max_bandwidth_notifications_count_(0) {}
// NetworkChangeNotifierDelegateAndroid::Observer: // NetworkChangeNotifierDelegateAndroid::Observer:
virtual void OnConnectionTypeChanged() override { void OnConnectionTypeChanged() override { type_notifications_count_++; }
type_notifications_count_++;
}
virtual void OnMaxBandwidthChanged(double max_bandwidth_mbps) override { void OnMaxBandwidthChanged(double max_bandwidth_mbps) override {
max_bandwidth_notifications_count_++; max_bandwidth_notifications_count_++;
} }
...@@ -49,7 +47,7 @@ class NetworkChangeNotifierObserver ...@@ -49,7 +47,7 @@ class NetworkChangeNotifierObserver
NetworkChangeNotifierObserver() : notifications_count_(0) {} NetworkChangeNotifierObserver() : notifications_count_(0) {}
// NetworkChangeNotifier::Observer: // NetworkChangeNotifier::Observer:
virtual void OnConnectionTypeChanged( void OnConnectionTypeChanged(
NetworkChangeNotifier::ConnectionType connection_type) override { NetworkChangeNotifier::ConnectionType connection_type) override {
notifications_count_++; notifications_count_++;
} }
...@@ -68,7 +66,7 @@ class BaseNetworkChangeNotifierAndroidTest : public testing::Test { ...@@ -68,7 +66,7 @@ class BaseNetworkChangeNotifierAndroidTest : public testing::Test {
protected: protected:
typedef NetworkChangeNotifier::ConnectionType ConnectionType; typedef NetworkChangeNotifier::ConnectionType ConnectionType;
virtual ~BaseNetworkChangeNotifierAndroidTest() {} ~BaseNetworkChangeNotifierAndroidTest() override {}
void RunTest( void RunTest(
const base::Callback<int(void)>& notifications_count_getter, const base::Callback<int(void)>& notifications_count_getter,
...@@ -148,7 +146,7 @@ class NetworkChangeNotifierDelegateAndroidTest ...@@ -148,7 +146,7 @@ class NetworkChangeNotifierDelegateAndroidTest
delegate_.AddObserver(&other_delegate_observer_); delegate_.AddObserver(&other_delegate_observer_);
} }
virtual ~NetworkChangeNotifierDelegateAndroidTest() { ~NetworkChangeNotifierDelegateAndroidTest() override {
delegate_.RemoveObserver(&delegate_observer_); delegate_.RemoveObserver(&delegate_observer_);
delegate_.RemoveObserver(&other_delegate_observer_); delegate_.RemoveObserver(&other_delegate_observer_);
} }
......
...@@ -26,10 +26,10 @@ class NET_EXPORT NetworkChangeNotifierFactoryAndroid : ...@@ -26,10 +26,10 @@ class NET_EXPORT NetworkChangeNotifierFactoryAndroid :
NetworkChangeNotifierFactoryAndroid(); NetworkChangeNotifierFactoryAndroid();
// Must be called on the JNI thread. // Must be called on the JNI thread.
virtual ~NetworkChangeNotifierFactoryAndroid(); ~NetworkChangeNotifierFactoryAndroid() override;
// NetworkChangeNotifierFactory: // NetworkChangeNotifierFactory:
virtual NetworkChangeNotifier* CreateInstance() override; NetworkChangeNotifier* CreateInstance() override;
private: private:
// Delegate passed to the instances created by this class. // Delegate passed to the instances created by this class.
......
...@@ -15,18 +15,18 @@ class CertVerifyProcAndroid : public CertVerifyProc { ...@@ -15,18 +15,18 @@ class CertVerifyProcAndroid : public CertVerifyProc {
public: public:
CertVerifyProcAndroid(); CertVerifyProcAndroid();
virtual bool SupportsAdditionalTrustAnchors() const override; bool SupportsAdditionalTrustAnchors() const override;
protected: protected:
virtual ~CertVerifyProcAndroid(); ~CertVerifyProcAndroid() override;
private: private:
virtual int VerifyInternal(X509Certificate* cert, int VerifyInternal(X509Certificate* cert,
const std::string& hostname, const std::string& hostname,
int flags, int flags,
CRLSet* crl_set, CRLSet* crl_set,
const CertificateList& additional_trust_anchors, const CertificateList& additional_trust_anchors,
CertVerifyResult* verify_result) override; CertVerifyResult* verify_result) override;
}; };
} // namespace net } // namespace net
......
...@@ -64,7 +64,7 @@ class DnsConfigWatcher : public NetworkChangeNotifier::NetworkChangeObserver { ...@@ -64,7 +64,7 @@ class DnsConfigWatcher : public NetworkChangeNotifier::NetworkChangeObserver {
NetworkChangeNotifier::AddNetworkChangeObserver(this); NetworkChangeNotifier::AddNetworkChangeObserver(this);
} }
virtual ~DnsConfigWatcher() { ~DnsConfigWatcher() override {
NetworkChangeNotifier::RemoveNetworkChangeObserver(this); NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
} }
...@@ -73,8 +73,7 @@ class DnsConfigWatcher : public NetworkChangeNotifier::NetworkChangeObserver { ...@@ -73,8 +73,7 @@ class DnsConfigWatcher : public NetworkChangeNotifier::NetworkChangeObserver {
return true; return true;
} }
virtual void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override {
override {
if (!callback_.is_null() && type != NetworkChangeNotifier::CONNECTION_NONE) if (!callback_.is_null() && type != NetworkChangeNotifier::CONNECTION_NONE)
callback_.Run(true); callback_.Run(true);
} }
......
...@@ -302,12 +302,12 @@ class ProxyConfigServiceAndroid::Delegate ...@@ -302,12 +302,12 @@ class ProxyConfigServiceAndroid::Delegate
explicit JNIDelegateImpl(Delegate* delegate) : delegate_(delegate) {} explicit JNIDelegateImpl(Delegate* delegate) : delegate_(delegate) {}
// ProxyConfigServiceAndroid::JNIDelegate overrides. // ProxyConfigServiceAndroid::JNIDelegate overrides.
virtual void ProxySettingsChangedTo(JNIEnv* env, void ProxySettingsChangedTo(JNIEnv* env,
jobject jself, jobject jself,
jstring jhost, jstring jhost,
jint jport, jint jport,
jstring jpac_url, jstring jpac_url,
jobjectArray jexclusion_list) override { jobjectArray jexclusion_list) override {
std::string host = ConvertJavaStringToUTF8(env, jhost); std::string host = ConvertJavaStringToUTF8(env, jhost);
std::string pac_url; std::string pac_url;
if (jpac_url) if (jpac_url)
...@@ -318,7 +318,7 @@ class ProxyConfigServiceAndroid::Delegate ...@@ -318,7 +318,7 @@ class ProxyConfigServiceAndroid::Delegate
delegate_->ProxySettingsChangedTo(host, jport, pac_url, exclusion_list); delegate_->ProxySettingsChangedTo(host, jport, pac_url, exclusion_list);
} }
virtual void ProxySettingsChanged(JNIEnv* env, jobject self) override { void ProxySettingsChanged(JNIEnv* env, jobject self) override {
delegate_->ProxySettingsChanged(); delegate_->ProxySettingsChanged();
} }
......
...@@ -59,7 +59,7 @@ class NET_EXPORT ProxyConfigServiceAndroid : public ProxyConfigService { ...@@ -59,7 +59,7 @@ class NET_EXPORT ProxyConfigServiceAndroid : public ProxyConfigService {
const scoped_refptr<base::SequencedTaskRunner>& network_task_runner, const scoped_refptr<base::SequencedTaskRunner>& network_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner); const scoped_refptr<base::SequencedTaskRunner>& jni_task_runner);
virtual ~ProxyConfigServiceAndroid(); ~ProxyConfigServiceAndroid() override;
// Register JNI bindings. // Register JNI bindings.
static bool Register(JNIEnv* env); static bool Register(JNIEnv* env);
...@@ -71,9 +71,9 @@ class NET_EXPORT ProxyConfigServiceAndroid : public ProxyConfigService { ...@@ -71,9 +71,9 @@ class NET_EXPORT ProxyConfigServiceAndroid : public ProxyConfigService {
// ProxyConfigService: // ProxyConfigService:
// Called only on the network thread. // Called only on the network thread.
virtual void AddObserver(Observer* observer) override; void AddObserver(Observer* observer) override;
virtual void RemoveObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override;
virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override; ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
private: private:
friend class ProxyConfigServiceAndroidTestBase; friend class ProxyConfigServiceAndroidTestBase;
......
...@@ -23,7 +23,7 @@ class TestObserver : public ProxyConfigService::Observer { ...@@ -23,7 +23,7 @@ class TestObserver : public ProxyConfigService::Observer {
TestObserver() : availability_(ProxyConfigService::CONFIG_UNSET) {} TestObserver() : availability_(ProxyConfigService::CONFIG_UNSET) {}
// ProxyConfigService::Observer: // ProxyConfigService::Observer:
virtual void OnProxyConfigChanged( void OnProxyConfigChanged(
const ProxyConfig& config, const ProxyConfig& config,
ProxyConfigService::ConfigAvailability availability) override { ProxyConfigService::ConfigAvailability availability) override {
config_ = config; config_ = config;
...@@ -59,17 +59,15 @@ class ProxyConfigServiceAndroidTestBase : public testing::Test { ...@@ -59,17 +59,15 @@ class ProxyConfigServiceAndroidTestBase : public testing::Test {
base::Bind(&ProxyConfigServiceAndroidTestBase::GetProperty, base::Bind(&ProxyConfigServiceAndroidTestBase::GetProperty,
base::Unretained(this))) {} base::Unretained(this))) {}
virtual ~ProxyConfigServiceAndroidTestBase() {} ~ProxyConfigServiceAndroidTestBase() override {}
// testing::Test: // testing::Test:
virtual void SetUp() override { void SetUp() override {
message_loop_->RunUntilIdle(); message_loop_->RunUntilIdle();
service_.AddObserver(&observer_); service_.AddObserver(&observer_);
} }
virtual void TearDown() override { void TearDown() override { service_.RemoveObserver(&observer_); }
service_.RemoveObserver(&observer_);
}
void ClearConfiguration() { void ClearConfiguration() {
configuration_.clear(); configuration_.clear();
......
...@@ -29,7 +29,7 @@ class RemoteTestServer : public BaseTestServer { ...@@ -29,7 +29,7 @@ class RemoteTestServer : public BaseTestServer {
const SSLOptions& ssl_options, const SSLOptions& ssl_options,
const base::FilePath& document_root); const base::FilePath& document_root);
virtual ~RemoteTestServer(); ~RemoteTestServer() override;
// Starts the Python test server on the host, instead of on the device, and // Starts the Python test server on the host, instead of on the device, and
// blocks until the server is ready. // blocks until the server is ready.
......
...@@ -47,7 +47,7 @@ class SpawnerRequestData : public base::SupportsUserData::Data { ...@@ -47,7 +47,7 @@ class SpawnerRequestData : public base::SupportsUserData::Data {
data_received_->clear(); data_received_->clear();
} }
virtual ~SpawnerRequestData() {} ~SpawnerRequestData() override {}
bool DoesRequestIdMatch(int request_id) const { bool DoesRequestIdMatch(int request_id) const {
return request_id_ == request_id; return request_id_ == request_id;
......
...@@ -61,7 +61,7 @@ class ScopedPortException; ...@@ -61,7 +61,7 @@ class ScopedPortException;
class SpawnerCommunicator : public net::URLRequest::Delegate { class SpawnerCommunicator : public net::URLRequest::Delegate {
public: public:
explicit SpawnerCommunicator(uint16 port); explicit SpawnerCommunicator(uint16 port);
virtual ~SpawnerCommunicator(); ~SpawnerCommunicator() override;
// Starts an instance of the Python test server on the host/ machine. // Starts an instance of the Python test server on the host/ machine.
// If successfully started, returns true, setting |*port| to the port // If successfully started, returns true, setting |*port| to the port
...@@ -100,8 +100,8 @@ class SpawnerCommunicator : public net::URLRequest::Delegate { ...@@ -100,8 +100,8 @@ class SpawnerCommunicator : public net::URLRequest::Delegate {
std::string* data_received); std::string* data_received);
// URLRequest::Delegate methods. Called on the IO thread. // URLRequest::Delegate methods. Called on the IO thread.
virtual void OnResponseStarted(URLRequest* request) override; void OnResponseStarted(URLRequest* request) override;
virtual void OnReadCompleted(URLRequest* request, int num_bytes) override; void OnReadCompleted(URLRequest* request, int num_bytes) override;
// Reads Result from the response. Called on the IO thread. // Reads Result from the response. Called on the IO thread.
void ReadResult(URLRequest* request); void ReadResult(URLRequest* request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment