Skip to content

Commit

Permalink
net: Fix more clang warnings about missing virtual and OVERRIDE annot…
Browse files Browse the repository at this point in the history
…ations.

BUG=115047
R=willchan@chromium.org


Review URL: https://chromiumcodereview.appspot.com/10825437

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152296 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Aug 19, 2012
1 parent da35960 commit 1e43b68
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 35 deletions.
2 changes: 1 addition & 1 deletion net/base/dns_reloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DnsReloader : public net::NetworkChangeNotifier::DNSObserver {
net::NetworkChangeNotifier::AddDNSObserver(this);
}

~DnsReloader() {
virtual ~DnsReloader() {
NOTREACHED(); // LeakyLazyInstance is not destructed.
}

Expand Down
4 changes: 2 additions & 2 deletions net/base/net_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ class HostComponentTransform : public AppendComponentTransform {
private:
virtual string16 Execute(
const std::string& component_text,
std::vector<size_t>* offsets_into_component) const {
std::vector<size_t>* offsets_into_component) const OVERRIDE {
return IDNToUnicodeWithOffsets(component_text, languages_,
offsets_into_component);
}
Expand All @@ -853,7 +853,7 @@ class NonHostComponentTransform : public AppendComponentTransform {
private:
virtual string16 Execute(
const std::string& component_text,
std::vector<size_t>* offsets_into_component) const {
std::vector<size_t>* offsets_into_component) const OVERRIDE {
return (unescape_rules_ == UnescapeRule::NONE) ?
UTF8ToUTF16AndAdjustOffsets(component_text, offsets_into_component) :
UnescapeAndDecodeUTF8URLComponentWithOffsets(component_text,
Expand Down
2 changes: 1 addition & 1 deletion net/base/network_change_notifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NetworkChangeNotifierFactory* g_network_change_notifier_factory = NULL;

class MockNetworkChangeNotifier : public NetworkChangeNotifier {
public:
virtual ConnectionType GetCurrentConnectionType() const {
virtual ConnectionType GetCurrentConnectionType() const OVERRIDE {
return CONNECTION_UNKNOWN;
}
};
Expand Down
4 changes: 2 additions & 2 deletions net/disk_cache/entry_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class SyncCallback: public disk_cache::FileIOCallback {
entry->AddRef();
entry->IncrementIoCount();
}
~SyncCallback() {}
virtual ~SyncCallback() {}

virtual void OnFileIOComplete(int bytes_copied);
virtual void OnFileIOComplete(int bytes_copied) OVERRIDE;
void Discard();

private:
Expand Down
6 changes: 3 additions & 3 deletions net/disk_cache/file_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FileBackgroundIO : public disk_cache::BackgroundIO {
void Write();

private:
~FileBackgroundIO() {}
virtual ~FileBackgroundIO() {}

disk_cache::FileIOCallback* callback_;

Expand All @@ -66,7 +66,7 @@ class FileBackgroundIO : public disk_cache::BackgroundIO {
class FileInFlightIO : public disk_cache::InFlightIO {
public:
FileInFlightIO() {}
~FileInFlightIO() {}
virtual ~FileInFlightIO() {}

// These methods start an asynchronous operation. The arguments have the same
// semantics of the File asynchronous operations, with the exception that the
Expand All @@ -82,7 +82,7 @@ class FileInFlightIO : public disk_cache::InFlightIO {
// queued (because we are inside WaitForPendingIO), and false if said task is
// the one performing the call.
virtual void OnOperationComplete(disk_cache::BackgroundIO* operation,
bool cancel);
bool cancel) OVERRIDE;

private:
DISALLOW_COPY_AND_ASSIGN(FileInFlightIO);
Expand Down
4 changes: 2 additions & 2 deletions net/disk_cache/sparse_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ChildrenDeleter
ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name)
: backend_(backend->GetWeakPtr()), name_(name), signature_(0) {}

virtual void OnFileIOComplete(int bytes_copied);
virtual void OnFileIOComplete(int bytes_copied) OVERRIDE;

// Two ways of deleting the children: if we have the children map, use Start()
// directly, otherwise pass the data address to ReadData().
Expand All @@ -65,7 +65,7 @@ class ChildrenDeleter

private:
friend class base::RefCounted<ChildrenDeleter>;
~ChildrenDeleter() {}
virtual ~ChildrenDeleter() {}

void DeleteChildren();

Expand Down
4 changes: 2 additions & 2 deletions net/dns/dns_config_service_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ConfigReader : public SerialWorker {
explicit ConfigReader(const CallbackType& callback)
: callback_(callback), success_(false) {}

void DoWork() OVERRIDE {
virtual void DoWork() OVERRIDE {
base::TimeTicks start_time = base::TimeTicks::Now();
ConfigParsePosixResult result = ReadDnsConfig(&dns_config_);
success_ = (result == CONFIG_PARSE_POSIX_OK);
Expand All @@ -82,7 +82,7 @@ class ConfigReader : public SerialWorker {
base::TimeTicks::Now() - start_time);
}

void OnWorkFinished() OVERRIDE {
virtual void OnWorkFinished() OVERRIDE {
DCHECK(!IsCancelled());
if (success_) {
callback_.Run(dns_config_);
Expand Down
7 changes: 4 additions & 3 deletions net/ocsp/nss_ocsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class OCSPRequestSession

virtual void OnReceivedRedirect(net::URLRequest* request,
const GURL& new_url,
bool* defer_redirect) {
bool* defer_redirect) OVERRIDE {
DCHECK_EQ(request, request_);
DCHECK_EQ(MessageLoopForIO::current(), io_loop_);

Expand All @@ -265,7 +265,7 @@ class OCSPRequestSession
}
}

virtual void OnResponseStarted(net::URLRequest* request) {
virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE {
DCHECK_EQ(request, request_);
DCHECK_EQ(MessageLoopForIO::current(), io_loop_);

Expand All @@ -279,7 +279,8 @@ class OCSPRequestSession
OnReadCompleted(request_, bytes_read);
}

virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {
virtual void OnReadCompleted(net::URLRequest* request,
int bytes_read) OVERRIDE {
DCHECK_EQ(request, request_);
DCHECK_EQ(MessageLoopForIO::current(), io_loop_);

Expand Down
7 changes: 4 additions & 3 deletions net/proxy/proxy_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,10 @@ class UnsetProxyConfigService : public ProxyConfigService {
UnsetProxyConfigService() {}
virtual ~UnsetProxyConfigService() {}

virtual void AddObserver(Observer* observer) {}
virtual void RemoveObserver(Observer* observer) {}
virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) {
virtual void AddObserver(Observer* observer) OVERRIDE {}
virtual void RemoveObserver(Observer* observer) OVERRIDE {}
virtual ConfigAvailability GetLatestProxyConfig(
ProxyConfig* config) OVERRIDE {
return CONFIG_UNSET;
}
};
Expand Down
12 changes: 6 additions & 6 deletions net/socket/client_socket_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ class DefaultClientSocketFactory : public ClientSocketFactory,
CertDatabase::RemoveObserver(this);
}

virtual void OnUserCertAdded(const X509Certificate* cert) {
virtual void OnUserCertAdded(const X509Certificate* cert) OVERRIDE {
ClearSSLSessionCache();
}

virtual void OnCertTrustChanged(const X509Certificate* cert) {
virtual void OnCertTrustChanged(const X509Certificate* cert) OVERRIDE {
// Per wtc, we actually only need to flush when trust is reduced.
// Always flush now because OnCertTrustChanged does not tell us this.
// See comments in ClientSocketPoolManager::OnCertTrustChanged.
Expand All @@ -79,22 +79,22 @@ class DefaultClientSocketFactory : public ClientSocketFactory,
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
const NetLog::Source& source) {
const NetLog::Source& source) OVERRIDE {
return new UDPClientSocket(bind_type, rand_int_cb, net_log, source);
}

virtual StreamSocket* CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
const NetLog::Source& source) {
const NetLog::Source& source) OVERRIDE {
return new TCPClientSocket(addresses, net_log, source);
}

virtual SSLClientSocket* CreateSSLClientSocket(
ClientSocketHandle* transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
const SSLClientSocketContext& context) {
const SSLClientSocketContext& context) OVERRIDE {
// nss_thread_task_runner_ may be NULL if g_use_dedicated_nss_thread is
// false or if the dedicated NSS thread failed to start. If so, cause NSS
// functions to execute on the current task runner.
Expand Down Expand Up @@ -137,7 +137,7 @@ class DefaultClientSocketFactory : public ClientSocketFactory,
#endif
}

void ClearSSLSessionCache() {
virtual void ClearSSLSessionCache() OVERRIDE {
SSLClientSocket::ClearSessionCache();
}

Expand Down
2 changes: 1 addition & 1 deletion net/spdy/spdy_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ class SimpleSpdyIOBufferProducer : public SpdySession::SpdyIOBufferProducer {
return priority_;
}

virtual SpdyIOBuffer* ProduceNextBuffer(SpdySession* session) {
virtual SpdyIOBuffer* ProduceNextBuffer(SpdySession* session) OVERRIDE {
return SpdySession::SpdyIOBufferProducer::CreateIOBuffer(
frame_.get(), priority_, NULL);
}
Expand Down
18 changes: 9 additions & 9 deletions net/url_request/url_request_http_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ class URLRequestHttpJob::HttpFilterContext : public FilterContext {
virtual ~HttpFilterContext();

// FilterContext implementation.
virtual bool GetMimeType(std::string* mime_type) const;
virtual bool GetURL(GURL* gurl) const;
virtual base::Time GetRequestTime() const;
virtual bool IsCachedContent() const;
virtual bool IsDownload() const;
virtual bool IsSdchResponse() const;
virtual int64 GetByteReadCount() const;
virtual int GetResponseCode() const;
virtual void RecordPacketStats(StatisticSelector statistic) const;
virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
virtual bool GetURL(GURL* gurl) const OVERRIDE;
virtual base::Time GetRequestTime() const OVERRIDE;
virtual bool IsCachedContent() const OVERRIDE;
virtual bool IsDownload() const OVERRIDE;
virtual bool IsSdchResponse() const OVERRIDE;
virtual int64 GetByteReadCount() const OVERRIDE;
virtual int GetResponseCode() const OVERRIDE;
virtual void RecordPacketStats(StatisticSelector statistic) const OVERRIDE;

// Method to allow us to reset filter context for a response that should have
// been SDCH encoded when there is an update due to an explicit HTTP header.
Expand Down

0 comments on commit 1e43b68

Please sign in to comment.