Revved to chromium 0e1d34edba6a5d8f7fe43c5b675880a36f4b3861 refs/remotes/origin/HEAD
filter gyp out of build/landmines.py
filter pepper out of mojo/examples/BUILD.gn
filter html_viewer out of mojo/services/BUILD.gn
filter js out of mojo/BUILD.gn and mojo/tools/data/unittests
filter js/bindings out of mojo/public/BUILD.gn
applied patch gpu_media.patch
applied patch cc_strip_video.patch
applied patch ui_test_support.patch
applied patch remove_ipc_deps.patch
applied patch ui_compositor.patch
applied patch net_sql.patch
diff --git a/net/base/backoff_entry_unittest.cc b/net/base/backoff_entry_unittest.cc
index f5393e8..89ec2c4 100644
--- a/net/base/backoff_entry_unittest.cc
+++ b/net/base/backoff_entry_unittest.cc
@@ -23,11 +23,9 @@
SetCustomReleaseTime(TimeTicks());
}
- virtual ~TestBackoffEntry() {}
+ ~TestBackoffEntry() override {}
- virtual TimeTicks ImplGetTimeNow() const override {
- return now_;
- }
+ TimeTicks ImplGetTimeNow() const override { return now_; }
void set_now(const TimeTicks& now) {
now_ = now;
diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h
index a58b6ff..5977533 100644
--- a/net/base/capturing_net_log.h
+++ b/net/base/capturing_net_log.h
@@ -72,7 +72,7 @@
typedef std::vector<CapturedEntry> CapturedEntryList;
CapturingNetLog();
- virtual ~CapturingNetLog();
+ ~CapturingNetLog() override;
void SetLogLevel(LogLevel log_level);
@@ -89,7 +89,7 @@
class Observer : public NetLog::ThreadSafeObserver {
public:
Observer();
- virtual ~Observer();
+ ~Observer() override;
// Returns the list of all entries in the log.
void GetEntries(CapturedEntryList* entry_list) const;
@@ -105,7 +105,7 @@
private:
// ThreadSafeObserver implementation:
- virtual void OnAddEntry(const Entry& entry) override;
+ void OnAddEntry(const Entry& entry) override;
// Needs to be "mutable" so can use it in GetEntries().
mutable base::Lock lock_;
diff --git a/net/base/chunked_upload_data_stream.h b/net/base/chunked_upload_data_stream.h
index 71b1e5c..d17c8da 100644
--- a/net/base/chunked_upload_data_stream.h
+++ b/net/base/chunked_upload_data_stream.h
@@ -25,7 +25,7 @@
public:
ChunkedUploadDataStream(int64 identifier);
- virtual ~ChunkedUploadDataStream();
+ ~ChunkedUploadDataStream() override;
// Adds data to the stream. |is_done| should be true if this is the last
// data to be appended. |data_len| must not be 0 unless |is_done| is true.
@@ -35,9 +35,9 @@
private:
// UploadDataStream implementation.
- virtual int InitInternal() override;
- virtual int ReadInternal(IOBuffer* buf, int buf_len) override;
- virtual void ResetInternal() override;
+ int InitInternal() override;
+ int ReadInternal(IOBuffer* buf, int buf_len) override;
+ void ResetInternal() override;
int ReadChunk(IOBuffer* buf, int buf_len);
diff --git a/net/base/directory_lister_unittest.cc b/net/base/directory_lister_unittest.cc
index f52e23e..98ecbbd 100644
--- a/net/base/directory_lister_unittest.cc
+++ b/net/base/directory_lister_unittest.cc
@@ -27,15 +27,14 @@
quit_loop_after_each_file_(quit_loop_after_each_file) {
}
- virtual void OnListFile(
- const DirectoryLister::DirectoryListerData& data) override {
+ void OnListFile(const DirectoryLister::DirectoryListerData& data) override {
file_list_.push_back(data.info);
paths_.push_back(data.path);
if (quit_loop_after_each_file_)
base::MessageLoop::current()->Quit();
}
- virtual void OnListDone(int error) override {
+ void OnListDone(int error) override {
error_ = error;
base::MessageLoop::current()->Quit();
if (recursive_)
diff --git a/net/base/elements_upload_data_stream.h b/net/base/elements_upload_data_stream.h
index 1a008fc..5101114 100644
--- a/net/base/elements_upload_data_stream.h
+++ b/net/base/elements_upload_data_stream.h
@@ -26,7 +26,7 @@
ElementsUploadDataStream(ScopedVector<UploadElementReader> element_readers,
int64 identifier);
- virtual ~ElementsUploadDataStream();
+ ~ElementsUploadDataStream() override;
// Creates an ElementsUploadDataStream with a single reader. Returns a
// scoped_ptr<UploadDataStream> for ease of use.
@@ -36,12 +36,11 @@
private:
// UploadDataStream implementation.
- virtual bool IsInMemory() const override;
- virtual const ScopedVector<UploadElementReader>*
- GetElementReaders() const override;
- virtual int InitInternal() override;
- virtual int ReadInternal(IOBuffer* buf, int buf_len) override;
- virtual void ResetInternal() override;
+ bool IsInMemory() const override;
+ const ScopedVector<UploadElementReader>* GetElementReaders() const override;
+ int InitInternal() override;
+ int ReadInternal(IOBuffer* buf, int buf_len) override;
+ void ResetInternal() override;
// Runs Init() for all element readers.
// This method is used to implement InitInternal().
diff --git a/net/base/io_buffer.h b/net/base/io_buffer.h
index 2d87058..04bbc88 100644
--- a/net/base/io_buffer.h
+++ b/net/base/io_buffer.h
@@ -104,7 +104,7 @@
// constructor IOBuffer(char*) thus allowing subclass to use underlying
// memory it does not own.
IOBufferWithSize(char* data, int size);
- virtual ~IOBufferWithSize();
+ ~IOBufferWithSize() override;
int size_;
};
@@ -119,7 +119,7 @@
int size() const { return static_cast<int>(string_data_.size()); }
private:
- virtual ~StringIOBuffer();
+ ~StringIOBuffer() override;
std::string string_data_;
};
@@ -162,7 +162,7 @@
int size() const { return size_; }
private:
- virtual ~DrainableIOBuffer();
+ ~DrainableIOBuffer() override;
scoped_refptr<IOBuffer> base_;
int size_;
@@ -202,7 +202,7 @@
char* StartOfBuffer();
private:
- virtual ~GrowableIOBuffer();
+ ~GrowableIOBuffer() override;
scoped_ptr<char, base::FreeDeleter> real_data_;
int capacity_;
@@ -222,7 +222,7 @@
void Done();
private:
- virtual ~PickledIOBuffer();
+ ~PickledIOBuffer() override;
Pickle pickle_;
};
@@ -237,7 +237,7 @@
explicit WrappedIOBuffer(const char* data);
protected:
- virtual ~WrappedIOBuffer();
+ ~WrappedIOBuffer() override;
};
} // namespace net
diff --git a/net/base/mock_file_stream.h b/net/base/mock_file_stream.h
index abceb1b..7b7dea8 100644
--- a/net/base/mock_file_stream.h
+++ b/net/base/mock_file_stream.h
@@ -25,18 +25,19 @@
explicit MockFileStream(const scoped_refptr<base::TaskRunner>& task_runner);
MockFileStream(base::File file,
const scoped_refptr<base::TaskRunner>& task_runner);
- virtual ~MockFileStream();
+ ~MockFileStream() override;
// FileStream methods.
- virtual int Seek(base::File::Whence whence, int64 offset,
- const Int64CompletionCallback& callback) override;
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Flush(const CompletionCallback& callback) override;
+ int Seek(base::File::Whence whence,
+ int64 offset,
+ const Int64CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Flush(const CompletionCallback& callback) override;
void set_forced_error_async(int error) {
forced_error_ = error;
diff --git a/net/base/net_log_logger.h b/net/base/net_log_logger.h
index 6604b82..406841e 100644
--- a/net/base/net_log_logger.h
+++ b/net/base/net_log_logger.h
@@ -28,7 +28,7 @@
// starts. |file| must be non-NULL handle and be open for writing.
// |constants| is a legend for decoding constant values used in the log.
NetLogLogger(FILE* file, const base::Value& constants);
- virtual ~NetLogLogger();
+ ~NetLogLogger() override;
// Sets the log level to log at. Must be called before StartObserving.
void set_log_level(NetLog::LogLevel log_level);
@@ -41,7 +41,7 @@
void StopObserving();
// net::NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const NetLog::Entry& entry) override;
+ void OnAddEntry(const NetLog::Entry& entry) override;
// Create a dictionary containing legend for net/ constants. Caller takes
// ownership of returned value.
diff --git a/net/base/net_log_unittest.cc b/net/base/net_log_unittest.cc
index d1e7dde..0f5b0eb 100644
--- a/net/base/net_log_unittest.cc
+++ b/net/base/net_log_unittest.cc
@@ -75,14 +75,12 @@
public:
CountingObserver() : count_(0) {}
- virtual ~CountingObserver() {
+ ~CountingObserver() override {
if (net_log())
net_log()->RemoveThreadSafeObserver(this);
}
- virtual void OnAddEntry(const NetLog::Entry& entry) override {
- ++count_;
- }
+ void OnAddEntry(const NetLog::Entry& entry) override { ++count_; }
int count() const { return count_; }
@@ -94,12 +92,12 @@
public:
LoggingObserver() {}
- virtual ~LoggingObserver() {
+ ~LoggingObserver() override {
if (net_log())
net_log()->RemoveThreadSafeObserver(this);
}
- virtual void OnAddEntry(const NetLog::Entry& entry) override {
+ void OnAddEntry(const NetLog::Entry& entry) override {
base::Value* value = entry.ToValue();
base::DictionaryValue* dict = NULL;
ASSERT_TRUE(value->GetAsDictionary(&dict));
@@ -138,7 +136,7 @@
net_log_ = net_log;
}
- virtual void Run() override {
+ void Run() override {
start_event_->Wait();
RunTestThread();
}
@@ -162,10 +160,10 @@
class AddEventsTestThread : public NetLogTestThread {
public:
AddEventsTestThread() {}
- virtual ~AddEventsTestThread() {}
+ ~AddEventsTestThread() override {}
private:
- virtual void RunTestThread() override {
+ void RunTestThread() override {
for (int i = 0; i < kEvents; ++i)
AddEvent(net_log_);
}
@@ -178,12 +176,10 @@
public:
AddRemoveObserverTestThread() {}
- virtual ~AddRemoveObserverTestThread() {
- EXPECT_TRUE(!observer_.net_log());
- }
+ ~AddRemoveObserverTestThread() override { EXPECT_TRUE(!observer_.net_log()); }
private:
- virtual void RunTestThread() override {
+ void RunTestThread() override {
for (int i = 0; i < kEvents; ++i) {
ASSERT_FALSE(observer_.net_log());
diff --git a/net/base/net_util_icu.cc b/net/base/net_util_icu.cc
index bd5625b..8526eda 100644
--- a/net/base/net_util_icu.cc
+++ b/net/base/net_util_icu.cc
@@ -491,7 +491,7 @@
}
private:
- virtual base::string16 Execute(
+ base::string16 Execute(
const std::string& component_text,
base::OffsetAdjuster::Adjustments* adjustments) const override {
return IDNToUnicodeWithAdjustments(component_text, languages_,
@@ -508,7 +508,7 @@
}
private:
- virtual base::string16 Execute(
+ base::string16 Execute(
const std::string& component_text,
base::OffsetAdjuster::Adjustments* adjustments) const override {
return (unescape_rules_ == UnescapeRule::NONE) ?
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index bea6759..afd6b23 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -45,7 +45,7 @@
class MockNetworkChangeNotifier : public NetworkChangeNotifier {
public:
- virtual ConnectionType GetCurrentConnectionType() const override {
+ ConnectionType GetCurrentConnectionType() const override {
return CONNECTION_UNKNOWN;
}
};
@@ -83,7 +83,7 @@
NetworkChangeNotifier::AddNetworkChangeObserver(this);
}
- virtual ~HistogramWatcher() {
+ ~HistogramWatcher() override {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(g_network_change_notifier);
NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
@@ -93,7 +93,7 @@
}
// NetworkChangeNotifier::IPAddressObserver implementation.
- virtual void OnIPAddressChanged() override {
+ void OnIPAddressChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.IPAddressChange",
SinceLast(&last_ip_address_change_));
@@ -103,7 +103,7 @@
}
// NetworkChangeNotifier::ConnectionTypeObserver implementation.
- virtual void OnConnectionTypeChanged(
+ void OnConnectionTypeChanged(
NetworkChangeNotifier::ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
base::TimeTicks now = base::TimeTicks::Now();
@@ -264,15 +264,14 @@
}
// NetworkChangeNotifier::DNSObserver implementation.
- virtual void OnDNSChanged() override {
+ void OnDNSChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.DNSConfigChange",
SinceLast(&last_dns_change_));
}
// NetworkChangeNotifier::NetworkChangeObserver implementation.
- virtual void OnNetworkChanged(
- NetworkChangeNotifier::ConnectionType type) override {
+ void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
if (type != NetworkChangeNotifier::CONNECTION_NONE) {
UMA_HISTOGRAM_MEDIUM_TIMES("NCN.NetworkOnlineChange",
@@ -424,7 +423,7 @@
AddIPAddressObserver(this);
}
- virtual ~NetworkChangeCalculator() {
+ ~NetworkChangeCalculator() override {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(g_network_change_notifier);
RemoveConnectionTypeObserver(this);
@@ -432,7 +431,7 @@
}
// NetworkChangeNotifier::IPAddressObserver implementation.
- virtual void OnIPAddressChanged() override {
+ void OnIPAddressChanged() override {
DCHECK(thread_checker_.CalledOnValidThread());
base::TimeDelta delay = last_announced_connection_type_ == CONNECTION_NONE
? params_.ip_address_offline_delay_ : params_.ip_address_online_delay_;
@@ -441,7 +440,7 @@
}
// NetworkChangeNotifier::ConnectionTypeObserver implementation.
- virtual void OnConnectionTypeChanged(ConnectionType type) override {
+ void OnConnectionTypeChanged(ConnectionType type) override {
DCHECK(thread_checker_.CalledOnValidThread());
pending_connection_type_ = type;
base::TimeDelta delay = last_announced_connection_type_ == CONNECTION_NONE
diff --git a/net/base/network_change_notifier_mac.cc b/net/base/network_change_notifier_mac.cc
index e378418..14ec554 100644
--- a/net/base/network_change_notifier_mac.cc
+++ b/net/base/network_change_notifier_mac.cc
@@ -43,18 +43,14 @@
public:
DnsConfigServiceThread() : base::Thread("DnsConfigService") {}
- virtual ~DnsConfigServiceThread() {
- Stop();
- }
+ ~DnsConfigServiceThread() override { Stop(); }
- virtual void Init() override {
+ void Init() override {
service_ = DnsConfigService::CreateSystemService();
service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
- virtual void CleanUp() override {
- service_.reset();
- }
+ void CleanUp() override { service_.reset(); }
private:
scoped_ptr<DnsConfigService> service_;
diff --git a/net/base/network_change_notifier_mac.h b/net/base/network_change_notifier_mac.h
index 1598c4c..6f34087 100644
--- a/net/base/network_change_notifier_mac.h
+++ b/net/base/network_change_notifier_mac.h
@@ -21,10 +21,10 @@
class NetworkChangeNotifierMac: public NetworkChangeNotifier {
public:
NetworkChangeNotifierMac();
- virtual ~NetworkChangeNotifierMac();
+ ~NetworkChangeNotifierMac() override;
// NetworkChangeNotifier implementation:
- virtual ConnectionType GetCurrentConnectionType() const override;
+ ConnectionType GetCurrentConnectionType() const override;
// Forwarder just exists to keep the NetworkConfigWatcherMac API out of
// NetworkChangeNotifierMac's public API.
@@ -34,11 +34,10 @@
: net_config_watcher_(net_config_watcher) {}
// NetworkConfigWatcherMac::Delegate implementation:
- virtual void Init() override;
- virtual void StartReachabilityNotifications() override;
- virtual void SetDynamicStoreNotificationKeys(
- SCDynamicStoreRef store) override;
- virtual void OnNetworkConfigChange(CFArrayRef changed_keys) override;
+ void Init() override;
+ void StartReachabilityNotifications() override;
+ void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store) override;
+ void OnNetworkConfigChange(CFArrayRef changed_keys) override;
private:
NetworkChangeNotifierMac* const net_config_watcher_;
diff --git a/net/base/network_config_watcher_mac.cc b/net/base/network_config_watcher_mac.cc
index 7d2377c..bdf75c3 100644
--- a/net/base/network_config_watcher_mac.cc
+++ b/net/base/network_config_watcher_mac.cc
@@ -31,12 +31,12 @@
class NetworkConfigWatcherMacThread : public base::Thread {
public:
NetworkConfigWatcherMacThread(NetworkConfigWatcherMac::Delegate* delegate);
- virtual ~NetworkConfigWatcherMacThread();
+ ~NetworkConfigWatcherMacThread() override;
protected:
// base::Thread
- virtual void Init() override;
- virtual void CleanUp() override;
+ void Init() override;
+ void CleanUp() override;
private:
// The SystemConfiguration calls in this function can lead to contention early
diff --git a/net/base/prioritized_dispatcher_unittest.cc b/net/base/prioritized_dispatcher_unittest.cc
index 4cdf53b..40c7425 100644
--- a/net/base/prioritized_dispatcher_unittest.cc
+++ b/net/base/prioritized_dispatcher_unittest.cc
@@ -117,7 +117,7 @@
}
// PriorityDispatch::Job interface
- virtual void Start() override {
+ void Start() override {
EXPECT_FALSE(running_);
handle_ = PrioritizedDispatcher::Handle();
running_ = true;
diff --git a/net/base/sdch_dictionary_fetcher.h b/net/base/sdch_dictionary_fetcher.h
index 86aaf48..d74f643 100644
--- a/net/base/sdch_dictionary_fetcher.h
+++ b/net/base/sdch_dictionary_fetcher.h
@@ -41,15 +41,15 @@
// this object.
SdchDictionaryFetcher(SdchFetcher::Delegate* consumer,
URLRequestContext* context);
- virtual ~SdchDictionaryFetcher();
+ ~SdchDictionaryFetcher() override;
// Implementation of SdchFetcher methods.
- virtual void Schedule(const GURL& dictionary_url) override;
- virtual void Cancel() override;
+ void Schedule(const GURL& dictionary_url) override;
+ void Cancel() override;
// Implementation of URLRequest::Delegate methods.
- virtual void OnResponseStarted(URLRequest* request) override;
- virtual void OnReadCompleted(URLRequest* request, int bytes_read) override;
+ void OnResponseStarted(URLRequest* request) override;
+ void OnReadCompleted(URLRequest* request, int bytes_read) override;
private:
enum State {
diff --git a/net/base/sdch_dictionary_fetcher_unittest.cc b/net/base/sdch_dictionary_fetcher_unittest.cc
index a8b3040..af66681 100644
--- a/net/base/sdch_dictionary_fetcher_unittest.cc
+++ b/net/base/sdch_dictionary_fetcher_unittest.cc
@@ -58,11 +58,11 @@
static int jobs_requested() { return jobs_requested_; }
private:
- virtual ~URLRequestSpecifiedResponseJob() {};
- virtual int GetData(std::string* mime_type,
- std::string* charset,
- std::string* data,
- const CompletionCallback& callback) const override {
+ ~URLRequestSpecifiedResponseJob() override{};
+ int GetData(std::string* mime_type,
+ std::string* charset,
+ std::string* data,
+ const CompletionCallback& callback) const override {
GURL url(request_->url());
*data = ExpectedResponseForURL(url);
return OK;
@@ -86,8 +86,8 @@
GURL dictionary_url;
};
- virtual void AddSdchDictionary(const std::string& dictionary_text,
- const GURL& dictionary_url) override {
+ void AddSdchDictionary(const std::string& dictionary_text,
+ const GURL& dictionary_url) override {
dictionary_additions.push_back(
DictionaryAdditions(dictionary_text, dictionary_url));
}
diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h
index 18f6749..b5f901b 100644
--- a/net/base/sdch_manager.h
+++ b/net/base/sdch_manager.h
@@ -252,7 +252,7 @@
};
SdchManager();
- virtual ~SdchManager();
+ ~SdchManager() override;
// Clear data (for browser data removal).
void ClearData();
@@ -355,8 +355,8 @@
// dictionaries. This addition will fail if addition is illegal
// (data in the dictionary is not acceptable from the
// dictionary_url; dictionary already added, etc.).
- virtual void AddSdchDictionary(const std::string& dictionary_text,
- const GURL& dictionary_url) override;
+ void AddSdchDictionary(const std::string& dictionary_text,
+ const GURL& dictionary_url) override;
private:
struct BlacklistInfo {
diff --git a/net/base/test_completion_callback.h b/net/base/test_completion_callback.h
index 469d12f..f5a9f8d 100644
--- a/net/base/test_completion_callback.h
+++ b/net/base/test_completion_callback.h
@@ -87,7 +87,7 @@
class TestCompletionCallback : public TestCompletionCallbackBase {
public:
TestCompletionCallback();
- virtual ~TestCompletionCallback();
+ ~TestCompletionCallback() override;
const CompletionCallback& callback() const { return callback_; }
@@ -100,7 +100,7 @@
class TestInt64CompletionCallback : public TestInt64CompletionCallbackBase {
public:
TestInt64CompletionCallback();
- virtual ~TestInt64CompletionCallback();
+ ~TestInt64CompletionCallback() override;
const Int64CompletionCallback& callback() const { return callback_; }
@@ -114,10 +114,10 @@
class ReleaseBufferCompletionCallback: public TestCompletionCallback {
public:
explicit ReleaseBufferCompletionCallback(IOBuffer* buffer);
- virtual ~ReleaseBufferCompletionCallback();
+ ~ReleaseBufferCompletionCallback() override;
private:
- virtual void SetResult(int result) override;
+ void SetResult(int result) override;
IOBuffer* buffer_;
DISALLOW_COPY_AND_ASSIGN(ReleaseBufferCompletionCallback);
diff --git a/net/base/trace_net_log_observer.cc b/net/base/trace_net_log_observer.cc
index 77945fb..15960c3 100644
--- a/net/base/trace_net_log_observer.cc
+++ b/net/base/trace_net_log_observer.cc
@@ -24,9 +24,9 @@
explicit TracedValue(scoped_ptr<base::Value> value) : value_(value.Pass()) {}
private:
- virtual ~TracedValue() {}
+ ~TracedValue() override {}
- virtual void AppendAsTraceFormat(std::string* out) const override {
+ void AppendAsTraceFormat(std::string* out) const override {
if (value_) {
std::string tmp;
base::JSONWriter::Write(value_.get(), &tmp);
diff --git a/net/base/trace_net_log_observer.h b/net/base/trace_net_log_observer.h
index 567ba3f..9fc062b 100644
--- a/net/base/trace_net_log_observer.h
+++ b/net/base/trace_net_log_observer.h
@@ -19,10 +19,10 @@
public base::debug::TraceLog::EnabledStateObserver {
public:
TraceNetLogObserver();
- virtual ~TraceNetLogObserver();
+ ~TraceNetLogObserver() override;
// net::NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const NetLog::Entry& entry) override;
+ void OnAddEntry(const NetLog::Entry& entry) override;
// Start to watch for TraceLog enable and disable events.
// This can't be called if already watching for events.
@@ -35,8 +35,8 @@
void StopWatchForTraceStart();
// base::debug::TraceLog::EnabledStateChangedObserver implementation:
- virtual void OnTraceLogEnabled() override;
- virtual void OnTraceLogDisabled() override;
+ void OnTraceLogEnabled() override;
+ void OnTraceLogDisabled() override;
private:
NetLog* net_log_to_watch_;
diff --git a/net/base/upload_bytes_element_reader.h b/net/base/upload_bytes_element_reader.h
index 589e287..3246d12 100644
--- a/net/base/upload_bytes_element_reader.h
+++ b/net/base/upload_bytes_element_reader.h
@@ -20,20 +20,20 @@
class NET_EXPORT UploadBytesElementReader : public UploadElementReader {
public:
UploadBytesElementReader(const char* bytes, uint64 length);
- virtual ~UploadBytesElementReader();
+ ~UploadBytesElementReader() override;
const char* bytes() const { return bytes_; }
uint64 length() const { return length_; }
// UploadElementReader overrides:
- virtual const UploadBytesElementReader* AsBytesReader() const override;
- virtual int Init(const CompletionCallback& callback) override;
- virtual uint64 GetContentLength() const override;
- virtual uint64 BytesRemaining() const override;
- virtual bool IsInMemory() const override;
- virtual int Read(IOBuffer* buf,
- int buf_length,
- const CompletionCallback& callback) override;
+ const UploadBytesElementReader* AsBytesReader() const override;
+ int Init(const CompletionCallback& callback) override;
+ uint64 GetContentLength() const override;
+ uint64 BytesRemaining() const override;
+ bool IsInMemory() const override;
+ int Read(IOBuffer* buf,
+ int buf_length,
+ const CompletionCallback& callback) override;
private:
const char* const bytes_;
@@ -49,7 +49,7 @@
public:
// |data| is cleared by this ctor.
explicit UploadOwnedBytesElementReader(std::vector<char>* data);
- virtual ~UploadOwnedBytesElementReader();
+ ~UploadOwnedBytesElementReader() override;
// Creates UploadOwnedBytesElementReader with a string.
static UploadOwnedBytesElementReader* CreateWithString(
diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h
index dc27585..fc3f334 100644
--- a/net/base/upload_file_element_reader.h
+++ b/net/base/upload_file_element_reader.h
@@ -32,7 +32,7 @@
uint64 range_offset,
uint64 range_length,
const base::Time& expected_modification_time);
- virtual ~UploadFileElementReader();
+ ~UploadFileElementReader() override;
const base::FilePath& path() const { return path_; }
uint64 range_offset() const { return range_offset_; }
@@ -42,13 +42,13 @@
}
// UploadElementReader overrides:
- virtual const UploadFileElementReader* AsFileReader() const override;
- virtual int Init(const CompletionCallback& callback) override;
- virtual uint64 GetContentLength() const override;
- virtual uint64 BytesRemaining() const override;
- virtual int Read(IOBuffer* buf,
- int buf_length,
- const CompletionCallback& callback) override;
+ const UploadFileElementReader* AsFileReader() const override;
+ int Init(const CompletionCallback& callback) override;
+ uint64 GetContentLength() const override;
+ uint64 BytesRemaining() const override;
+ int Read(IOBuffer* buf,
+ int buf_length,
+ const CompletionCallback& callback) override;
private:
FRIEND_TEST_ALL_PREFIXES(ElementsUploadDataStreamTest, FileSmallerThanLength);
diff --git a/net/cert/cert_verify_proc_mac.h b/net/cert/cert_verify_proc_mac.h
index f26768f..5cd7f4c 100644
--- a/net/cert/cert_verify_proc_mac.h
+++ b/net/cert/cert_verify_proc_mac.h
@@ -15,18 +15,18 @@
public:
CertVerifyProcMac();
- virtual bool SupportsAdditionalTrustAnchors() const override;
+ bool SupportsAdditionalTrustAnchors() const override;
protected:
- virtual ~CertVerifyProcMac();
+ ~CertVerifyProcMac() override;
private:
- virtual int VerifyInternal(X509Certificate* cert,
- const std::string& hostname,
- int flags,
- CRLSet* crl_set,
- const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) override;
+ int VerifyInternal(X509Certificate* cert,
+ const std::string& hostname,
+ int flags,
+ CRLSet* crl_set,
+ const CertificateList& additional_trust_anchors,
+ CertVerifyResult* verify_result) override;
};
} // namespace net
diff --git a/net/cert/cert_verify_proc_unittest.cc b/net/cert/cert_verify_proc_unittest.cc
index a71aa9a..4031eac 100644
--- a/net/cert/cert_verify_proc_unittest.cc
+++ b/net/cert/cert_verify_proc_unittest.cc
@@ -58,18 +58,18 @@
: is_well_known_(is_well_known) {}
// CertVerifyProc implementation:
- virtual bool SupportsAdditionalTrustAnchors() const override { return false; }
+ bool SupportsAdditionalTrustAnchors() const override { return false; }
protected:
- virtual ~WellKnownCaCertVerifyProc() {}
+ ~WellKnownCaCertVerifyProc() override {}
private:
- virtual int VerifyInternal(X509Certificate* cert,
- const std::string& hostname,
- int flags,
- CRLSet* crl_set,
- const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) override;
+ int VerifyInternal(X509Certificate* cert,
+ const std::string& hostname,
+ int flags,
+ CRLSet* crl_set,
+ const CertificateList& additional_trust_anchors,
+ CertVerifyResult* verify_result) override;
const bool is_well_known_;
diff --git a/net/cert/mock_cert_verifier.h b/net/cert/mock_cert_verifier.h
index e76f78f..000da11 100644
--- a/net/cert/mock_cert_verifier.h
+++ b/net/cert/mock_cert_verifier.h
@@ -22,18 +22,18 @@
// handle a certificate or certificate and host.
MockCertVerifier();
- virtual ~MockCertVerifier();
+ ~MockCertVerifier() override;
// CertVerifier implementation
- virtual int Verify(X509Certificate* cert,
- const std::string& hostname,
- int flags,
- CRLSet* crl_set,
- CertVerifyResult* verify_result,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle req) override;
+ int Verify(X509Certificate* cert,
+ const std::string& hostname,
+ int flags,
+ CRLSet* crl_set,
+ CertVerifyResult* verify_result,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle req) override;
// Sets the default return value for Verify() for certificates/hosts that do
// not have explicit results added via the AddResult*() methods.
diff --git a/net/cert/multi_log_ct_verifier.h b/net/cert/multi_log_ct_verifier.h
index 70adf52..85bfa63 100644
--- a/net/cert/multi_log_ct_verifier.h
+++ b/net/cert/multi_log_ct_verifier.h
@@ -31,17 +31,17 @@
class NET_EXPORT MultiLogCTVerifier : public CTVerifier {
public:
MultiLogCTVerifier();
- virtual ~MultiLogCTVerifier();
+ ~MultiLogCTVerifier() override;
void AddLog(scoped_ptr<CTLogVerifier> log_verifier);
void AddLogs(ScopedVector<CTLogVerifier> log_verifiers);
// CTVerifier implementation:
- virtual int Verify(X509Certificate* cert,
- const std::string& stapled_ocsp_response,
- const std::string& sct_list_from_tls_extension,
- ct::CTVerifyResult* result,
- const BoundNetLog& net_log) override;
+ int Verify(X509Certificate* cert,
+ const std::string& stapled_ocsp_response,
+ const std::string& sct_list_from_tls_extension,
+ ct::CTVerifyResult* result,
+ const BoundNetLog& net_log) override;
private:
// Mapping from a log's ID to the verifier for this log.
diff --git a/net/cert/multi_threaded_cert_verifier.h b/net/cert/multi_threaded_cert_verifier.h
index 2ca10f1..6880960 100644
--- a/net/cert/multi_threaded_cert_verifier.h
+++ b/net/cert/multi_threaded_cert_verifier.h
@@ -41,7 +41,7 @@
// When the verifier is destroyed, all certificate verifications requests are
// canceled, and their completion callbacks will not be called.
- virtual ~MultiThreadedCertVerifier();
+ ~MultiThreadedCertVerifier() override;
// Configures a source of additional certificates that should be treated as
// trust anchors during verification, provided that the underlying
@@ -54,16 +54,16 @@
CertTrustAnchorProvider* trust_anchor_provider);
// CertVerifier implementation
- virtual int Verify(X509Certificate* cert,
- const std::string& hostname,
- int flags,
- CRLSet* crl_set,
- CertVerifyResult* verify_result,
- const CompletionCallback& callback,
- CertVerifier::RequestHandle* out_req,
- const BoundNetLog& net_log) override;
+ int Verify(X509Certificate* cert,
+ const std::string& hostname,
+ int flags,
+ CRLSet* crl_set,
+ CertVerifyResult* verify_result,
+ const CompletionCallback& callback,
+ CertVerifier::RequestHandle* out_req,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(CertVerifier::RequestHandle req) override;
+ void CancelRequest(CertVerifier::RequestHandle req) override;
private:
friend class CertVerifierWorker; // Calls HandleResult.
@@ -137,7 +137,7 @@
const CertVerifyResult& verify_result);
// CertDatabase::Observer methods:
- virtual void OnCACertChanged(const X509Certificate* cert) override;
+ void OnCACertChanged(const X509Certificate* cert) override;
// For unit testing.
void ClearCache() { cache_.Clear(); }
diff --git a/net/cert/multi_threaded_cert_verifier_unittest.cc b/net/cert/multi_threaded_cert_verifier_unittest.cc
index cdf9b1d..bac47b0 100644
--- a/net/cert/multi_threaded_cert_verifier_unittest.cc
+++ b/net/cert/multi_threaded_cert_verifier_unittest.cc
@@ -36,19 +36,17 @@
MockCertVerifyProc() {}
private:
- virtual ~MockCertVerifyProc() {}
+ ~MockCertVerifyProc() override {}
// CertVerifyProc implementation
- virtual bool SupportsAdditionalTrustAnchors() const override {
- return false;
- }
+ bool SupportsAdditionalTrustAnchors() const override { return false; }
- virtual int VerifyInternal(X509Certificate* cert,
- const std::string& hostname,
- int flags,
- CRLSet* crl_set,
- const CertificateList& additional_trust_anchors,
- CertVerifyResult* verify_result) override {
+ int VerifyInternal(X509Certificate* cert,
+ const std::string& hostname,
+ int flags,
+ CRLSet* crl_set,
+ const CertificateList& additional_trust_anchors,
+ CertVerifyResult* verify_result) override {
verify_result->Reset();
verify_result->verified_cert = cert;
verify_result->cert_status = CERT_STATUS_COMMON_NAME_INVALID;
diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h
index 97906ed..008de71 100644
--- a/net/cert/x509_certificate.h
+++ b/net/cert/x509_certificate.h
@@ -395,6 +395,10 @@
// the same.
static SHA1HashValue CalculateFingerprint(OSCertHandle cert_handle);
+ // Calculates the SHA-256 fingerprint of the certificate. Returns an empty
+ // (all zero) fingerprint on failure.
+ static SHA256HashValue CalculateFingerprint256(OSCertHandle cert_handle);
+
// Calculates the SHA-1 fingerprint of the intermediate CA certificates.
// Returns an empty (all zero) fingerprint on failure.
//
diff --git a/net/cert/x509_certificate_ios.cc b/net/cert/x509_certificate_ios.cc
index f59cb65..b0908b7 100644
--- a/net/cert/x509_certificate_ios.cc
+++ b/net/cert/x509_certificate_ios.cc
@@ -186,6 +186,22 @@
}
// static
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) {
+ SHA256HashValue sha256;
+ memset(sha256.data, 0, sizeof(sha256.data));
+
+ ScopedCFTypeRef<CFDataRef> cert_data(SecCertificateCopyData(cert));
+ if (!cert_data)
+ return sha256;
+ DCHECK(CFDataGetBytePtr(cert_data));
+ DCHECK_NE(0, CFDataGetLength(cert_data));
+ CC_SHA256(
+ CFDataGetBytePtr(cert_data), CFDataGetLength(cert_data), sha256.data);
+
+ return sha256;
+}
+
+// static
SHA1HashValue X509Certificate::CalculateCAFingerprint(
const OSCertHandles& intermediates) {
SHA1HashValue sha1;
diff --git a/net/cert/x509_certificate_mac.cc b/net/cert/x509_certificate_mac.cc
index 716bdd5..ecdf137 100644
--- a/net/cert/x509_certificate_mac.cc
+++ b/net/cert/x509_certificate_mac.cc
@@ -374,6 +374,24 @@
}
// static
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) {
+ SHA256HashValue sha256;
+ memset(sha256.data, 0, sizeof(sha256.data));
+
+ CSSM_DATA cert_data;
+ OSStatus status = SecCertificateGetData(cert, &cert_data);
+ if (status)
+ return sha256;
+
+ DCHECK(cert_data.Data);
+ DCHECK_NE(cert_data.Length, 0U);
+
+ CC_SHA256(cert_data.Data, cert_data.Length, sha256.data);
+
+ return sha256;
+}
+
+// static
SHA1HashValue X509Certificate::CalculateCAFingerprint(
const OSCertHandles& intermediates) {
SHA1HashValue sha1;
diff --git a/net/cert/x509_certificate_nss.cc b/net/cert/x509_certificate_nss.cc
index 9019625..a57f9ce 100644
--- a/net/cert/x509_certificate_nss.cc
+++ b/net/cert/x509_certificate_nss.cc
@@ -225,6 +225,21 @@
}
// static
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) {
+ SHA256HashValue sha256;
+ memset(sha256.data, 0, sizeof(sha256.data));
+
+ DCHECK(NULL != cert->derCert.data);
+ DCHECK_NE(0U, cert->derCert.len);
+
+ SECStatus rv = HASH_HashBuf(
+ HASH_AlgSHA256, sha256.data, cert->derCert.data, cert->derCert.len);
+ DCHECK_EQ(SECSuccess, rv);
+
+ return sha256;
+}
+
+// static
SHA1HashValue X509Certificate::CalculateCAFingerprint(
const OSCertHandles& intermediates) {
SHA1HashValue sha1;
diff --git a/net/cert/x509_certificate_openssl.cc b/net/cert/x509_certificate_openssl.cc
index 9cb0670..91501f8 100644
--- a/net/cert/x509_certificate_openssl.cc
+++ b/net/cert/x509_certificate_openssl.cc
@@ -230,6 +230,16 @@
}
// static
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) {
+ SHA256HashValue sha256;
+ unsigned int sha256_size = static_cast<unsigned int>(sizeof(sha256.data));
+ int ret = X509_digest(cert, EVP_sha256(), sha256.data, &sha256_size);
+ CHECK(ret);
+ CHECK_EQ(sha256_size, sizeof(sha256.data));
+ return sha256;
+}
+
+// static
SHA1HashValue X509Certificate::CalculateCAFingerprint(
const OSCertHandles& intermediates) {
SHA1HashValue sha1;
diff --git a/net/cert/x509_certificate_unittest.cc b/net/cert/x509_certificate_unittest.cc
index 158806e..3398510 100644
--- a/net/cert/x509_certificate_unittest.cc
+++ b/net/cert/x509_certificate_unittest.cc
@@ -11,6 +11,7 @@
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
+#include "base/strings/string_util.h"
#include "crypto/rsa_private_key.h"
#include "net/base/net_errors.h"
#include "net/base/test_data_directory.h"
@@ -323,6 +324,22 @@
paypal_null_serial, sizeof(paypal_null_serial)) == 0);
}
+TEST(X509CertificateTest, SHA256FingerprintsCorrectly) {
+ scoped_refptr<X509Certificate> google_cert(X509Certificate::CreateFromBytes(
+ reinterpret_cast<const char*>(google_der), sizeof(google_der)));
+
+ static const uint8 google_sha256_fingerprint[32] = {
+ 0x21, 0xaf, 0x58, 0x74, 0xea, 0x6b, 0xad, 0xbd, 0xe4, 0xb3, 0xb1,
+ 0xaa, 0x53, 0x32, 0x80, 0x8f, 0xbf, 0x8a, 0x24, 0x7d, 0x98, 0xec,
+ 0x7f, 0x77, 0x49, 0x38, 0x42, 0x81, 0x26, 0x7f, 0xed, 0x38};
+
+ SHA256HashValue fingerprint =
+ X509Certificate::CalculateFingerprint256(google_cert->os_cert_handle());
+
+ for (size_t i = 0; i < 32; ++i)
+ EXPECT_EQ(google_sha256_fingerprint[i], fingerprint.data[i]);
+}
+
TEST(X509CertificateTest, CAFingerprints) {
base::FilePath certs_dir = GetTestCertsDirectory();
diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc
index ab92b6f..df263d8 100644
--- a/net/cert/x509_certificate_win.cc
+++ b/net/cert/x509_certificate_win.cc
@@ -14,6 +14,7 @@
#include "base/strings/utf_string_conversions.h"
#include "crypto/capi_util.h"
#include "crypto/scoped_capi_types.h"
+#include "crypto/sha2.h"
#include "net/base/net_errors.h"
#pragma comment(lib, "crypt32.lib")
@@ -315,6 +316,24 @@
return sha1;
}
+// static
+SHA256HashValue X509Certificate::CalculateFingerprint256(OSCertHandle cert) {
+ DCHECK(NULL != cert->pbCertEncoded);
+ DCHECK_NE(0u, cert->cbCertEncoded);
+
+ SHA256HashValue sha256;
+ size_t sha256_size = sizeof(sha256.data);
+
+ // Use crypto::SHA256HashString for two reasons:
+ // * < Windows Vista does not have universal SHA-256 support.
+ // * More efficient on Windows > Vista (less overhead since non-default CSP
+ // is not needed).
+ base::StringPiece der_cert(reinterpret_cast<const char*>(cert->pbCertEncoded),
+ cert->cbCertEncoded);
+ crypto::SHA256HashString(der_cert, sha256.data, sha256_size);
+ return sha256;
+}
+
// TODO(wtc): This function is implemented with NSS low-level hash
// functions to ensure it is fast. Reimplement this function with
// CryptoAPI. May need to cache the HCRYPTPROV to reduce the overhead.
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 10a6f6b..dd64cce 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -428,10 +428,10 @@
}
// CookieMonsterTask:
- virtual void Run() override;
+ void Run() override;
protected:
- virtual ~SetCookieWithDetailsTask() {}
+ ~SetCookieWithDetailsTask() override {}
private:
GURL url_;
@@ -468,10 +468,10 @@
}
// CookieMonsterTask
- virtual void Run() override;
+ void Run() override;
protected:
- virtual ~GetAllCookiesTask() {}
+ ~GetAllCookiesTask() override {}
private:
GetCookieListCallback callback_;
@@ -503,10 +503,10 @@
}
// CookieMonsterTask:
- virtual void Run() override;
+ void Run() override;
protected:
- virtual ~GetAllCookiesForURLWithOptionsTask() {}
+ ~GetAllCookiesForURLWithOptionsTask() override {}
private:
GURL url_;
@@ -596,10 +596,10 @@
}
// DeleteTask:
- virtual int RunDeleteTask() override;
+ int RunDeleteTask() override;
protected:
- virtual ~DeleteAllTask() {}
+ ~DeleteAllTask() override {}
private:
DISALLOW_COPY_AND_ASSIGN(DeleteAllTask);
@@ -622,10 +622,10 @@
}
// DeleteTask:
- virtual int RunDeleteTask() override;
+ int RunDeleteTask() override;
protected:
- virtual ~DeleteAllCreatedBetweenTask() {}
+ ~DeleteAllCreatedBetweenTask() override {}
private:
Time delete_begin_;
@@ -650,10 +650,10 @@
}
// DeleteTask:
- virtual int RunDeleteTask() override;
+ int RunDeleteTask() override;
protected:
- virtual ~DeleteAllForHostTask() {}
+ ~DeleteAllForHostTask() override {}
private:
GURL url_;
@@ -682,10 +682,10 @@
}
// DeleteTask:
- virtual int RunDeleteTask() override;
+ int RunDeleteTask() override;
protected:
- virtual ~DeleteAllCreatedBetweenForHostTask() {}
+ ~DeleteAllCreatedBetweenForHostTask() override {}
private:
Time delete_begin_;
@@ -711,10 +711,10 @@
}
// DeleteTask:
- virtual bool RunDeleteTask() override;
+ bool RunDeleteTask() override;
protected:
- virtual ~DeleteCanonicalCookieTask() {}
+ ~DeleteCanonicalCookieTask() override {}
private:
CanonicalCookie cookie_;
@@ -742,10 +742,10 @@
}
// CookieMonsterTask:
- virtual void Run() override;
+ void Run() override;
protected:
- virtual ~SetCookieWithOptionsTask() {}
+ ~SetCookieWithOptionsTask() override {}
private:
GURL url_;
@@ -779,10 +779,10 @@
}
// CookieMonsterTask:
- virtual void Run() override;
+ void Run() override;
protected:
- virtual ~GetCookiesWithOptionsTask() {}
+ ~GetCookiesWithOptionsTask() override {}
private:
GURL url_;
@@ -814,10 +814,10 @@
}
// DeleteTask:
- virtual void RunDeleteTask() override;
+ void RunDeleteTask() override;
protected:
- virtual ~DeleteCookieTask() {}
+ ~DeleteCookieTask() override {}
private:
GURL url_;
@@ -839,10 +839,10 @@
}
// DeleteTask:
- virtual int RunDeleteTask() override;
+ int RunDeleteTask() override;
protected:
- virtual ~DeleteSessionCookiesTask() {}
+ ~DeleteSessionCookiesTask() override {}
private:
DISALLOW_COPY_AND_ASSIGN(DeleteSessionCookiesTask);
@@ -865,10 +865,10 @@
}
// CookieMonsterTask:
- virtual void Run() override;
+ void Run() override;
protected:
- virtual ~HasCookiesForETLDP1Task() {}
+ ~HasCookiesForETLDP1Task() override {}
private:
std::string etldp1_;
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 746f2a4..741c22e 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -239,38 +239,34 @@
// Sets the cookies specified by |cookie_list| returned from |url|
// with options |options| in effect.
- virtual void SetCookieWithOptionsAsync(
- const GURL& url,
- const std::string& cookie_line,
- const CookieOptions& options,
- const SetCookiesCallback& callback) override;
+ void SetCookieWithOptionsAsync(const GURL& url,
+ const std::string& cookie_line,
+ const CookieOptions& options,
+ const SetCookiesCallback& callback) override;
// Gets all cookies that apply to |url| given |options|.
// The returned cookies are ordered by longest path, then earliest
// creation date.
- virtual void GetCookiesWithOptionsAsync(
- const GURL& url,
- const CookieOptions& options,
- const GetCookiesCallback& callback) override;
+ void GetCookiesWithOptionsAsync(const GURL& url,
+ const CookieOptions& options,
+ const GetCookiesCallback& callback) override;
// Invokes GetAllCookiesForURLWithOptions with options set to include HTTP
// only cookies.
- virtual void GetAllCookiesForURLAsync(
- const GURL& url,
- const GetCookieListCallback& callback) override;
+ void GetAllCookiesForURLAsync(const GURL& url,
+ const GetCookieListCallback& callback) override;
// Deletes all cookies with that might apply to |url| that has |cookie_name|.
- virtual void DeleteCookieAsync(
- const GURL& url, const std::string& cookie_name,
- const base::Closure& callback) override;
+ void DeleteCookieAsync(const GURL& url,
+ const std::string& cookie_name,
+ const base::Closure& callback) override;
// Deletes all of the cookies that have a creation_date greater than or equal
// to |delete_begin| and less than |delete_end|.
// Returns the number of cookies that have been deleted.
- virtual void DeleteAllCreatedBetweenAsync(
- const base::Time& delete_begin,
- const base::Time& delete_end,
- const DeleteCallback& callback) override;
+ void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) override;
// Deletes all of the cookies that match the host of the given URL
// regardless of path and that have a creation_date greater than or
@@ -278,15 +274,15 @@
// all http_only and secure cookies, but does not include any domain
// cookies that may apply to this host.
// Returns the number of cookies deleted.
- virtual void DeleteAllCreatedBetweenForHostAsync(
+ void DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
const DeleteCallback& callback) override;
- virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override;
+ void DeleteSessionCookiesAsync(const DeleteCallback&) override;
- virtual CookieMonster* GetCookieMonster() override;
+ CookieMonster* GetCookieMonster() override;
// Enables writing session cookies into the cookie database. If this this
// method is called, it must be called before first use of the instance
@@ -408,7 +404,7 @@
// Record statistics every kRecordStatisticsIntervalSeconds of uptime.
static const int kRecordStatisticsIntervalSeconds = 10 * 60;
- virtual ~CookieMonster();
+ ~CookieMonster() override;
// The following are synchronous calls to which the asynchronous methods
// delegate either immediately (if the store is loaded) or through a deferred
diff --git a/net/cookies/cookie_monster_store_test.h b/net/cookies/cookie_monster_store_test.h
index c3a2827..4a3f9a9 100644
--- a/net/cookies/cookie_monster_store_test.h
+++ b/net/cookies/cookie_monster_store_test.h
@@ -82,25 +82,23 @@
return commands_;
}
- virtual void Load(const LoadedCallback& loaded_callback) override;
+ void Load(const LoadedCallback& loaded_callback) override;
- virtual void LoadCookiesForKey(const std::string& key,
- const LoadedCallback& loaded_callback) override;
+ void LoadCookiesForKey(const std::string& key,
+ const LoadedCallback& loaded_callback) override;
- virtual void AddCookie(const CanonicalCookie& cookie) override;
+ void AddCookie(const CanonicalCookie& cookie) override;
- virtual void UpdateCookieAccessTime(
- const CanonicalCookie& cookie) override;
+ void UpdateCookieAccessTime(const CanonicalCookie& cookie) override;
- virtual void DeleteCookie(
- const CanonicalCookie& cookie) override;
+ void DeleteCookie(const CanonicalCookie& cookie) override;
- virtual void Flush(const base::Closure& callback) override;
+ void Flush(const base::Closure& callback) override;
- virtual void SetForceKeepSessionState() override;
+ void SetForceKeepSessionState() override;
protected:
- virtual ~MockPersistentCookieStore();
+ ~MockPersistentCookieStore() override;
private:
CommandList commands_;
@@ -127,15 +125,14 @@
void reset() { changes_.clear(); }
- virtual void OnCookieChanged(
- const CanonicalCookie& cookie,
- bool removed,
- CookieMonsterDelegate::ChangeCause cause) override;
+ void OnCookieChanged(const CanonicalCookie& cookie,
+ bool removed,
+ CookieMonsterDelegate::ChangeCause cause) override;
- virtual void OnLoaded() override;
+ void OnLoaded() override;
private:
- virtual ~MockCookieMonsterDelegate();
+ ~MockCookieMonsterDelegate() override;
std::vector<CookieNotification> changes_;
@@ -161,23 +158,23 @@
public:
MockSimplePersistentCookieStore();
- virtual void Load(const LoadedCallback& loaded_callback) override;
+ void Load(const LoadedCallback& loaded_callback) override;
- virtual void LoadCookiesForKey(const std::string& key,
- const LoadedCallback& loaded_callback) override;
+ void LoadCookiesForKey(const std::string& key,
+ const LoadedCallback& loaded_callback) override;
- virtual void AddCookie(const CanonicalCookie& cookie) override;
+ void AddCookie(const CanonicalCookie& cookie) override;
- virtual void UpdateCookieAccessTime(const CanonicalCookie& cookie) override;
+ void UpdateCookieAccessTime(const CanonicalCookie& cookie) override;
- virtual void DeleteCookie(const CanonicalCookie& cookie) override;
+ void DeleteCookie(const CanonicalCookie& cookie) override;
- virtual void Flush(const base::Closure& callback) override;
+ void Flush(const base::Closure& callback) override;
- virtual void SetForceKeepSessionState() override;
+ void SetForceKeepSessionState() override;
protected:
- virtual ~MockSimplePersistentCookieStore();
+ ~MockSimplePersistentCookieStore() override;
private:
typedef std::map<int64, CanonicalCookie> CanonicalCookieMap;
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index 34a50bb..5c76e8a 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -2165,7 +2165,7 @@
public:
FlushablePersistentStore() : flush_count_(0) {}
- virtual void Load(const LoadedCallback& loaded_callback) override {
+ void Load(const LoadedCallback& loaded_callback) override {
std::vector<CanonicalCookie*> out_cookies;
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -2173,18 +2173,17 @@
new net::LoadedCallbackTask(loaded_callback, out_cookies)));
}
- virtual void LoadCookiesForKey(
- const std::string& key,
- const LoadedCallback& loaded_callback) override {
+ void LoadCookiesForKey(const std::string& key,
+ const LoadedCallback& loaded_callback) override {
Load(loaded_callback);
}
- virtual void AddCookie(const CanonicalCookie&) override {}
- virtual void UpdateCookieAccessTime(const CanonicalCookie&) override {}
- virtual void DeleteCookie(const CanonicalCookie&) override {}
- virtual void SetForceKeepSessionState() override {}
+ void AddCookie(const CanonicalCookie&) override {}
+ void UpdateCookieAccessTime(const CanonicalCookie&) override {}
+ void DeleteCookie(const CanonicalCookie&) override {}
+ void SetForceKeepSessionState() override {}
- virtual void Flush(const base::Closure& callback) override {
+ void Flush(const base::Closure& callback) override {
++flush_count_;
if (!callback.is_null())
callback.Run();
@@ -2195,7 +2194,7 @@
}
private:
- virtual ~FlushablePersistentStore() {}
+ ~FlushablePersistentStore() override {}
volatile int flush_count_;
};
diff --git a/net/cookies/cookie_store_test_helpers.h b/net/cookies/cookie_store_test_helpers.h
index e4e7156..2b8b245 100644
--- a/net/cookies/cookie_store_test_helpers.h
+++ b/net/cookies/cookie_store_test_helpers.h
@@ -23,20 +23,19 @@
// invoke the internal callback.
// Post a delayed task to invoke the original callback with the results.
- virtual void SetCookieWithOptionsAsync(
+ void SetCookieWithOptionsAsync(
const GURL& url,
const std::string& cookie_line,
const CookieOptions& options,
const CookieMonster::SetCookiesCallback& callback) override;
- virtual void GetCookiesWithOptionsAsync(
+ void GetCookiesWithOptionsAsync(
const GURL& url,
const CookieOptions& options,
const CookieMonster::GetCookiesCallback& callback) override;
- virtual void GetAllCookiesForURLAsync(
- const GURL& url,
- const GetCookieListCallback& callback) override;
+ void GetAllCookiesForURLAsync(const GURL& url,
+ const GetCookieListCallback& callback) override;
virtual bool SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
@@ -48,24 +47,23 @@
virtual void DeleteCookie(const GURL& url,
const std::string& cookie_name);
- virtual void DeleteCookieAsync(const GURL& url,
- const std::string& cookie_name,
- const base::Closure& callback) override;
+ void DeleteCookieAsync(const GURL& url,
+ const std::string& cookie_name,
+ const base::Closure& callback) override;
- virtual void DeleteAllCreatedBetweenAsync(
- const base::Time& delete_begin,
- const base::Time& delete_end,
- const DeleteCallback& callback) override;
+ void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) override;
- virtual void DeleteAllCreatedBetweenForHostAsync(
+ void DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
const DeleteCallback& callback) override;
- virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override;
+ void DeleteSessionCookiesAsync(const DeleteCallback&) override;
- virtual CookieMonster* GetCookieMonster() override;
+ CookieMonster* GetCookieMonster() override;
private:
@@ -84,7 +82,7 @@
const CookieMonster::GetCookiesCallback& callback);
friend class base::RefCountedThreadSafe<DelayedCookieMonster>;
- virtual ~DelayedCookieMonster();
+ ~DelayedCookieMonster() override;
scoped_refptr<CookieMonster> cookie_monster_;
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index b3b80b4..e06efd9 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -1840,10 +1840,10 @@
class BadEntropyProvider : public base::FieldTrial::EntropyProvider {
public:
- virtual ~BadEntropyProvider() {}
+ ~BadEntropyProvider() override {}
- virtual double GetEntropyForTrial(const std::string& trial_name,
- uint32 randomization_seed) const override {
+ double GetEntropyForTrial(const std::string& trial_name,
+ uint32 randomization_seed) const override {
return 0.5;
}
};
diff --git a/net/disk_cache/blockfile/backend_impl.cc b/net/disk_cache/blockfile/backend_impl.cc
index bcac374..20995b7 100644
--- a/net/disk_cache/blockfile/backend_impl.cc
+++ b/net/disk_cache/blockfile/backend_impl.cc
@@ -1254,13 +1254,13 @@
iterator_(new Rankings::Iterator()) {
}
- virtual ~IteratorImpl() {
+ ~IteratorImpl() override {
if (background_queue_)
background_queue_->EndEnumeration(iterator_.Pass());
}
- virtual int OpenNextEntry(Entry** next_entry,
- const net::CompletionCallback& callback) override {
+ int OpenNextEntry(Entry** next_entry,
+ const net::CompletionCallback& callback) override {
if (!background_queue_)
return net::ERR_FAILED;
background_queue_->OpenNextEntry(iterator_.get(), next_entry, callback);
diff --git a/net/disk_cache/blockfile/backend_impl.h b/net/disk_cache/blockfile/backend_impl.h
index e81b928..d3a81ac 100644
--- a/net/disk_cache/blockfile/backend_impl.h
+++ b/net/disk_cache/blockfile/backend_impl.h
@@ -57,7 +57,7 @@
uint32 mask,
const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread,
net::NetLog* net_log);
- virtual ~BackendImpl();
+ ~BackendImpl() override;
// Performs general initialization for this current instance of the cache.
int Init(const CompletionCallback& callback);
@@ -259,20 +259,22 @@
void FlushIndex();
// Backend implementation.
- virtual net::CacheType GetCacheType() const override;
- virtual int32 GetEntryCount() const override;
- virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) override;
- virtual int DoomAllEntries(const CompletionCallback& callback) override;
- virtual int DoomEntriesBetween(base::Time initial_time,
- base::Time end_time,
- const CompletionCallback& callback) override;
- virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) override;
+ net::CacheType GetCacheType() const override;
+ int32 GetEntryCount() const override;
+ int OpenEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int CreateEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int DoomEntry(const std::string& key,
+ const CompletionCallback& callback) override;
+ int DoomAllEntries(const CompletionCallback& callback) override;
+ int DoomEntriesBetween(base::Time initial_time,
+ base::Time end_time,
+ const CompletionCallback& callback) override;
+ int DoomEntriesSince(base::Time initial_time,
+ const CompletionCallback& callback) override;
// NOTE: The blockfile Backend::Iterator::OpenNextEntry method does not modify
// the last_used field of the entry, and therefore it does not impact the
// eviction ranking of the entry. However, an enumeration will go through all
@@ -281,9 +283,9 @@
// the iterator (for example, deleting the entry) will invalidate the
// iterator. Performing operations on an entry that modify the entry may
// result in loops in the iteration, skipped entries or similar.
- virtual scoped_ptr<Iterator> CreateIterator() override;
- virtual void GetStats(StatsItems* stats) override;
- virtual void OnExternalCacheHit(const std::string& key) override;
+ scoped_ptr<Iterator> CreateIterator() override;
+ void GetStats(StatsItems* stats) override;
+ void OnExternalCacheHit(const std::string& key) override;
private:
typedef base::hash_map<CacheAddr, EntryImpl*> EntriesMap;
diff --git a/net/disk_cache/blockfile/backend_impl_v3.cc b/net/disk_cache/blockfile/backend_impl_v3.cc
index 09794d3..a1024b4 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.cc
+++ b/net/disk_cache/blockfile/backend_impl_v3.cc
@@ -1510,8 +1510,8 @@
class BackendImplV3::NotImplementedIterator : public Backend::Iterator {
public:
- virtual int OpenNextEntry(disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) override {
+ int OpenNextEntry(disk_cache::Entry** next_entry,
+ const net::CompletionCallback& callback) override {
return net::ERR_NOT_IMPLEMENTED;
}
};
diff --git a/net/disk_cache/blockfile/backend_impl_v3.h b/net/disk_cache/blockfile/backend_impl_v3.h
index 6f4f882..45ce6ac 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.h
+++ b/net/disk_cache/blockfile/backend_impl_v3.h
@@ -50,7 +50,7 @@
BackendImplV3(const base::FilePath& path,
const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread,
net::NetLog* net_log);
- virtual ~BackendImplV3();
+ ~BackendImplV3() override;
// Performs general initialization for this current instance of the cache.
int Init(const CompletionCallback& callback);
@@ -172,23 +172,25 @@
int SelfCheck();
// Backend implementation.
- virtual net::CacheType GetCacheType() const override;
- virtual int32 GetEntryCount() const override;
- virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) override;
- virtual int DoomAllEntries(const CompletionCallback& callback) override;
- virtual int DoomEntriesBetween(base::Time initial_time,
- base::Time end_time,
- const CompletionCallback& callback) override;
- virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) override;
- virtual scoped_ptr<Iterator> CreateIterator() override;
- virtual void GetStats(StatsItems* stats) override;
- virtual void OnExternalCacheHit(const std::string& key) override;
+ net::CacheType GetCacheType() const override;
+ int32 GetEntryCount() const override;
+ int OpenEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int CreateEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int DoomEntry(const std::string& key,
+ const CompletionCallback& callback) override;
+ int DoomAllEntries(const CompletionCallback& callback) override;
+ int DoomEntriesBetween(base::Time initial_time,
+ base::Time end_time,
+ const CompletionCallback& callback) override;
+ int DoomEntriesSince(base::Time initial_time,
+ const CompletionCallback& callback) override;
+ scoped_ptr<Iterator> CreateIterator() override;
+ void GetStats(StatsItems* stats) override;
+ void OnExternalCacheHit(const std::string& key) override;
private:
friend class EvictionV3;
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc
index 2b98470..0a882de 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -44,9 +44,9 @@
entry->AddRef();
entry->IncrementIoCount();
}
- virtual ~SyncCallback() {}
+ ~SyncCallback() override {}
- virtual void OnFileIOComplete(int bytes_copied) override;
+ void OnFileIOComplete(int bytes_copied) override;
void Discard();
private:
diff --git a/net/disk_cache/blockfile/entry_impl.h b/net/disk_cache/blockfile/entry_impl.h
index fea815d..1dc7ed5 100644
--- a/net/disk_cache/blockfile/entry_impl.h
+++ b/net/disk_cache/blockfile/entry_impl.h
@@ -147,26 +147,38 @@
static int NumBlocksForEntry(int key_size);
// Entry interface.
- virtual void Doom() override;
- virtual void Close() override;
- virtual std::string GetKey() const override;
- virtual base::Time GetLastUsed() const override;
- virtual base::Time GetLastModified() const override;
- virtual int32 GetDataSize(int index) const override;
- virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback,
- bool truncate) override;
- virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const CompletionCallback& callback) override;
- virtual bool CouldBeSparse() const override;
- virtual void CancelSparseIO() override;
- virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
+ void Doom() override;
+ void Close() override;
+ std::string GetKey() const override;
+ base::Time GetLastUsed() const override;
+ base::Time GetLastModified() const override;
+ int32 GetDataSize(int index) const override;
+ int ReadData(int index,
+ int offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteData(int index,
+ int offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback,
+ bool truncate) override;
+ int ReadSparseData(int64 offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteSparseData(int64 offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int GetAvailableRange(int64 offset,
+ int len,
+ int64* start,
+ const CompletionCallback& callback) override;
+ bool CouldBeSparse() const override;
+ void CancelSparseIO() override;
+ int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
enum {
@@ -174,7 +186,7 @@
};
class UserBuffer;
- virtual ~EntryImpl();
+ ~EntryImpl() override;
// Do all the work for ReadDataImpl and WriteDataImpl. Implemented as
// separate functions to make logging of results simpler.
diff --git a/net/disk_cache/blockfile/entry_impl_v3.h b/net/disk_cache/blockfile/entry_impl_v3.h
index 4215000..c693c2a 100644
--- a/net/disk_cache/blockfile/entry_impl_v3.h
+++ b/net/disk_cache/blockfile/entry_impl_v3.h
@@ -77,26 +77,38 @@
const net::BoundNetLog& net_log() const;
// Entry interface.
- virtual void Doom() override;
- virtual void Close() override;
- virtual std::string GetKey() const override;
- virtual base::Time GetLastUsed() const override;
- virtual base::Time GetLastModified() const override;
- virtual int32 GetDataSize(int index) const override;
- virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback,
- bool truncate) override;
- virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const CompletionCallback& callback) override;
- virtual bool CouldBeSparse() const override;
- virtual void CancelSparseIO() override;
- virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
+ void Doom() override;
+ void Close() override;
+ std::string GetKey() const override;
+ base::Time GetLastUsed() const override;
+ base::Time GetLastModified() const override;
+ int32 GetDataSize(int index) const override;
+ int ReadData(int index,
+ int offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteData(int index,
+ int offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback,
+ bool truncate) override;
+ int ReadSparseData(int64 offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteSparseData(int64 offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int GetAvailableRange(int64 offset,
+ int len,
+ int64* start,
+ const CompletionCallback& callback) override;
+ bool CouldBeSparse() const override;
+ void CancelSparseIO() override;
+ int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
enum {
@@ -104,7 +116,7 @@
};
class UserBuffer;
- virtual ~EntryImplV3();
+ ~EntryImplV3() override;
// Do all the work for ReadDataImpl and WriteDataImpl. Implemented as
// separate functions to make logging of results simpler.
diff --git a/net/disk_cache/blockfile/file_posix.cc b/net/disk_cache/blockfile/file_posix.cc
index c451aa3..828673f 100644
--- a/net/disk_cache/blockfile/file_posix.cc
+++ b/net/disk_cache/blockfile/file_posix.cc
@@ -24,7 +24,7 @@
FileWorkerPool() : base::SequencedWorkerPool(kMaxThreads, "CachePool") {}
protected:
- virtual ~FileWorkerPool() {}
+ ~FileWorkerPool() override {}
};
base::LazyInstance<FileWorkerPool>::Leaky s_worker_pool =
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.h b/net/disk_cache/blockfile/in_flight_backend_io.h
index 4b10405..e2fa4e7 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.h
+++ b/net/disk_cache/blockfile/in_flight_backend_io.h
@@ -107,7 +107,7 @@
OP_IS_READY
};
- virtual ~BackendIO();
+ ~BackendIO() override;
// Returns true if this operation returns an entry.
bool ReturnsEntry();
@@ -149,7 +149,7 @@
InFlightBackendIO(
BackendImpl* backend,
const scoped_refptr<base::SingleThreadTaskRunner>& background_thread);
- virtual ~InFlightBackendIO();
+ ~InFlightBackendIO() override;
// Proxied operations.
void Init(const net::CompletionCallback& callback);
@@ -204,8 +204,7 @@
base::WeakPtr<InFlightBackendIO> GetWeakPtr();
protected:
- virtual void OnOperationComplete(BackgroundIO* operation,
- bool cancel) override;
+ void OnOperationComplete(BackgroundIO* operation, bool cancel) override;
private:
void PostOperation(BackendIO* operation);
diff --git a/net/disk_cache/blockfile/index_table_v3_unittest.cc b/net/disk_cache/blockfile/index_table_v3_unittest.cc
index 7f68ee3..ee48951 100644
--- a/net/disk_cache/blockfile/index_table_v3_unittest.cc
+++ b/net/disk_cache/blockfile/index_table_v3_unittest.cc
@@ -30,17 +30,17 @@
class MockIndexBackend : public disk_cache::IndexTableBackend {
public:
MockIndexBackend() : grow_called_(false), buffer_len_(-1) {}
- virtual ~MockIndexBackend() {}
+ ~MockIndexBackend() override {}
bool grow_called() const { return grow_called_; }
int buffer_len() const { return buffer_len_; }
- virtual void GrowIndex() override { grow_called_ = true; }
- virtual void SaveIndex(net::IOBuffer* buffer, int buffer_len) override {
+ void GrowIndex() override { grow_called_ = true; }
+ void SaveIndex(net::IOBuffer* buffer, int buffer_len) override {
buffer_len_ = buffer_len;
}
- virtual void DeleteCell(EntryCell cell) override {}
- virtual void FixCell(EntryCell cell) override {}
+ void DeleteCell(EntryCell cell) override {}
+ void FixCell(EntryCell cell) override {}
private:
bool grow_called_;
diff --git a/net/disk_cache/blockfile/mapped_file.h b/net/disk_cache/blockfile/mapped_file.h
index f0efa41..7634cb7 100644
--- a/net/disk_cache/blockfile/mapped_file.h
+++ b/net/disk_cache/blockfile/mapped_file.h
@@ -51,7 +51,7 @@
bool Preload();
private:
- virtual ~MappedFile();
+ ~MappedFile() override;
bool init_;
#if defined(OS_WIN)
diff --git a/net/disk_cache/blockfile/mapped_file_unittest.cc b/net/disk_cache/blockfile/mapped_file_unittest.cc
index 8093e9a..9b31d6d 100644
--- a/net/disk_cache/blockfile/mapped_file_unittest.cc
+++ b/net/disk_cache/blockfile/mapped_file_unittest.cc
@@ -21,9 +21,9 @@
helper_(helper),
max_id_(max_id) {
}
- virtual ~FileCallbackTest() {}
+ ~FileCallbackTest() override {}
- virtual void OnFileIOComplete(int bytes_copied) override;
+ void OnFileIOComplete(int bytes_copied) override;
private:
int id_;
@@ -45,12 +45,12 @@
TestFileBlock() {
CacheTestFillBuffer(buffer_, sizeof(buffer_), false);
}
- virtual ~TestFileBlock() {}
+ ~TestFileBlock() override {}
// FileBlock interface.
- virtual void* buffer() const override { return const_cast<char*>(buffer_); }
- virtual size_t size() const override { return sizeof(buffer_); }
- virtual int offset() const override { return 1024; }
+ void* buffer() const override { return const_cast<char*>(buffer_); }
+ size_t size() const override { return sizeof(buffer_); }
+ int offset() const override { return 1024; }
private:
char buffer_[20];
diff --git a/net/disk_cache/blockfile/sparse_control.cc b/net/disk_cache/blockfile/sparse_control.cc
index ddb57b6..30ea836 100644
--- a/net/disk_cache/blockfile/sparse_control.cc
+++ b/net/disk_cache/blockfile/sparse_control.cc
@@ -56,7 +56,7 @@
ChildrenDeleter(disk_cache::BackendImpl* backend, const std::string& name)
: backend_(backend->GetWeakPtr()), name_(name), signature_(0) {}
- virtual void OnFileIOComplete(int bytes_copied) override;
+ 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().
@@ -65,7 +65,7 @@
private:
friend class base::RefCounted<ChildrenDeleter>;
- virtual ~ChildrenDeleter() {}
+ ~ChildrenDeleter() override {}
void DeleteChildren();
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc
index a3a7747..6081137 100644
--- a/net/disk_cache/entry_unittest.cc
+++ b/net/disk_cache/entry_unittest.cc
@@ -2063,7 +2063,7 @@
}
private:
- virtual void SetResult(int result) override {
+ void SetResult(int result) override {
cache_.reset();
TestCompletionCallback::SetResult(result);
}
diff --git a/net/disk_cache/memory/mem_backend_impl.cc b/net/disk_cache/memory/mem_backend_impl.cc
index 046623f..cc33a00 100644
--- a/net/disk_cache/memory/mem_backend_impl.cc
+++ b/net/disk_cache/memory/mem_backend_impl.cc
@@ -187,8 +187,8 @@
: backend_(backend), current_(NULL) {
}
- virtual int OpenNextEntry(Entry** next_entry,
- const CompletionCallback& callback) override {
+ int OpenNextEntry(Entry** next_entry,
+ const CompletionCallback& callback) override {
if (!backend_)
return net::ERR_FAILED;
diff --git a/net/disk_cache/memory/mem_backend_impl.h b/net/disk_cache/memory/mem_backend_impl.h
index 46505ea..7b18ca0 100644
--- a/net/disk_cache/memory/mem_backend_impl.h
+++ b/net/disk_cache/memory/mem_backend_impl.h
@@ -26,7 +26,7 @@
class NET_EXPORT_PRIVATE MemBackendImpl : public Backend {
public:
explicit MemBackendImpl(net::NetLog* net_log);
- virtual ~MemBackendImpl();
+ ~MemBackendImpl() override;
// Returns an instance of a Backend implemented only in memory. The returned
// object should be deleted when not needed anymore. max_bytes is the maximum
@@ -63,24 +63,26 @@
void RemoveFromRankingList(MemEntryImpl* entry);
// Backend interface.
- virtual net::CacheType GetCacheType() const override;
- virtual int32 GetEntryCount() const override;
- virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) override;
- virtual int DoomAllEntries(const CompletionCallback& callback) override;
- virtual int DoomEntriesBetween(base::Time initial_time,
- base::Time end_time,
- const CompletionCallback& callback) override;
- virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) override;
- virtual scoped_ptr<Iterator> CreateIterator() override;
- virtual void GetStats(
- std::vector<std::pair<std::string, std::string> >* stats) override {}
- virtual void OnExternalCacheHit(const std::string& key) override;
+ net::CacheType GetCacheType() const override;
+ int32 GetEntryCount() const override;
+ int OpenEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int CreateEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int DoomEntry(const std::string& key,
+ const CompletionCallback& callback) override;
+ int DoomAllEntries(const CompletionCallback& callback) override;
+ int DoomEntriesBetween(base::Time initial_time,
+ base::Time end_time,
+ const CompletionCallback& callback) override;
+ int DoomEntriesSince(base::Time initial_time,
+ const CompletionCallback& callback) override;
+ scoped_ptr<Iterator> CreateIterator() override;
+ void GetStats(
+ std::vector<std::pair<std::string, std::string>>* stats) override {}
+ void OnExternalCacheHit(const std::string& key) override;
private:
class MemIterator;
diff --git a/net/disk_cache/memory/mem_entry_impl.h b/net/disk_cache/memory/mem_entry_impl.h
index d31e14a..0d9acbe 100644
--- a/net/disk_cache/memory/mem_entry_impl.h
+++ b/net/disk_cache/memory/mem_entry_impl.h
@@ -87,26 +87,38 @@
}
// Entry interface.
- virtual void Doom() override;
- virtual void Close() override;
- virtual std::string GetKey() const override;
- virtual base::Time GetLastUsed() const override;
- virtual base::Time GetLastModified() const override;
- virtual int32 GetDataSize(int index) const override;
- virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback,
- bool truncate) override;
- virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const CompletionCallback& callback) override;
- virtual bool CouldBeSparse() const override;
- virtual void CancelSparseIO() override {}
- virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
+ void Doom() override;
+ void Close() override;
+ std::string GetKey() const override;
+ base::Time GetLastUsed() const override;
+ base::Time GetLastModified() const override;
+ int32 GetDataSize(int index) const override;
+ int ReadData(int index,
+ int offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteData(int index,
+ int offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback,
+ bool truncate) override;
+ int ReadSparseData(int64 offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteSparseData(int64 offset,
+ IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int GetAvailableRange(int64 offset,
+ int len,
+ int64* start,
+ const CompletionCallback& callback) override;
+ bool CouldBeSparse() const override;
+ void CancelSparseIO() override {}
+ int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
typedef base::hash_map<int, MemEntryImpl*> EntryMap;
@@ -115,7 +127,7 @@
NUM_STREAMS = 3
};
- virtual ~MemEntryImpl();
+ ~MemEntryImpl() override;
// Do all the work for corresponding public functions. Implemented as
// separate functions to make logging of results simpler.
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 32b074a..6385a37 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -198,7 +198,7 @@
class SimpleBackendImpl::ActiveEntryProxy
: public SimpleEntryImpl::ActiveEntryProxy {
public:
- virtual ~ActiveEntryProxy() {
+ ~ActiveEntryProxy() override {
if (backend_) {
DCHECK_EQ(1U, backend_->active_entries_.count(entry_hash_));
backend_->active_entries_.erase(entry_hash_);
@@ -475,8 +475,8 @@
}
// From Backend::Iterator:
- virtual int OpenNextEntry(Entry** next_entry,
- const CompletionCallback& callback) override {
+ int OpenNextEntry(Entry** next_entry,
+ const CompletionCallback& callback) override {
CompletionCallback open_next_entry_impl =
base::Bind(&SimpleIterator::OpenNextEntryImpl,
weak_factory_.GetWeakPtr(), next_entry, callback);
diff --git a/net/disk_cache/simple/simple_backend_impl.h b/net/disk_cache/simple/simple_backend_impl.h
index e5a50da..503fc49 100644
--- a/net/disk_cache/simple/simple_backend_impl.h
+++ b/net/disk_cache/simple/simple_backend_impl.h
@@ -56,7 +56,7 @@
const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread,
net::NetLog* net_log);
- virtual ~SimpleBackendImpl();
+ ~SimpleBackendImpl() override;
net::CacheType cache_type() const { return cache_type_; }
SimpleIndex* index() { return index_.get(); }
@@ -84,28 +84,30 @@
void OnDoomComplete(uint64 entry_hash);
// SimpleIndexDelegate:
- virtual void DoomEntries(std::vector<uint64>* entry_hashes,
- const CompletionCallback& callback) override;
+ void DoomEntries(std::vector<uint64>* entry_hashes,
+ const CompletionCallback& callback) override;
// Backend:
- virtual net::CacheType GetCacheType() const override;
- virtual int32 GetEntryCount() const override;
- virtual int OpenEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int CreateEntry(const std::string& key, Entry** entry,
- const CompletionCallback& callback) override;
- virtual int DoomEntry(const std::string& key,
- const CompletionCallback& callback) override;
- virtual int DoomAllEntries(const CompletionCallback& callback) override;
- virtual int DoomEntriesBetween(base::Time initial_time,
- base::Time end_time,
- const CompletionCallback& callback) override;
- virtual int DoomEntriesSince(base::Time initial_time,
- const CompletionCallback& callback) override;
- virtual scoped_ptr<Iterator> CreateIterator() override;
- virtual void GetStats(
- std::vector<std::pair<std::string, std::string> >* stats) override;
- virtual void OnExternalCacheHit(const std::string& key) override;
+ net::CacheType GetCacheType() const override;
+ int32 GetEntryCount() const override;
+ int OpenEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int CreateEntry(const std::string& key,
+ Entry** entry,
+ const CompletionCallback& callback) override;
+ int DoomEntry(const std::string& key,
+ const CompletionCallback& callback) override;
+ int DoomAllEntries(const CompletionCallback& callback) override;
+ int DoomEntriesBetween(base::Time initial_time,
+ base::Time end_time,
+ const CompletionCallback& callback) override;
+ int DoomEntriesSince(base::Time initial_time,
+ const CompletionCallback& callback) override;
+ scoped_ptr<Iterator> CreateIterator() override;
+ void GetStats(
+ std::vector<std::pair<std::string, std::string>>* stats) override;
+ void OnExternalCacheHit(const std::string& key) override;
private:
class SimpleIterator;
diff --git a/net/disk_cache/simple/simple_entry_impl.h b/net/disk_cache/simple/simple_entry_impl.h
index 7c11b96..ebc6bf1 100644
--- a/net/disk_cache/simple/simple_entry_impl.h
+++ b/net/disk_cache/simple/simple_entry_impl.h
@@ -80,38 +80,38 @@
void SetKey(const std::string& key);
// From Entry:
- virtual void Doom() override;
- virtual void Close() override;
- virtual std::string GetKey() const override;
- virtual base::Time GetLastUsed() const override;
- virtual base::Time GetLastModified() const override;
- virtual int32 GetDataSize(int index) const override;
- virtual int ReadData(int stream_index,
- int offset,
- net::IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteData(int stream_index,
- int offset,
- net::IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback,
- bool truncate) override;
- virtual int ReadSparseData(int64 offset,
- net::IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int WriteSparseData(int64 offset,
- net::IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int GetAvailableRange(int64 offset,
- int len,
- int64* start,
- const CompletionCallback& callback) override;
- virtual bool CouldBeSparse() const override;
- virtual void CancelSparseIO() override;
- virtual int ReadyForSparseIO(const CompletionCallback& callback) override;
+ void Doom() override;
+ void Close() override;
+ std::string GetKey() const override;
+ base::Time GetLastUsed() const override;
+ base::Time GetLastModified() const override;
+ int32 GetDataSize(int index) const override;
+ int ReadData(int stream_index,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteData(int stream_index,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback,
+ bool truncate) override;
+ int ReadSparseData(int64 offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int WriteSparseData(int64 offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int GetAvailableRange(int64 offset,
+ int len,
+ int64* start,
+ const CompletionCallback& callback) override;
+ bool CouldBeSparse() const override;
+ void CancelSparseIO() override;
+ int ReadyForSparseIO(const CompletionCallback& callback) override;
private:
class ScopedOperationRunner;
@@ -144,7 +144,7 @@
CRC_CHECK_MAX = 4,
};
- virtual ~SimpleEntryImpl();
+ ~SimpleEntryImpl() override;
// Must be used to invoke a client-provided completion callback for an
// operation initiated through the backend (e.g. create, open) so that clients
diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc
index 19ea0f8..49eb8fb 100644
--- a/net/disk_cache/simple/simple_index_file_unittest.cc
+++ b/net/disk_cache/simple/simple_index_file_unittest.cc
@@ -79,8 +79,7 @@
base::ThreadTaskRunnerHandle::Get(),
net::DISK_CACHE,
index_file_directory) {}
- virtual ~WrappedSimpleIndexFile() {
- }
+ ~WrappedSimpleIndexFile() override {}
const base::FilePath& GetIndexFilePath() const {
return index_file_;
diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc
index 43e99ad..dc63989 100644
--- a/net/disk_cache/simple/simple_index_unittest.cc
+++ b/net/disk_cache/simple/simple_index_unittest.cc
@@ -57,19 +57,18 @@
load_index_entries_calls_(0),
disk_writes_(0) {}
- virtual void LoadIndexEntries(
- base::Time cache_last_modified,
- const base::Closure& callback,
- SimpleIndexLoadResult* out_load_result) override {
+ void LoadIndexEntries(base::Time cache_last_modified,
+ const base::Closure& callback,
+ SimpleIndexLoadResult* out_load_result) override {
load_callback_ = callback;
load_result_ = out_load_result;
++load_index_entries_calls_;
}
- virtual void WriteToDisk(const SimpleIndex::EntrySet& entry_set,
- uint64 cache_size,
- const base::TimeTicks& start,
- bool app_on_background) override {
+ void WriteToDisk(const SimpleIndex::EntrySet& entry_set,
+ uint64 cache_size,
+ const base::TimeTicks& start,
+ bool app_on_background) override {
disk_writes_++;
disk_write_entry_set_ = entry_set;
}
@@ -120,8 +119,8 @@
}
// From SimpleIndexDelegate:
- virtual void DoomEntries(std::vector<uint64>* entry_hashes,
- const net::CompletionCallback& callback) override {
+ void DoomEntries(std::vector<uint64>* entry_hashes,
+ const net::CompletionCallback& callback) override {
std::for_each(entry_hashes->begin(), entry_hashes->end(),
std::bind1st(std::mem_fun(&SimpleIndex::Remove),
index_.get()));
diff --git a/net/dns/address_sorter_posix.h b/net/dns/address_sorter_posix.h
index ce3ffdb..cae787f 100644
--- a/net/dns/address_sorter_posix.h
+++ b/net/dns/address_sorter_posix.h
@@ -61,17 +61,17 @@
typedef std::map<IPAddressNumber, SourceAddressInfo> SourceAddressMap;
explicit AddressSorterPosix(ClientSocketFactory* socket_factory);
- virtual ~AddressSorterPosix();
+ ~AddressSorterPosix() override;
// AddressSorter:
- virtual void Sort(const AddressList& list,
- const CallbackType& callback) const override;
+ void Sort(const AddressList& list,
+ const CallbackType& callback) const override;
private:
friend class AddressSorterPosixTest;
// NetworkChangeNotifier::IPAddressObserver:
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
// Fills |info| with values for |address| from policy tables.
void FillPolicy(const IPAddressNumber& address,
diff --git a/net/dns/address_sorter_posix_unittest.cc b/net/dns/address_sorter_posix_unittest.cc
index 9039850..5dcfe70 100644
--- a/net/dns/address_sorter_posix_unittest.cc
+++ b/net/dns/address_sorter_posix_unittest.cc
@@ -33,36 +33,32 @@
explicit TestUDPClientSocket(const AddressMapping* mapping)
: mapping_(mapping), connected_(false) {}
- virtual ~TestUDPClientSocket() {}
+ ~TestUDPClientSocket() override {}
- virtual int Read(IOBuffer*, int, const CompletionCallback&) override {
+ int Read(IOBuffer*, int, const CompletionCallback&) override {
NOTIMPLEMENTED();
return OK;
}
- virtual int Write(IOBuffer*, int, const CompletionCallback&) override {
+ int Write(IOBuffer*, int, const CompletionCallback&) override {
NOTIMPLEMENTED();
return OK;
}
- virtual int SetReceiveBufferSize(int32) override {
- return OK;
- }
- virtual int SetSendBufferSize(int32) override {
- return OK;
- }
+ int SetReceiveBufferSize(int32) override { return OK; }
+ int SetSendBufferSize(int32) override { return OK; }
- virtual void Close() override {}
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ void Close() override {}
+ int GetPeerAddress(IPEndPoint* address) const override {
NOTIMPLEMENTED();
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
if (!connected_)
return ERR_UNEXPECTED;
*address = local_endpoint_;
return OK;
}
- virtual int Connect(const IPEndPoint& remote) override {
+ int Connect(const IPEndPoint& remote) override {
if (connected_)
return ERR_UNEXPECTED;
AddressMapping::const_iterator it = mapping_->find(remote.address());
@@ -73,9 +69,7 @@
return OK;
}
- virtual const BoundNetLog& NetLog() const override {
- return net_log_;
- }
+ const BoundNetLog& NetLog() const override { return net_log_; }
private:
BoundNetLog net_log_;
@@ -90,23 +84,23 @@
class TestSocketFactory : public ClientSocketFactory {
public:
TestSocketFactory() {}
- virtual ~TestSocketFactory() {}
+ ~TestSocketFactory() override {}
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType,
const RandIntCallback&,
NetLog*,
const NetLog::Source&) override {
return scoped_ptr<DatagramClientSocket>(new TestUDPClientSocket(&mapping_));
}
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList&,
NetLog*,
const NetLog::Source&) override {
NOTIMPLEMENTED();
return scoped_ptr<StreamSocket>();
}
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle>,
const HostPortPair&,
const SSLConfig&,
@@ -114,9 +108,7 @@
NOTIMPLEMENTED();
return scoped_ptr<SSLClientSocket>();
}
- virtual void ClearSSLSessionCache() override {
- NOTIMPLEMENTED();
- }
+ void ClearSSLSessionCache() override { NOTIMPLEMENTED(); }
void AddMapping(const IPAddressNumber& dst, const IPAddressNumber& src) {
mapping_[dst] = src;
diff --git a/net/dns/dns_client.cc b/net/dns/dns_client.cc
index de96c02..f3980df 100644
--- a/net/dns/dns_client.cc
+++ b/net/dns/dns_client.cc
@@ -24,7 +24,7 @@
: address_sorter_(AddressSorter::CreateAddressSorter()),
net_log_(net_log) {}
- virtual void SetConfig(const DnsConfig& config) override {
+ void SetConfig(const DnsConfig& config) override {
factory_.reset();
session_ = NULL;
if (config.IsValid() && !config.unhandled_options) {
@@ -40,17 +40,15 @@
}
}
- virtual const DnsConfig* GetConfig() const override {
+ const DnsConfig* GetConfig() const override {
return session_.get() ? &session_->config() : NULL;
}
- virtual DnsTransactionFactory* GetTransactionFactory() override {
+ DnsTransactionFactory* GetTransactionFactory() override {
return session_.get() ? factory_.get() : NULL;
}
- virtual AddressSorter* GetAddressSorter() override {
- return address_sorter_.get();
- }
+ AddressSorter* GetAddressSorter() override { return address_sorter_.get(); }
private:
scoped_refptr<DnsSession> session_;
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
index c0664eb..6b79f9c 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -263,7 +263,7 @@
explicit ConfigReader(DnsConfigServicePosix* service)
: service_(service), success_(false) {}
- virtual void DoWork() override {
+ void DoWork() override {
base::TimeTicks start_time = base::TimeTicks::Now();
ConfigParsePosixResult result = ReadDnsConfig(&dns_config_);
switch (result) {
@@ -285,7 +285,7 @@
base::TimeTicks::Now() - start_time);
}
- virtual void OnWorkFinished() override {
+ void OnWorkFinished() override {
DCHECK(!IsCancelled());
if (success_) {
service_->OnConfigRead(dns_config_);
@@ -295,7 +295,7 @@
}
private:
- virtual ~ConfigReader() {}
+ ~ConfigReader() override {}
DnsConfigServicePosix* service_;
// Written in DoWork, read in OnWorkFinished, no locking necessary.
@@ -312,9 +312,9 @@
: service_(service), path_(kFilePathHosts), success_(false) {}
private:
- virtual ~HostsReader() {}
+ ~HostsReader() override {}
- virtual void DoWork() override {
+ void DoWork() override {
base::TimeTicks start_time = base::TimeTicks::Now();
success_ = ParseHostsFile(path_, &hosts_);
UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostParseResult", success_);
@@ -322,7 +322,7 @@
base::TimeTicks::Now() - start_time);
}
- virtual void OnWorkFinished() override {
+ void OnWorkFinished() override {
if (success_) {
service_->OnHostsRead(hosts_);
} else {
diff --git a/net/dns/dns_config_service_posix.h b/net/dns/dns_config_service_posix.h
index 598d6ad..349c82d 100644
--- a/net/dns/dns_config_service_posix.h
+++ b/net/dns/dns_config_service_posix.h
@@ -23,12 +23,12 @@
class NET_EXPORT_PRIVATE DnsConfigServicePosix : public DnsConfigService {
public:
DnsConfigServicePosix();
- virtual ~DnsConfigServicePosix();
+ ~DnsConfigServicePosix() override;
protected:
// DnsConfigService:
- virtual void ReadNow() override;
- virtual bool StartWatching() override;
+ void ReadNow() override;
+ bool StartWatching() override;
private:
class Watcher;
diff --git a/net/dns/dns_config_service_unittest.cc b/net/dns/dns_config_service_unittest.cc
index 0239f80..74020c8 100644
--- a/net/dns/dns_config_service_unittest.cc
+++ b/net/dns/dns_config_service_unittest.cc
@@ -121,8 +121,8 @@
protected:
class TestDnsConfigService : public DnsConfigService {
public:
- virtual void ReadNow() override {}
- virtual bool StartWatching() override { return true; }
+ void ReadNow() override {}
+ bool StartWatching() override { return true; }
// Expose the protected methods to this test suite.
void InvalidateConfig() {
diff --git a/net/dns/dns_session_unittest.cc b/net/dns/dns_session_unittest.cc
index 166abef..67080ca 100644
--- a/net/dns/dns_session_unittest.cc
+++ b/net/dns/dns_session_unittest.cc
@@ -24,22 +24,23 @@
class TestClientSocketFactory : public ClientSocketFactory {
public:
- virtual ~TestClientSocketFactory();
+ ~TestClientSocketFactory() override;
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
net::NetLog* net_log,
const net::NetLog::Source& source) override;
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
- NetLog*, const NetLog::Source&) override {
+ NetLog*,
+ const NetLog::Source&) override {
NOTIMPLEMENTED();
return scoped_ptr<StreamSocket>();
}
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
@@ -48,9 +49,7 @@
return scoped_ptr<SSLClientSocket>();
}
- virtual void ClearSSLSessionCache() override {
- NOTIMPLEMENTED();
- }
+ void ClearSSLSessionCache() override { NOTIMPLEMENTED(); }
private:
std::list<SocketDataProvider*> data_providers_;
@@ -88,23 +87,21 @@
MockDnsSocketPool(ClientSocketFactory* factory, DnsSessionTest* test)
: DnsSocketPool(factory), test_(test) { }
- virtual ~MockDnsSocketPool() { }
+ ~MockDnsSocketPool() override {}
- virtual void Initialize(
- const std::vector<IPEndPoint>* nameservers,
- NetLog* net_log) override {
+ void Initialize(const std::vector<IPEndPoint>* nameservers,
+ NetLog* net_log) override {
InitializeInternal(nameservers, net_log);
}
- virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
+ scoped_ptr<DatagramClientSocket> AllocateSocket(
unsigned server_index) override {
test_->OnSocketAllocated(server_index);
return CreateConnectedSocket(server_index);
}
- virtual void FreeSocket(
- unsigned server_index,
- scoped_ptr<DatagramClientSocket> socket) override {
+ void FreeSocket(unsigned server_index,
+ scoped_ptr<DatagramClientSocket> socket) override {
test_->OnSocketFreed(server_index);
}
diff --git a/net/dns/dns_socket_pool.cc b/net/dns/dns_socket_pool.cc
index 09aca5a..2c3c8c2 100644
--- a/net/dns/dns_socket_pool.cc
+++ b/net/dns/dns_socket_pool.cc
@@ -95,21 +95,18 @@
: DnsSocketPool(factory) {
}
- virtual void Initialize(
- const std::vector<IPEndPoint>* nameservers,
- NetLog* net_log) override {
+ void Initialize(const std::vector<IPEndPoint>* nameservers,
+ NetLog* net_log) override {
InitializeInternal(nameservers, net_log);
}
- virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
+ scoped_ptr<DatagramClientSocket> AllocateSocket(
unsigned server_index) override {
return CreateConnectedSocket(server_index);
}
- virtual void FreeSocket(
- unsigned server_index,
- scoped_ptr<DatagramClientSocket> socket) override {
- }
+ void FreeSocket(unsigned server_index,
+ scoped_ptr<DatagramClientSocket> socket) override {}
private:
DISALLOW_COPY_AND_ASSIGN(NullDnsSocketPool);
@@ -127,18 +124,16 @@
: DnsSocketPool(factory) {
};
- virtual ~DefaultDnsSocketPool();
+ ~DefaultDnsSocketPool() override;
- virtual void Initialize(
- const std::vector<IPEndPoint>* nameservers,
- NetLog* net_log) override;
+ void Initialize(const std::vector<IPEndPoint>* nameservers,
+ NetLog* net_log) override;
- virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
+ scoped_ptr<DatagramClientSocket> AllocateSocket(
unsigned server_index) override;
- virtual void FreeSocket(
- unsigned server_index,
- scoped_ptr<DatagramClientSocket> socket) override;
+ void FreeSocket(unsigned server_index,
+ scoped_ptr<DatagramClientSocket> socket) override;
private:
void FillPool(unsigned server_index, unsigned size);
diff --git a/net/dns/dns_test_util.cc b/net/dns/dns_test_util.cc
index 6327ed2..aee3ba7 100644
--- a/net/dns/dns_test_util.cc
+++ b/net/dns/dns_test_util.cc
@@ -25,9 +25,9 @@
class MockAddressSorter : public AddressSorter {
public:
- virtual ~MockAddressSorter() {}
- virtual void Sort(const AddressList& list,
- const CallbackType& callback) const override {
+ ~MockAddressSorter() override {}
+ void Sort(const AddressList& list,
+ const CallbackType& callback) const override {
// Do nothing.
callback.Run(true, list);
}
@@ -166,9 +166,9 @@
explicit MockTransactionFactory(const MockDnsClientRuleList& rules)
: rules_(rules) {}
- virtual ~MockTransactionFactory() {}
+ ~MockTransactionFactory() override {}
- virtual scoped_ptr<DnsTransaction> CreateTransaction(
+ scoped_ptr<DnsTransaction> CreateTransaction(
const std::string& hostname,
uint16 qtype,
const DnsTransactionFactory::CallbackType& callback,
diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h
index 5b363c7..e168afc 100644
--- a/net/dns/dns_test_util.h
+++ b/net/dns/dns_test_util.h
@@ -208,13 +208,13 @@
class MockDnsClient : public DnsClient {
public:
MockDnsClient(const DnsConfig& config, const MockDnsClientRuleList& rules);
- virtual ~MockDnsClient();
+ ~MockDnsClient() override;
// DnsClient interface:
- virtual void SetConfig(const DnsConfig& config) override;
- virtual const DnsConfig* GetConfig() const override;
- virtual DnsTransactionFactory* GetTransactionFactory() override;
- virtual AddressSorter* GetAddressSorter() override;
+ void SetConfig(const DnsConfig& config) override;
+ const DnsConfig* GetConfig() const override;
+ DnsTransactionFactory* GetTransactionFactory() override;
+ AddressSorter* GetAddressSorter() override;
// Completes all DnsTransactions that were delayed by a rule.
void CompleteDelayedTransactions();
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 32b5602..03eb7f2 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -141,7 +141,7 @@
query_(query.Pass()) {}
// DnsAttempt:
- virtual int Start(const CompletionCallback& callback) override {
+ int Start(const CompletionCallback& callback) override {
DCHECK_EQ(STATE_NONE, next_state_);
callback_ = callback;
start_time_ = base::TimeTicks::Now();
@@ -149,16 +149,14 @@
return DoLoop(OK);
}
- virtual const DnsQuery* GetQuery() const override {
- return query_.get();
- }
+ const DnsQuery* GetQuery() const override { return query_.get(); }
- virtual const DnsResponse* GetResponse() const override {
+ const DnsResponse* GetResponse() const override {
const DnsResponse* resp = response_.get();
return (resp != NULL && resp->IsValid()) ? resp : NULL;
}
- virtual const BoundNetLog& GetSocketNetLog() const override {
+ const BoundNetLog& GetSocketNetLog() const override {
return socket_lease_->socket()->NetLog();
}
@@ -306,7 +304,7 @@
response_length_(0) {}
// DnsAttempt:
- virtual int Start(const CompletionCallback& callback) override {
+ int Start(const CompletionCallback& callback) override {
DCHECK_EQ(STATE_NONE, next_state_);
callback_ = callback;
start_time_ = base::TimeTicks::Now();
@@ -320,16 +318,14 @@
return DoLoop(rv);
}
- virtual const DnsQuery* GetQuery() const override {
- return query_.get();
- }
+ const DnsQuery* GetQuery() const override { return query_.get(); }
- virtual const DnsResponse* GetResponse() const override {
+ const DnsResponse* GetResponse() const override {
const DnsResponse* resp = response_.get();
return (resp != NULL && resp->IsValid()) ? resp : NULL;
}
- virtual const BoundNetLog& GetSocketNetLog() const override {
+ const BoundNetLog& GetSocketNetLog() const override {
return socket_->NetLog();
}
@@ -567,24 +563,24 @@
DCHECK(!IsIPLiteral(hostname_));
}
- virtual ~DnsTransactionImpl() {
+ ~DnsTransactionImpl() override {
if (!callback_.is_null()) {
net_log_.EndEventWithNetErrorCode(NetLog::TYPE_DNS_TRANSACTION,
ERR_ABORTED);
} // otherwise logged in DoCallback or Start
}
- virtual const std::string& GetHostname() const override {
+ const std::string& GetHostname() const override {
DCHECK(CalledOnValidThread());
return hostname_;
}
- virtual uint16 GetType() const override {
+ uint16 GetType() const override {
DCHECK(CalledOnValidThread());
return qtype_;
}
- virtual void Start() override {
+ void Start() override {
DCHECK(!callback_.is_null());
DCHECK(attempts_.empty());
net_log_.BeginEvent(NetLog::TYPE_DNS_TRANSACTION,
@@ -968,7 +964,7 @@
session_ = session;
}
- virtual scoped_ptr<DnsTransaction> CreateTransaction(
+ scoped_ptr<DnsTransaction> CreateTransaction(
const std::string& hostname,
uint16 qtype,
const CallbackType& callback,
diff --git a/net/dns/dns_transaction_unittest.cc b/net/dns/dns_transaction_unittest.cc
index e074966..5581f22 100644
--- a/net/dns/dns_transaction_unittest.cc
+++ b/net/dns/dns_transaction_unittest.cc
@@ -152,8 +152,8 @@
net::NetLog* net_log)
: MockUDPClientSocket(data, net_log) {
}
- virtual ~FailingUDPClientSocket() {}
- virtual int Connect(const IPEndPoint& endpoint) override {
+ ~FailingUDPClientSocket() override {}
+ int Connect(const IPEndPoint& endpoint) override {
return ERR_CONNECTION_REFUSED;
}
@@ -169,8 +169,8 @@
net::NetLog* net_log)
: MockUDPClientSocket(data, net_log), factory_(factory) {
}
- virtual ~TestUDPClientSocket() {}
- virtual int Connect(const IPEndPoint& endpoint) override;
+ ~TestUDPClientSocket() override {}
+ int Connect(const IPEndPoint& endpoint) override;
private:
TestSocketFactory* factory_;
@@ -182,9 +182,9 @@
class TestSocketFactory : public MockClientSocketFactory {
public:
TestSocketFactory() : fail_next_socket_(false) {}
- virtual ~TestSocketFactory() {}
+ ~TestSocketFactory() override {}
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
net::NetLog* net_log,
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 5632ef9..8913f17 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -1221,7 +1221,7 @@
&key_.hostname));
}
- virtual ~Job() {
+ ~Job() override {
if (is_running()) {
// |resolver_| was destroyed with this Job still in flight.
// Clean-up, record in the log, but don't run any callbacks.
@@ -1424,7 +1424,7 @@
}
// PriorityDispatch::Job:
- virtual void Start() override {
+ void Start() override {
DCHECK_LE(num_occupied_job_slots_, 1u);
handle_.Reset();
@@ -1587,10 +1587,10 @@
// HostResolverImpl::DnsTask::Delegate implementation:
- virtual void OnDnsTaskComplete(base::TimeTicks start_time,
- int net_error,
- const AddressList& addr_list,
- base::TimeDelta ttl) override {
+ void OnDnsTaskComplete(base::TimeTicks start_time,
+ int net_error,
+ const AddressList& addr_list,
+ base::TimeDelta ttl) override {
DCHECK(is_dns_running());
base::TimeDelta duration = base::TimeTicks::Now() - start_time;
@@ -1625,7 +1625,7 @@
bounded_ttl);
}
- virtual void OnFirstDnsTransactionComplete() override {
+ void OnFirstDnsTransactionComplete() override {
DCHECK(dns_task_->needs_two_transactions());
DCHECK_EQ(dns_task_->needs_another_transaction(), is_queued());
// No longer need to occupy two dispatcher slots.
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index edd64fc..35ecb06 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -111,7 +111,7 @@
// If any completion callbacks are pending when the resolver is destroyed,
// the host resolutions are cancelled, and the completion callbacks will not
// be called.
- virtual ~HostResolverImpl();
+ ~HostResolverImpl() override;
// Configures maximum number of Jobs in the queue. Exposed for testing.
// Only allowed when the queue is empty.
@@ -124,21 +124,21 @@
void SetDnsClient(scoped_ptr<DnsClient> dns_client);
// HostResolver methods:
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& source_net_log) override;
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& source_net_log) override;
- virtual void CancelRequest(RequestHandle req) override;
- virtual void SetDefaultAddressFamily(AddressFamily address_family) override;
- virtual AddressFamily GetDefaultAddressFamily() const override;
- virtual void SetDnsClientEnabled(bool enabled) override;
- virtual HostCache* GetHostCache() override;
- virtual base::Value* GetDnsConfigAsValue() const override;
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& source_net_log) override;
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& source_net_log) override;
+ void CancelRequest(RequestHandle req) override;
+ void SetDefaultAddressFamily(AddressFamily address_family) override;
+ AddressFamily GetDefaultAddressFamily() const override;
+ void SetDnsClientEnabled(bool enabled) override;
+ HostCache* GetHostCache() override;
+ base::Value* GetDnsConfigAsValue() const override;
void set_proc_params_for_test(const ProcTaskParams& proc_params) {
proc_params_ = proc_params;
@@ -220,10 +220,10 @@
void TryServingAllJobsFromHosts();
// NetworkChangeNotifier::IPAddressObserver:
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
// NetworkChangeNotifier::DNSObserver:
- virtual void OnDNSChanged() override;
+ void OnDNSChanged() override;
// True if have a DnsClient with a valid DnsConfig.
bool HaveDnsConfig() const;
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index dadc03d..017625f 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -125,11 +125,11 @@
AddRule(hostname, ADDRESS_FAMILY_IPV6, result);
}
- virtual int Resolve(const std::string& hostname,
- AddressFamily address_family,
- HostResolverFlags host_resolver_flags,
- AddressList* addrlist,
- int* os_error) override {
+ int Resolve(const std::string& hostname,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addrlist,
+ int* os_error) override {
base::AutoLock lock(lock_);
capture_list_.push_back(ResolveKey(hostname, address_family));
++num_requests_waiting_;
@@ -166,7 +166,7 @@
}
protected:
- virtual ~MockHostResolverProc() {}
+ ~MockHostResolverProc() override {}
private:
mutable base::Lock lock_;
@@ -361,11 +361,11 @@
int resolved_attempt_number() { return resolved_attempt_number_; }
// HostResolverProc methods.
- virtual int Resolve(const std::string& host,
- AddressFamily address_family,
- HostResolverFlags host_resolver_flags,
- AddressList* addrlist,
- int* os_error) override {
+ int Resolve(const std::string& host,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addrlist,
+ int* os_error) override {
bool wait_for_right_attempt_to_complete = true;
{
base::AutoLock auto_lock(lock_);
@@ -401,7 +401,7 @@
}
protected:
- virtual ~LookupAttemptHostResolverProc() {}
+ ~LookupAttemptHostResolverProc() override {}
private:
int attempt_number_to_resolve_;
@@ -439,7 +439,7 @@
protected:
// A Request::Handler which is a proxy to the HostResolverImplTest fixture.
struct Handler : public Request::Handler {
- virtual ~Handler() {}
+ ~Handler() override {}
// Proxy functions so that classes derived from Handler can access them.
Request* CreateRequest(const HostResolver::RequestInfo& info,
@@ -732,7 +732,7 @@
TEST_F(HostResolverImplTest, CancelWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) override {
+ void Handle(Request* req) override {
// Port 80 is the first request that the callback will be invoked for.
// While we are executing within that callback, cancel the other requests
// in the job and start another request.
@@ -761,7 +761,7 @@
TEST_F(HostResolverImplTest, DeleteWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) override {
+ void Handle(Request* req) override {
EXPECT_EQ("a", req->info().hostname());
EXPECT_EQ(80, req->info().port());
@@ -787,7 +787,7 @@
TEST_F(HostResolverImplTest, DeleteWithinAbortedCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) override {
+ void Handle(Request* req) override {
EXPECT_EQ("a", req->info().hostname());
EXPECT_EQ(80, req->info().port());
@@ -827,7 +827,7 @@
TEST_F(HostResolverImplTest, StartWithinCallback) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) override {
+ void Handle(Request* req) override {
if (req->index() == 0) {
// On completing the first request, start another request for "a".
// Since caching is disabled, this will result in another async request.
@@ -858,7 +858,7 @@
TEST_F(HostResolverImplTest, BypassCache) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) override {
+ void Handle(Request* req) override {
if (req->index() == 0) {
// On completing the first request, start another request for "a".
// Since caching is enabled, this should complete synchronously.
@@ -956,7 +956,7 @@
// will not be aborted.
TEST_F(HostResolverImplTest, AbortOnlyExistingRequestsOnIPAddressChange) {
struct MyHandler : public Handler {
- virtual void Handle(Request* req) override {
+ void Handle(Request* req) override {
// Start new request for a different hostname to ensure that the order
// of jobs in HostResolverImpl is not stable.
std::string hostname;
@@ -1379,7 +1379,7 @@
}
// HostResolverImplTest implementation:
- virtual void CreateResolverWithLimitsAndParams(
+ void CreateResolverWithLimitsAndParams(
size_t max_concurrent_resolves,
const HostResolverImpl::ProcTaskParams& params) override {
HostResolverImpl::Options options = DefaultOptions();
diff --git a/net/dns/host_resolver_proc.h b/net/dns/host_resolver_proc.h
index 695e3bc..cb61e19 100644
--- a/net/dns/host_resolver_proc.h
+++ b/net/dns/host_resolver_proc.h
@@ -95,13 +95,14 @@
class NET_EXPORT_PRIVATE SystemHostResolverProc : public HostResolverProc {
public:
SystemHostResolverProc();
- virtual int Resolve(const std::string& hostname,
- AddressFamily address_family,
- HostResolverFlags host_resolver_flags,
- AddressList* addr_list,
- int* os_error) override;
+ int Resolve(const std::string& hostname,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addr_list,
+ int* os_error) override;
+
protected:
- virtual ~SystemHostResolverProc();
+ ~SystemHostResolverProc() override;
DISALLOW_COPY_AND_ASSIGN(SystemHostResolverProc);
};
diff --git a/net/dns/mapped_host_resolver.h b/net/dns/mapped_host_resolver.h
index 6d4ab92..ecdc2e8 100644
--- a/net/dns/mapped_host_resolver.h
+++ b/net/dns/mapped_host_resolver.h
@@ -23,7 +23,7 @@
// Creates a MappedHostResolver that forwards all of its requests through
// |impl|.
explicit MappedHostResolver(scoped_ptr<HostResolver> impl);
- virtual ~MappedHostResolver();
+ ~MappedHostResolver() override;
// Adds a rule to this mapper. The format of the rule can be one of:
//
@@ -45,19 +45,19 @@
}
// HostResolver methods:
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override;
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle req) override;
- virtual void SetDnsClientEnabled(bool enabled) override;
- virtual HostCache* GetHostCache() override;
- virtual base::Value* GetDnsConfigAsValue() const override;
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override;
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle req) override;
+ void SetDnsClientEnabled(bool enabled) override;
+ HostCache* GetHostCache() override;
+ base::Value* GetDnsConfigAsValue() const override;
private:
// Modify the request |info| according to |rules_|. Returns either OK or
diff --git a/net/dns/mock_host_resolver.h b/net/dns/mock_host_resolver.h
index 9d5339f..501d0fc 100644
--- a/net/dns/mock_host_resolver.h
+++ b/net/dns/mock_host_resolver.h
@@ -55,7 +55,7 @@
public base::SupportsWeakPtr<MockHostResolverBase>,
public base::NonThreadSafe {
public:
- virtual ~MockHostResolverBase();
+ ~MockHostResolverBase() override;
RuleBasedHostResolverProc* rules() { return rules_.get(); }
void set_rules(RuleBasedHostResolverProc* rules) { rules_ = rules; }
@@ -74,17 +74,17 @@
}
// HostResolver methods:
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override;
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle req) override;
- virtual HostCache* GetHostCache() override;
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override;
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle req) override;
+ HostCache* GetHostCache() override;
// Resolves all pending requests. It is only valid to invoke this if
// set_ondemand_mode was set before. The requests are resolved asynchronously,
@@ -144,7 +144,7 @@
class MockHostResolver : public MockHostResolverBase {
public:
MockHostResolver() : MockHostResolverBase(false /*use_caching*/) {}
- virtual ~MockHostResolver() {}
+ ~MockHostResolver() override {}
};
// Same as MockHostResolver, except internally it uses a host-cache.
@@ -155,7 +155,7 @@
class MockCachingHostResolver : public MockHostResolverBase {
public:
MockCachingHostResolver() : MockHostResolverBase(true /*use_caching*/) {}
- virtual ~MockCachingHostResolver() {}
+ ~MockCachingHostResolver() override {}
};
// RuleBasedHostResolverProc applies a set of rules to map a host string to
@@ -202,17 +202,17 @@
void ClearRules();
// HostResolverProc methods:
- virtual int Resolve(const std::string& host,
- AddressFamily address_family,
- HostResolverFlags host_resolver_flags,
- AddressList* addrlist,
- int* os_error) override;
+ int Resolve(const std::string& host,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addrlist,
+ int* os_error) override;
private:
struct Rule;
typedef std::list<Rule> RuleList;
- virtual ~RuleBasedHostResolverProc();
+ ~RuleBasedHostResolverProc() override;
RuleList rules_;
};
@@ -223,16 +223,16 @@
// HangingHostResolver never completes its |Resolve| request.
class HangingHostResolver : public HostResolver {
public:
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override;
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle req) override {}
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override;
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle req) override {}
};
// This class sets the default HostResolverProc for a particular scope. The
diff --git a/net/dns/notify_watcher_mac.h b/net/dns/notify_watcher_mac.h
index 0951c2f..ded752c 100644
--- a/net/dns/notify_watcher_mac.h
+++ b/net/dns/notify_watcher_mac.h
@@ -20,7 +20,7 @@
NotifyWatcherMac();
// When deleted, automatically cancels.
- virtual ~NotifyWatcherMac();
+ ~NotifyWatcherMac() override;
// Registers for notifications for |key|. Returns true if succeeds. If so,
// will deliver asynchronous notifications and errors to |callback|.
@@ -31,8 +31,8 @@
private:
// MessageLoopForIO::Watcher:
- virtual void OnFileCanReadWithoutBlocking(int fd) override;
- virtual void OnFileCanWriteWithoutBlocking(int fd) override {}
+ void OnFileCanReadWithoutBlocking(int fd) override;
+ void OnFileCanWriteWithoutBlocking(int fd) override {}
int notify_fd_;
int notify_token_;
diff --git a/net/dns/serial_worker_unittest.cc b/net/dns/serial_worker_unittest.cc
index c670a75..8e30e28 100644
--- a/net/dns/serial_worker_unittest.cc
+++ b/net/dns/serial_worker_unittest.cc
@@ -21,16 +21,16 @@
public:
explicit TestSerialWorker(SerialWorkerTest* t)
: test_(t) {}
- virtual void DoWork() override {
+ void DoWork() override {
ASSERT_TRUE(test_);
test_->OnWork();
}
- virtual void OnWorkFinished() override {
+ void OnWorkFinished() override {
ASSERT_TRUE(test_);
test_->OnWorkFinished();
}
private:
- virtual ~TestSerialWorker() {}
+ ~TestSerialWorker() override {}
SerialWorkerTest* test_;
};
diff --git a/net/dns/single_request_host_resolver_unittest.cc b/net/dns/single_request_host_resolver_unittest.cc
index 7b09193..a1442bd 100644
--- a/net/dns/single_request_host_resolver_unittest.cc
+++ b/net/dns/single_request_host_resolver_unittest.cc
@@ -22,20 +22,18 @@
public:
HangingHostResolver() : outstanding_request_(NULL) {}
- virtual ~HangingHostResolver() {
- EXPECT_TRUE(!has_outstanding_request());
- }
+ ~HangingHostResolver() override { EXPECT_TRUE(!has_outstanding_request()); }
bool has_outstanding_request() const {
return outstanding_request_ != NULL;
}
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override {
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override {
EXPECT_FALSE(has_outstanding_request());
outstanding_request_ = reinterpret_cast<RequestHandle>(0x1234);
*out_req = outstanding_request_;
@@ -45,14 +43,14 @@
return ERR_IO_PENDING;
}
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override {
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override {
NOTIMPLEMENTED();
return ERR_UNEXPECTED;
}
- virtual void CancelRequest(RequestHandle req) override {
+ void CancelRequest(RequestHandle req) override {
EXPECT_TRUE(has_outstanding_request());
EXPECT_EQ(req, outstanding_request_);
outstanding_request_ = NULL;
diff --git a/net/extras/sqlite/sqlite_channel_id_store.h b/net/extras/sqlite/sqlite_channel_id_store.h
index e743ba6..fc85458 100644
--- a/net/extras/sqlite/sqlite_channel_id_store.h
+++ b/net/extras/sqlite/sqlite_channel_id_store.h
@@ -36,18 +36,18 @@
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner);
// DefaultChannelIDStore::PersistentStore:
- virtual void Load(const LoadedCallback& loaded_callback) override;
- virtual void AddChannelID(
+ void Load(const LoadedCallback& loaded_callback) override;
+ void AddChannelID(
const DefaultChannelIDStore::ChannelID& channel_id) override;
- virtual void DeleteChannelID(
+ void DeleteChannelID(
const DefaultChannelIDStore::ChannelID& channel_id) override;
- virtual void SetForceKeepSessionState() override;
+ void SetForceKeepSessionState() override;
// Delete channel ids from servers in |server_identifiers|.
void DeleteAllInList(const std::list<std::string>& server_identifiers);
private:
- virtual ~SQLiteChannelIDStore();
+ ~SQLiteChannelIDStore() override;
class Backend;
diff --git a/net/filter/gzip_filter.h b/net/filter/gzip_filter.h
index 07b7821..597c2e7 100644
--- a/net/filter/gzip_filter.h
+++ b/net/filter/gzip_filter.h
@@ -27,7 +27,7 @@
class GZipFilter : public Filter {
public:
- virtual ~GZipFilter();
+ ~GZipFilter() override;
// Initializes filter decoding mode and internal control blocks.
// Parameter filter_type specifies the type of filter, which corresponds to
@@ -48,8 +48,7 @@
// stream_buffer_. On the other hand, *dest_len can be 0 upon successful
// return. For example, the internal zlib may process some pre-filter data
// but not produce output yet.
- virtual FilterStatus ReadFilteredData(char* dest_buffer,
- int* dest_len) override;
+ FilterStatus ReadFilteredData(char* dest_buffer, int* dest_len) override;
private:
enum DecodingStatus {
diff --git a/net/filter/mock_filter_context.h b/net/filter/mock_filter_context.h
index bdef812..8150e8b 100644
--- a/net/filter/mock_filter_context.h
+++ b/net/filter/mock_filter_context.h
@@ -18,7 +18,7 @@
class MockFilterContext : public FilterContext {
public:
MockFilterContext();
- virtual ~MockFilterContext();
+ ~MockFilterContext() override;
void SetMimeType(const std::string& mime_type) { mime_type_ = mime_type; }
void SetURL(const GURL& gurl) { gurl_ = gurl; }
@@ -41,37 +41,37 @@
// of those interfaces as coding errors.
void NukeUnstableInterfaces();
- virtual bool GetMimeType(std::string* mime_type) const override;
+ bool GetMimeType(std::string* mime_type) const override;
// What URL was used to access this data?
// Return false if gurl is not present.
- virtual bool GetURL(GURL* gurl) const override;
+ bool GetURL(GURL* gurl) const override;
// What Content-Disposition did the server supply for this data?
// Return false if Content-Disposition was not present.
- virtual bool GetContentDisposition(std::string* disposition) const override;
+ bool GetContentDisposition(std::string* disposition) const override;
// What was this data requested from a server?
- virtual base::Time GetRequestTime() const override;
+ base::Time GetRequestTime() const override;
// Is data supplied from cache, or fresh across the net?
- virtual bool IsCachedContent() const override;
+ bool IsCachedContent() const override;
// Is this a download?
- virtual bool IsDownload() const override;
+ bool IsDownload() const override;
// Was this data flagged as a response to a request with an SDCH dictionary?
- virtual bool SdchResponseExpected() const override;
+ bool SdchResponseExpected() const override;
// How many bytes were fed to filter(s) so far?
- virtual int64 GetByteReadCount() const override;
+ int64 GetByteReadCount() const override;
- virtual int GetResponseCode() const override;
+ int GetResponseCode() const override;
// The URLRequestContext associated with the request.
- virtual const URLRequestContext* GetURLRequestContext() const override;
+ const URLRequestContext* GetURLRequestContext() const override;
- virtual void RecordPacketStats(StatisticSelector statistic) const override {}
+ void RecordPacketStats(StatisticSelector statistic) const override {}
private:
int buffer_size_;
diff --git a/net/filter/sdch_filter.h b/net/filter/sdch_filter.h
index 861a9ae..e9648b1 100644
--- a/net/filter/sdch_filter.h
+++ b/net/filter/sdch_filter.h
@@ -29,7 +29,7 @@
class NET_EXPORT_PRIVATE SdchFilter : public Filter {
public:
- virtual ~SdchFilter();
+ ~SdchFilter() override;
// Initializes filter decoding mode and internal control blocks.
bool InitDecoding(Filter::FilterType filter_type);
@@ -40,8 +40,7 @@
// Upon entry, *dest_len is the total size (in number of chars) of the
// destination buffer. Upon exit, *dest_len is the actual number of chars
// written into the destination buffer.
- virtual FilterStatus ReadFilteredData(char* dest_buffer,
- int* dest_len) override;
+ FilterStatus ReadFilteredData(char* dest_buffer, int* dest_len) override;
private:
// Internal status. Once we enter an error state, we stop processing data.
diff --git a/net/ftp/ftp_network_layer.h b/net/ftp/ftp_network_layer.h
index 6242f74..f174df9 100644
--- a/net/ftp/ftp_network_layer.h
+++ b/net/ftp/ftp_network_layer.h
@@ -19,13 +19,13 @@
class NET_EXPORT FtpNetworkLayer : public FtpTransactionFactory {
public:
explicit FtpNetworkLayer(HostResolver* host_resolver);
- virtual ~FtpNetworkLayer();
+ ~FtpNetworkLayer() override;
static FtpTransactionFactory* CreateFactory(HostResolver* host_resolver);
// FtpTransactionFactory methods:
- virtual FtpTransaction* CreateTransaction() override;
- virtual void Suspend(bool suspend) override;
+ FtpTransaction* CreateTransaction() override;
+ void Suspend(bool suspend) override;
private:
scoped_refptr<FtpNetworkSession> session_;
diff --git a/net/ftp/ftp_network_transaction.h b/net/ftp/ftp_network_transaction.h
index ee0f28a..c8ed550 100644
--- a/net/ftp/ftp_network_transaction.h
+++ b/net/ftp/ftp_network_transaction.h
@@ -30,22 +30,23 @@
public:
FtpNetworkTransaction(FtpNetworkSession* session,
ClientSocketFactory* socket_factory);
- virtual ~FtpNetworkTransaction();
+ ~FtpNetworkTransaction() override;
virtual int Stop(int error);
virtual int RestartIgnoringLastError(const CompletionCallback& callback);
// FtpTransaction methods:
- virtual int Start(const FtpRequestInfo* request_info,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
- virtual int RestartWithAuth(const AuthCredentials& credentials,
- const CompletionCallback& callback) override;
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual const FtpResponseInfo* GetResponseInfo() const override;
- virtual LoadState GetLoadState() const override;
- virtual uint64 GetUploadProgress() const override;
+ int Start(const FtpRequestInfo* request_info,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
+ int RestartWithAuth(const AuthCredentials& credentials,
+ const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ const FtpResponseInfo* GetResponseInfo() const override;
+ LoadState GetLoadState() const override;
+ uint64 GetUploadProgress() const override;
private:
FRIEND_TEST_ALL_PREFIXES(FtpNetworkTransactionTest,
diff --git a/net/ftp/ftp_network_transaction_unittest.cc b/net/ftp/ftp_network_transaction_unittest.cc
index de407d5..4ee812d 100644
--- a/net/ftp/ftp_network_transaction_unittest.cc
+++ b/net/ftp/ftp_network_transaction_unittest.cc
@@ -63,7 +63,7 @@
Init();
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -131,7 +131,7 @@
return state_;
}
- virtual void Reset() override {
+ void Reset() override {
DynamicSocketDataProvider::Reset();
Init();
}
@@ -205,7 +205,7 @@
FtpSocketDataProviderDirectoryListing() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -232,7 +232,7 @@
FtpSocketDataProviderDirectoryListingWithPasvFallback() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -258,7 +258,7 @@
FtpSocketDataProviderDirectoryListingZeroSize() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -278,7 +278,7 @@
FtpSocketDataProviderVMSDirectoryListing() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -312,7 +312,7 @@
FtpSocketDataProviderVMSDirectoryListingRootDirectory() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -348,7 +348,7 @@
FtpSocketDataProviderFileDownloadWithFileTypecode() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -371,7 +371,7 @@
FtpSocketDataProviderFileDownload() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -398,7 +398,7 @@
FtpSocketDataProviderFileNotFound() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -428,7 +428,7 @@
FtpSocketDataProviderFileDownloadWithPasvFallback() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -453,7 +453,7 @@
FtpSocketDataProviderFileDownloadZeroSize() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -479,7 +479,7 @@
FtpSocketDataProviderFileDownloadCWD451() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -501,7 +501,7 @@
FtpSocketDataProviderVMSFileDownload() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -536,7 +536,7 @@
FtpSocketDataProviderEscaping() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -565,7 +565,7 @@
FtpSocketDataProviderFileDownloadTransferStarting() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -589,7 +589,7 @@
FtpSocketDataProviderDirectoryListingTransferStarting() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -614,7 +614,7 @@
FtpSocketDataProviderFileDownloadInvalidResponse() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -648,7 +648,7 @@
epsv_response_length_(epsv_response_length),
expected_state_(expected_state) {}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -676,7 +676,7 @@
expected_state_(expected_state) {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -701,7 +701,7 @@
expected_state_(expected_state) {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -728,7 +728,7 @@
expected_password_(expected_password) {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
@@ -755,7 +755,7 @@
FtpSocketDataProviderCloseConnection() {
}
- virtual MockWriteResult OnWrite(const std::string& data) override {
+ MockWriteResult OnWrite(const std::string& data) override {
if (InjectFault())
return MockWriteResult(ASYNC, data.length());
switch (state()) {
diff --git a/net/http/disk_cache_based_quic_server_info.h b/net/http/disk_cache_based_quic_server_info.h
index 7707037..e5ced3f 100644
--- a/net/http/disk_cache_based_quic_server_info.h
+++ b/net/http/disk_cache_based_quic_server_info.h
@@ -31,11 +31,11 @@
HttpCache* http_cache);
// QuicServerInfo implementation.
- virtual void Start() override;
- virtual int WaitForDataReady(const CompletionCallback& callback) override;
- virtual bool IsDataReady() override;
- virtual bool IsReadyToPersist() override;
- virtual void Persist() override;
+ void Start() override;
+ int WaitForDataReady(const CompletionCallback& callback) override;
+ bool IsDataReady() override;
+ bool IsReadyToPersist() override;
+ void Persist() override;
private:
struct CacheOperationDataShim;
@@ -55,7 +55,7 @@
NONE,
};
- virtual ~DiskCacheBasedQuicServerInfo();
+ ~DiskCacheBasedQuicServerInfo() override;
std::string key() const;
diff --git a/net/http/failing_http_transaction_factory.cc b/net/http/failing_http_transaction_factory.cc
index 0b97aa2..dfe78f2 100644
--- a/net/http/failing_http_transaction_factory.cc
+++ b/net/http/failing_http_transaction_factory.cc
@@ -29,43 +29,38 @@
class FailingHttpTransaction : public HttpTransaction {
public:
explicit FailingHttpTransaction(Error error);
- virtual ~FailingHttpTransaction();
+ ~FailingHttpTransaction() override;
// HttpTransaction
- virtual int Start(const HttpRequestInfo* request_info,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
- virtual int RestartIgnoringLastError(
- const CompletionCallback& callback) override;
- virtual int RestartWithCertificate(
- X509Certificate* client_cert,
- const CompletionCallback& callback) override;
- virtual int RestartWithAuth(
- const AuthCredentials& credentials,
- const CompletionCallback& callback) override;
- virtual bool IsReadyToRestartForAuth() override;
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual void StopCaching() override;
- virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual void DoneReading() override;
- virtual const HttpResponseInfo* GetResponseInfo() const override;
- virtual LoadState GetLoadState() const override;
- virtual UploadProgress GetUploadProgress() const override;
- virtual void SetQuicServerInfo(
- net::QuicServerInfo* quic_server_info) override;
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual void SetPriority(RequestPriority priority) override;
- virtual void SetWebSocketHandshakeStreamCreateHelper(
+ int Start(const HttpRequestInfo* request_info,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
+ int RestartIgnoringLastError(const CompletionCallback& callback) override;
+ int RestartWithCertificate(X509Certificate* client_cert,
+ const CompletionCallback& callback) override;
+ int RestartWithAuth(const AuthCredentials& credentials,
+ const CompletionCallback& callback) override;
+ bool IsReadyToRestartForAuth() override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void StopCaching() override;
+ bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override;
+ int64 GetTotalReceivedBytes() const override;
+ void DoneReading() override;
+ const HttpResponseInfo* GetResponseInfo() const override;
+ LoadState GetLoadState() const override;
+ UploadProgress GetUploadProgress() const override;
+ void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void SetPriority(RequestPriority priority) override;
+ void SetWebSocketHandshakeStreamCreateHelper(
WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
- virtual void SetBeforeNetworkStartCallback(
+ void SetBeforeNetworkStartCallback(
const BeforeNetworkStartCallback& callback) override;
- virtual void SetBeforeProxyHeadersSentCallback(
+ void SetBeforeProxyHeadersSentCallback(
const BeforeProxyHeadersSentCallback& callback) override;
- virtual int ResumeNetworkStart() override;
+ int ResumeNetworkStart() override;
private:
Error error_;
diff --git a/net/http/failing_http_transaction_factory.h b/net/http/failing_http_transaction_factory.h
index 8a785f5..dd4a811 100644
--- a/net/http/failing_http_transaction_factory.h
+++ b/net/http/failing_http_transaction_factory.h
@@ -23,14 +23,13 @@
public:
// The caller must guarantee that |session| outlives this object.
FailingHttpTransactionFactory(HttpNetworkSession* session, Error error);
- virtual ~FailingHttpTransactionFactory();
+ ~FailingHttpTransactionFactory() override;
// HttpTransactionFactory:
- virtual int CreateTransaction(
- RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) override;
- virtual HttpCache* GetCache() override;
- virtual HttpNetworkSession* GetSession() override;
+ int CreateTransaction(RequestPriority priority,
+ scoped_ptr<HttpTransaction>* trans) override;
+ HttpCache* GetCache() override;
+ HttpNetworkSession* GetSession() override;
private:
HttpNetworkSession* session_;
diff --git a/net/http/http_auth_cache_unittest.cc b/net/http/http_auth_cache_unittest.cc
index 4002bab..3565b0c 100644
--- a/net/http/http_auth_cache_unittest.cc
+++ b/net/http/http_auth_cache_unittest.cc
@@ -32,27 +32,27 @@
properties_ = 0;
}
- virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
+ HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override {
return HttpAuth::AUTHORIZATION_RESULT_REJECT;
}
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) override {
+ bool Init(HttpAuthChallengeTokenizer* challenge) override {
return false; // Unused.
}
- virtual int GenerateAuthTokenImpl(const AuthCredentials*,
- const HttpRequestInfo*,
- const CompletionCallback& callback,
- std::string* auth_token) override {
+ int GenerateAuthTokenImpl(const AuthCredentials*,
+ const HttpRequestInfo*,
+ const CompletionCallback& callback,
+ std::string* auth_token) override {
*auth_token = "mock-credentials";
return OK;
}
private:
- virtual ~MockAuthHandler() {}
+ ~MockAuthHandler() override {}
};
const char* kRealm1 = "Realm1";
diff --git a/net/http/http_auth_controller_unittest.cc b/net/http/http_auth_controller_unittest.cc
index 306cabd..c39256b 100644
--- a/net/http/http_auth_controller_unittest.cc
+++ b/net/http/http_auth_controller_unittest.cc
@@ -128,7 +128,7 @@
}
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) override {
+ bool Init(HttpAuthChallengeTokenizer* challenge) override {
HttpAuthHandlerMock::Init(challenge);
set_allows_default_credentials(true);
set_allows_explicit_credentials(false);
@@ -143,10 +143,10 @@
return true;
}
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override {
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override {
int result =
HttpAuthHandlerMock::GenerateAuthTokenImpl(credentials,
request, callback,
diff --git a/net/http/http_auth_filter.h b/net/http/http_auth_filter.h
index 419b8af..260da47 100644
--- a/net/http/http_auth_filter.h
+++ b/net/http/http_auth_filter.h
@@ -35,7 +35,7 @@
class NET_EXPORT HttpAuthFilterWhitelist : public HttpAuthFilter {
public:
explicit HttpAuthFilterWhitelist(const std::string& server_whitelist);
- virtual ~HttpAuthFilterWhitelist();
+ ~HttpAuthFilterWhitelist() override;
// Adds an individual URL |filter| to the list, of the specified |target|.
bool AddFilter(const std::string& filter, HttpAuth::Target target);
@@ -46,7 +46,7 @@
const ProxyBypassRules& rules() const { return rules_; }
// HttpAuthFilter methods:
- virtual bool IsValid(const GURL& url, HttpAuth::Target target) const override;
+ bool IsValid(const GURL& url, HttpAuth::Target target) const override;
private:
// Installs the whitelist.
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h
index 41a1805..4091ba3 100644
--- a/net/http/http_auth_gssapi_posix.h
+++ b/net/http/http_auth_gssapi_posix.h
@@ -109,68 +109,59 @@
// If |gssapi_library_name| is empty, hard-coded default library names are
// used.
explicit GSSAPISharedLibrary(const std::string& gssapi_library_name);
- virtual ~GSSAPISharedLibrary();
+ ~GSSAPISharedLibrary() override;
// GSSAPILibrary methods:
- virtual bool Init() override;
- virtual OM_uint32 import_name(
- OM_uint32* minor_status,
- const gss_buffer_t input_name_buffer,
- const gss_OID input_name_type,
- gss_name_t* output_name) override;
- virtual OM_uint32 release_name(
- OM_uint32* minor_status,
- gss_name_t* input_name) override;
- virtual OM_uint32 release_buffer(
- OM_uint32* minor_status,
- gss_buffer_t buffer) override;
- virtual OM_uint32 display_name(
- OM_uint32* minor_status,
- const gss_name_t input_name,
- gss_buffer_t output_name_buffer,
- gss_OID* output_name_type) override;
- virtual OM_uint32 display_status(
- OM_uint32* minor_status,
- OM_uint32 status_value,
- int status_type,
- const gss_OID mech_type,
- OM_uint32* message_contex,
- gss_buffer_t status_string) override;
- virtual OM_uint32 init_sec_context(
- OM_uint32* minor_status,
- const gss_cred_id_t initiator_cred_handle,
- gss_ctx_id_t* context_handle,
- const gss_name_t target_name,
- const gss_OID mech_type,
- OM_uint32 req_flags,
- OM_uint32 time_req,
- const gss_channel_bindings_t input_chan_bindings,
- const gss_buffer_t input_token,
- gss_OID* actual_mech_type,
- gss_buffer_t output_token,
- OM_uint32* ret_flags,
- OM_uint32* time_rec) override;
- virtual OM_uint32 wrap_size_limit(
- OM_uint32* minor_status,
- const gss_ctx_id_t context_handle,
- int conf_req_flag,
- gss_qop_t qop_req,
- OM_uint32 req_output_size,
- OM_uint32* max_input_size) override;
- virtual OM_uint32 delete_sec_context(
- OM_uint32* minor_status,
- gss_ctx_id_t* context_handle,
- gss_buffer_t output_token) override;
- virtual OM_uint32 inquire_context(
- OM_uint32* minor_status,
- const gss_ctx_id_t context_handle,
- gss_name_t* src_name,
- gss_name_t* targ_name,
- OM_uint32* lifetime_rec,
- gss_OID* mech_type,
- OM_uint32* ctx_flags,
- int* locally_initiated,
- int* open) override;
+ bool Init() override;
+ OM_uint32 import_name(OM_uint32* minor_status,
+ const gss_buffer_t input_name_buffer,
+ const gss_OID input_name_type,
+ gss_name_t* output_name) override;
+ OM_uint32 release_name(OM_uint32* minor_status,
+ gss_name_t* input_name) override;
+ OM_uint32 release_buffer(OM_uint32* minor_status,
+ gss_buffer_t buffer) override;
+ OM_uint32 display_name(OM_uint32* minor_status,
+ const gss_name_t input_name,
+ gss_buffer_t output_name_buffer,
+ gss_OID* output_name_type) override;
+ OM_uint32 display_status(OM_uint32* minor_status,
+ OM_uint32 status_value,
+ int status_type,
+ const gss_OID mech_type,
+ OM_uint32* message_contex,
+ gss_buffer_t status_string) override;
+ OM_uint32 init_sec_context(OM_uint32* minor_status,
+ const gss_cred_id_t initiator_cred_handle,
+ gss_ctx_id_t* context_handle,
+ const gss_name_t target_name,
+ const gss_OID mech_type,
+ OM_uint32 req_flags,
+ OM_uint32 time_req,
+ const gss_channel_bindings_t input_chan_bindings,
+ const gss_buffer_t input_token,
+ gss_OID* actual_mech_type,
+ gss_buffer_t output_token,
+ OM_uint32* ret_flags,
+ OM_uint32* time_rec) override;
+ OM_uint32 wrap_size_limit(OM_uint32* minor_status,
+ const gss_ctx_id_t context_handle,
+ int conf_req_flag,
+ gss_qop_t qop_req,
+ OM_uint32 req_output_size,
+ OM_uint32* max_input_size) override;
+ OM_uint32 delete_sec_context(OM_uint32* minor_status,
+ gss_ctx_id_t* context_handle,
+ gss_buffer_t output_token) override;
+ OM_uint32 inquire_context(OM_uint32* minor_status,
+ const gss_ctx_id_t context_handle,
+ gss_name_t* src_name,
+ gss_name_t* targ_name,
+ OM_uint32* lifetime_rec,
+ gss_OID* mech_type,
+ OM_uint32* ctx_flags,
+ int* locally_initiated,
+ int* open) override;
private:
typedef typeof(&gss_import_name) gss_import_name_type;
diff --git a/net/http/http_auth_handler_basic.h b/net/http/http_auth_handler_basic.h
index f718786..186caf6 100644
--- a/net/http/http_auth_handler_basic.h
+++ b/net/http/http_auth_handler_basic.h
@@ -19,31 +19,30 @@
class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory {
public:
Factory();
- virtual ~Factory();
+ ~Factory() override;
- virtual int CreateAuthHandler(
- HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int digest_nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override;
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override;
};
- virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
+ HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
+ bool Init(HttpAuthChallengeTokenizer* challenge) override;
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override;
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override;
private:
- virtual ~HttpAuthHandlerBasic() {}
+ ~HttpAuthHandlerBasic() override {}
bool ParseChallenge(HttpAuthChallengeTokenizer* challenge);
};
diff --git a/net/http/http_auth_handler_digest.h b/net/http/http_auth_handler_digest.h
index ca148fe..dbe02b4 100644
--- a/net/http/http_auth_handler_digest.h
+++ b/net/http/http_auth_handler_digest.h
@@ -38,7 +38,8 @@
class DynamicNonceGenerator : public NonceGenerator {
public:
DynamicNonceGenerator();
- virtual std::string GenerateNonce() const override;
+ std::string GenerateNonce() const override;
+
private:
DISALLOW_COPY_AND_ASSIGN(DynamicNonceGenerator);
};
@@ -49,7 +50,7 @@
public:
explicit FixedNonceGenerator(const std::string& nonce);
- virtual std::string GenerateNonce() const override;
+ std::string GenerateNonce() const override;
private:
const std::string nonce_;
@@ -59,34 +60,33 @@
class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory {
public:
Factory();
- virtual ~Factory();
+ ~Factory() override;
// This factory owns the passed in |nonce_generator|.
void set_nonce_generator(const NonceGenerator* nonce_generator);
- virtual int CreateAuthHandler(
- HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int digest_nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override;
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
scoped_ptr<const NonceGenerator> nonce_generator_;
};
- virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
+ HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
+ bool Init(HttpAuthChallengeTokenizer* challenge) override;
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override;
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override;
private:
FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, ParseChallenge);
@@ -120,7 +120,7 @@
// the handler. The lifetime of the |nonce_generator| must exceed that of this
// handler.
HttpAuthHandlerDigest(int nonce_count, const NonceGenerator* nonce_generator);
- virtual ~HttpAuthHandlerDigest();
+ ~HttpAuthHandlerDigest() override;
// Parse the challenge, saving the results into this instance.
// Returns true on success.
diff --git a/net/http/http_auth_handler_factory.h b/net/http/http_auth_handler_factory.h
index efb432a..06f7f34 100644
--- a/net/http/http_auth_handler_factory.h
+++ b/net/http/http_auth_handler_factory.h
@@ -130,7 +130,7 @@
: public HttpAuthHandlerFactory {
public:
HttpAuthHandlerRegistryFactory();
- virtual ~HttpAuthHandlerRegistryFactory();
+ ~HttpAuthHandlerRegistryFactory() override;
// Sets an URL security manager into the factory associated with |scheme|.
void SetURLSecurityManager(const std::string& scheme,
@@ -183,13 +183,13 @@
// Creates an auth handler by dispatching out to the registered factories
// based on the first token in |challenge|.
- virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int digest_nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override;
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
typedef std::map<std::string, HttpAuthHandlerFactory*> FactoryMap;
diff --git a/net/http/http_auth_handler_factory_unittest.cc b/net/http/http_auth_handler_factory_unittest.cc
index 9860623..2aa7958 100644
--- a/net/http/http_auth_handler_factory_unittest.cc
+++ b/net/http/http_auth_handler_factory_unittest.cc
@@ -19,15 +19,15 @@
public:
explicit MockHttpAuthHandlerFactory(int return_code) :
return_code_(return_code) {}
- virtual ~MockHttpAuthHandlerFactory() {}
+ ~MockHttpAuthHandlerFactory() override {}
- virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override {
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override {
handler->reset();
return return_code_;
}
diff --git a/net/http/http_auth_handler_mock.h b/net/http/http_auth_handler_mock.h
index b903e8c..32b416d 100644
--- a/net/http/http_auth_handler_mock.h
+++ b/net/http/http_auth_handler_mock.h
@@ -33,7 +33,7 @@
class Factory : public HttpAuthHandlerFactory {
public:
Factory();
- virtual ~Factory();
+ ~Factory() override;
void AddMockHandler(HttpAuthHandler* handler, HttpAuth::Target target);
@@ -42,14 +42,13 @@
}
// HttpAuthHandlerFactory:
- virtual int CreateAuthHandler(
- HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override;
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
ScopedVector<HttpAuthHandler> handlers_[HttpAuth::AUTH_NUM_TARGETS];
@@ -58,7 +57,7 @@
HttpAuthHandlerMock();
- virtual ~HttpAuthHandlerMock();
+ ~HttpAuthHandlerMock() override;
void SetResolveExpectation(Resolve resolve);
@@ -87,19 +86,19 @@
}
// HttpAuthHandler:
- virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
+ HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override;
- virtual bool NeedsIdentity() override;
- virtual bool AllowsDefaultCredentials() override;
- virtual bool AllowsExplicitCredentials() override;
+ bool NeedsIdentity() override;
+ bool AllowsDefaultCredentials() override;
+ bool AllowsExplicitCredentials() override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
+ bool Init(HttpAuthChallengeTokenizer* challenge) override;
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override;
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override;
private:
void OnResolveCanonicalName();
diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h
index 8ff9244..fc596fa 100644
--- a/net/http/http_auth_handler_negotiate.h
+++ b/net/http/http_auth_handler_negotiate.h
@@ -43,7 +43,7 @@
class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory {
public:
Factory();
- virtual ~Factory();
+ ~Factory() override;
// |disable_cname_lookup()| and |set_disable_cname_lookup()| get/set whether
// the auth handlers generated by this factory should skip looking up the
@@ -69,14 +69,13 @@
auth_library_.reset(auth_library);
}
- virtual int CreateAuthHandler(
- HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int digest_nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override;
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override;
private:
bool disable_cname_lookup_;
@@ -99,26 +98,26 @@
bool disable_cname_lookup,
bool use_port);
- virtual ~HttpAuthHandlerNegotiate();
+ ~HttpAuthHandlerNegotiate() override;
// These are public for unit tests
std::string CreateSPN(const AddressList& address_list, const GURL& orign);
const std::string& spn() const { return spn_; }
// HttpAuthHandler:
- virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
+ HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override;
- virtual bool NeedsIdentity() override;
- virtual bool AllowsDefaultCredentials() override;
- virtual bool AllowsExplicitCredentials() override;
+ bool NeedsIdentity() override;
+ bool AllowsDefaultCredentials() override;
+ bool AllowsExplicitCredentials() override;
protected:
- virtual bool Init(HttpAuthChallengeTokenizer* challenge) override;
+ bool Init(HttpAuthChallengeTokenizer* challenge) override;
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override;
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override;
private:
enum State {
diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h
index 5a998ac..0712bb3 100644
--- a/net/http/http_auth_handler_ntlm.h
+++ b/net/http/http_auth_handler_ntlm.h
@@ -39,16 +39,15 @@
class Factory : public HttpAuthHandlerFactory {
public:
Factory();
- virtual ~Factory();
+ ~Factory() override;
- virtual int CreateAuthHandler(
- HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int digest_nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override;
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override;
#if defined(NTLM_SSPI)
// Set the SSPILibrary to use. Typically the only callers which need to use
// this are unit tests which pass in a mocked-out version of the SSPI
@@ -104,11 +103,11 @@
URLSecurityManager* url_security_manager);
#endif
- virtual bool NeedsIdentity() override;
+ bool NeedsIdentity() override;
- virtual bool AllowsDefaultCredentials() override;
+ bool AllowsDefaultCredentials() override;
- virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
+ HttpAuth::AuthorizationResult HandleAnotherChallenge(
HttpAuthChallengeTokenizer* challenge) override;
protected:
@@ -116,15 +115,15 @@
// It does nothing in the portable implementation.
int InitializeBeforeFirstChallenge();
- virtual bool Init(HttpAuthChallengeTokenizer* tok) override;
+ bool Init(HttpAuthChallengeTokenizer* tok) override;
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override;
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override;
private:
- virtual ~HttpAuthHandlerNTLM();
+ ~HttpAuthHandlerNTLM() override;
#if defined(NTLM_PORTABLE)
// For unit tests to override the GenerateRandom and GetHostName functions.
diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h
index 541994d..194f7ef 100644
--- a/net/http/http_basic_stream.h
+++ b/net/http/http_basic_stream.h
@@ -30,55 +30,53 @@
// Constructs a new HttpBasicStream. InitializeStream must be called to
// initialize it correctly.
HttpBasicStream(ClientSocketHandle* connection, bool using_proxy);
- virtual ~HttpBasicStream();
+ ~HttpBasicStream() override;
// HttpStream methods:
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override;
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override;
- virtual int SendRequest(const HttpRequestHeaders& headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override;
+ int SendRequest(const HttpRequestHeaders& headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override;
- virtual UploadProgress GetUploadProgress() const override;
+ UploadProgress GetUploadProgress() const override;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
+ int ReadResponseHeaders(const CompletionCallback& callback) override;
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
- virtual void Close(bool not_reusable) override;
+ void Close(bool not_reusable) override;
- virtual HttpStream* RenewStreamForAuth() override;
+ HttpStream* RenewStreamForAuth() override;
- virtual bool IsResponseBodyComplete() const override;
+ bool IsResponseBodyComplete() const override;
- virtual bool CanFindEndOfResponse() const override;
+ bool CanFindEndOfResponse() const override;
- virtual bool IsConnectionReused() const override;
+ bool IsConnectionReused() const override;
- virtual void SetConnectionReused() override;
+ void SetConnectionReused() override;
- virtual bool IsConnectionReusable() const override;
+ bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const override;
+ int64 GetTotalReceivedBytes() const override;
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) override;
+ void GetSSLInfo(SSLInfo* ssl_info) override;
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
- virtual bool IsSpdyHttpStream() const override;
+ bool IsSpdyHttpStream() const override;
- virtual void Drain(HttpNetworkSession* session) override;
+ void Drain(HttpNetworkSession* session) override;
- virtual void SetPriority(RequestPriority priority) override;
+ void SetPriority(RequestPriority priority) override;
private:
HttpStreamParser* parser() const { return state_.parser(); }
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 1c8e62a..61a12f6 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -286,8 +286,7 @@
: http_cache_(http_cache) {
}
- virtual QuicServerInfo* GetForServer(
- const QuicServerId& server_id) override {
+ QuicServerInfo* GetForServer(const QuicServerId& server_id) override {
return new DiskCacheBasedQuicServerInfo(server_id, http_cache_);
}
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index 5e6851f..1c1338b 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -108,15 +108,15 @@
const base::FilePath& path,
int max_bytes,
const scoped_refptr<base::SingleThreadTaskRunner>& thread);
- virtual ~DefaultBackend();
+ ~DefaultBackend() override;
// Returns a factory for an in-memory cache.
static BackendFactory* InMemory(int max_bytes);
// BackendFactory implementation.
- virtual int CreateBackend(NetLog* net_log,
- scoped_ptr<disk_cache::Backend>* backend,
- const CompletionCallback& callback) override;
+ int CreateBackend(NetLog* net_log,
+ scoped_ptr<disk_cache::Backend>* backend,
+ const CompletionCallback& callback) override;
private:
CacheType type_;
@@ -145,7 +145,7 @@
NetLog* net_log,
BackendFactory* backend_factory);
- virtual ~HttpCache();
+ ~HttpCache() override;
HttpTransactionFactory* network_layer() { return network_layer_.get(); }
@@ -213,10 +213,10 @@
}
// HttpTransactionFactory implementation:
- virtual int CreateTransaction(RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) override;
- virtual HttpCache* GetCache() override;
- virtual HttpNetworkSession* GetSession() override;
+ int CreateTransaction(RequestPriority priority,
+ scoped_ptr<HttpTransaction>* trans) override;
+ HttpCache* GetCache() override;
+ HttpNetworkSession* GetSession() override;
base::WeakPtr<HttpCache> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index cc1f467..0b4792b 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -61,7 +61,7 @@
Transaction(RequestPriority priority,
HttpCache* cache);
- virtual ~Transaction();
+ ~Transaction() override;
Mode mode() const { return mode_; }
@@ -110,39 +110,35 @@
}
// HttpTransaction methods:
- virtual int Start(const HttpRequestInfo* request_info,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
- virtual int RestartIgnoringLastError(
- const CompletionCallback& callback) override;
- virtual int RestartWithCertificate(
- X509Certificate* client_cert,
- const CompletionCallback& callback) override;
- virtual int RestartWithAuth(const AuthCredentials& credentials,
- const CompletionCallback& callback) override;
- virtual bool IsReadyToRestartForAuth() override;
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual void StopCaching() override;
- virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual void DoneReading() override;
- virtual const HttpResponseInfo* GetResponseInfo() const override;
- virtual LoadState GetLoadState() const override;
- virtual UploadProgress GetUploadProgress(void) const override;
- virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) override;
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual void SetPriority(RequestPriority priority) override;
- virtual void SetWebSocketHandshakeStreamCreateHelper(
+ int Start(const HttpRequestInfo* request_info,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
+ int RestartIgnoringLastError(const CompletionCallback& callback) override;
+ int RestartWithCertificate(X509Certificate* client_cert,
+ const CompletionCallback& callback) override;
+ int RestartWithAuth(const AuthCredentials& credentials,
+ const CompletionCallback& callback) override;
+ bool IsReadyToRestartForAuth() override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void StopCaching() override;
+ bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override;
+ int64 GetTotalReceivedBytes() const override;
+ void DoneReading() override;
+ const HttpResponseInfo* GetResponseInfo() const override;
+ LoadState GetLoadState() const override;
+ UploadProgress GetUploadProgress(void) const override;
+ void SetQuicServerInfo(QuicServerInfo* quic_server_info) override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void SetPriority(RequestPriority priority) override;
+ void SetWebSocketHandshakeStreamCreateHelper(
net::WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
- virtual void SetBeforeNetworkStartCallback(
+ void SetBeforeNetworkStartCallback(
const BeforeNetworkStartCallback& callback) override;
- virtual void SetBeforeProxyHeadersSentCallback(
+ void SetBeforeProxyHeadersSentCallback(
const BeforeProxyHeadersSentCallback& callback) override;
- virtual int ResumeNetworkStart() override;
+ int ResumeNetworkStart() override;
private:
static const size_t kNumValidationHeaders = 2;
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 0b05057..a0225e8 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -496,12 +496,13 @@
class FakeWebSocketHandshakeStreamCreateHelper
: public net::WebSocketHandshakeStreamBase::CreateHelper {
public:
- virtual ~FakeWebSocketHandshakeStreamCreateHelper() {}
- virtual net::WebSocketHandshakeStreamBase* CreateBasicStream(
- scoped_ptr<net::ClientSocketHandle> connect, bool using_proxy) override {
+ ~FakeWebSocketHandshakeStreamCreateHelper() override {}
+ net::WebSocketHandshakeStreamBase* CreateBasicStream(
+ scoped_ptr<net::ClientSocketHandle> connect,
+ bool using_proxy) override {
return NULL;
}
- virtual net::WebSocketHandshakeStreamBase* CreateSpdyStream(
+ net::WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<net::SpdySession>& session,
bool use_relative_url) override {
return NULL;
diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h
index 58b02f2..13b0c79 100644
--- a/net/http/http_network_layer.h
+++ b/net/http/http_network_layer.h
@@ -28,7 +28,7 @@
// Construct a HttpNetworkLayer with an existing HttpNetworkSession which
// contains a valid ProxyService.
explicit HttpNetworkLayer(HttpNetworkSession* session);
- virtual ~HttpNetworkLayer();
+ ~HttpNetworkLayer() override;
// Create a transaction factory that instantiate a network layer over an
// existing network session. Network session contains some valuable
@@ -43,14 +43,14 @@
static void ForceAlternateProtocol();
// HttpTransactionFactory methods:
- virtual int CreateTransaction(RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) override;
- virtual HttpCache* GetCache() override;
- virtual HttpNetworkSession* GetSession() override;
+ int CreateTransaction(RequestPriority priority,
+ scoped_ptr<HttpTransaction>* trans) override;
+ HttpCache* GetCache() override;
+ HttpNetworkSession* GetSession() override;
// base::PowerObserver methods:
- virtual void OnSuspend() override;
- virtual void OnResume() override;
+ void OnSuspend() override;
+ void OnResume() override;
private:
const scoped_refptr<HttpNetworkSession> session_;
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index 57ebdf7..c7c217d 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -42,68 +42,62 @@
HttpNetworkTransaction(RequestPriority priority,
HttpNetworkSession* session);
- virtual ~HttpNetworkTransaction();
+ ~HttpNetworkTransaction() override;
// HttpTransaction methods:
- virtual int Start(const HttpRequestInfo* request_info,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
- virtual int RestartIgnoringLastError(
- const CompletionCallback& callback) override;
- virtual int RestartWithCertificate(
- X509Certificate* client_cert,
- const CompletionCallback& callback) override;
- virtual int RestartWithAuth(const AuthCredentials& credentials,
- const CompletionCallback& callback) override;
- virtual bool IsReadyToRestartForAuth() override;
+ int Start(const HttpRequestInfo* request_info,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
+ int RestartIgnoringLastError(const CompletionCallback& callback) override;
+ int RestartWithCertificate(X509Certificate* client_cert,
+ const CompletionCallback& callback) override;
+ int RestartWithAuth(const AuthCredentials& credentials,
+ const CompletionCallback& callback) override;
+ bool IsReadyToRestartForAuth() override;
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual void StopCaching() override;
- virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual void DoneReading() override;
- virtual const HttpResponseInfo* GetResponseInfo() const override;
- virtual LoadState GetLoadState() const override;
- virtual UploadProgress GetUploadProgress() const override;
- virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) override;
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual void SetPriority(RequestPriority priority) override;
- virtual void SetWebSocketHandshakeStreamCreateHelper(
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void StopCaching() override;
+ bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override;
+ int64 GetTotalReceivedBytes() const override;
+ void DoneReading() override;
+ const HttpResponseInfo* GetResponseInfo() const override;
+ LoadState GetLoadState() const override;
+ UploadProgress GetUploadProgress() const override;
+ void SetQuicServerInfo(QuicServerInfo* quic_server_info) override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void SetPriority(RequestPriority priority) override;
+ void SetWebSocketHandshakeStreamCreateHelper(
WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
- virtual void SetBeforeNetworkStartCallback(
+ void SetBeforeNetworkStartCallback(
const BeforeNetworkStartCallback& callback) override;
- virtual void SetBeforeProxyHeadersSentCallback(
+ void SetBeforeProxyHeadersSentCallback(
const BeforeProxyHeadersSentCallback& callback) override;
- virtual int ResumeNetworkStart() override;
+ int ResumeNetworkStart() override;
// HttpStreamRequest::Delegate methods:
- virtual void OnStreamReady(const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) override;
- virtual void OnWebSocketHandshakeStreamReady(
+ void OnStreamReady(const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpStreamBase* stream) override;
+ void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
WebSocketHandshakeStreamBase* stream) override;
- virtual void OnStreamFailed(int status,
- const SSLConfig& used_ssl_config) override;
- virtual void OnCertificateError(int status,
+ void OnStreamFailed(int status, const SSLConfig& used_ssl_config) override;
+ void OnCertificateError(int status,
+ const SSLConfig& used_ssl_config,
+ const SSLInfo& ssl_info) override;
+ void OnNeedsProxyAuth(const HttpResponseInfo& response_info,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpAuthController* auth_controller) override;
+ void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
+ SSLCertRequestInfo* cert_info) override;
+ void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
const SSLConfig& used_ssl_config,
- const SSLInfo& ssl_info) override;
- virtual void OnNeedsProxyAuth(
- const HttpResponseInfo& response_info,
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpAuthController* auth_controller) override;
- virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
- SSLCertRequestInfo* cert_info) override;
- virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) override;
+ const ProxyInfo& used_proxy_info,
+ HttpStreamBase* stream) override;
private:
friend class HttpNetworkTransactionSSLTest;
diff --git a/net/http/http_network_transaction_ssl_unittest.cc b/net/http/http_network_transaction_ssl_unittest.cc
index 7b95f79..a84076e 100644
--- a/net/http/http_network_transaction_ssl_unittest.cc
+++ b/net/http/http_network_transaction_ssl_unittest.cc
@@ -31,12 +31,10 @@
ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1;
}
- virtual void GetSSLConfig(SSLConfig* config) override {
- *config = ssl_config_;
- }
+ void GetSSLConfig(SSLConfig* config) override { *config = ssl_config_; }
private:
- virtual ~TLS10SSLConfigService() {}
+ ~TLS10SSLConfigService() override {}
SSLConfig ssl_config_;
};
@@ -48,12 +46,10 @@
ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_1;
}
- virtual void GetSSLConfig(SSLConfig* config) override {
- *config = ssl_config_;
- }
+ void GetSSLConfig(SSLConfig* config) override { *config = ssl_config_; }
private:
- virtual ~TLS11SSLConfigService() {}
+ ~TLS11SSLConfigService() override {}
SSLConfig ssl_config_;
};
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index ca26d6f..e4a75b9 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -8191,20 +8191,20 @@
class FakeUploadElementReader : public UploadElementReader {
public:
FakeUploadElementReader() {}
- virtual ~FakeUploadElementReader() {}
+ ~FakeUploadElementReader() override {}
const CompletionCallback& callback() const { return callback_; }
// UploadElementReader overrides:
- virtual int Init(const CompletionCallback& callback) override {
+ int Init(const CompletionCallback& callback) override {
callback_ = callback;
return ERR_IO_PENDING;
}
- virtual uint64 GetContentLength() const override { return 0; }
- virtual uint64 BytesRemaining() const override { return 0; }
- virtual int Read(IOBuffer* buf,
- int buf_length,
- const CompletionCallback& callback) override {
+ uint64 GetContentLength() const override { return 0; }
+ uint64 BytesRemaining() const override { return 0; }
+ int Read(IOBuffer* buf,
+ int buf_length,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
@@ -9097,13 +9097,13 @@
class CapturingProxyResolver : public ProxyResolver {
public:
CapturingProxyResolver() : ProxyResolver(false /* expects_pac_bytes */) {}
- virtual ~CapturingProxyResolver() {}
+ ~CapturingProxyResolver() override {}
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override {
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override {
ProxyServer proxy_server(ProxyServer::SCHEME_HTTP,
HostPortPair("myproxy", 80));
results->UseProxyServer(proxy_server);
@@ -9111,21 +9111,17 @@
return OK;
}
- virtual void CancelRequest(RequestHandle request) override {
- NOTREACHED();
- }
+ void CancelRequest(RequestHandle request) override { NOTREACHED(); }
- virtual LoadState GetLoadState(RequestHandle request) const override {
+ LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() override {
- NOTREACHED();
- }
+ void CancelSetPacScript() override { NOTREACHED(); }
- virtual int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&,
- const CompletionCallback& /*callback*/) override {
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&,
+ const CompletionCallback& /*callback*/) override {
return OK;
}
@@ -10060,13 +10056,13 @@
public:
explicit UrlRecordingHttpAuthHandlerMock(GURL* url) : url_(url) {}
- virtual ~UrlRecordingHttpAuthHandlerMock() {}
+ ~UrlRecordingHttpAuthHandlerMock() override {}
protected:
- virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- const CompletionCallback& callback,
- std::string* auth_token) override {
+ int GenerateAuthTokenImpl(const AuthCredentials* credentials,
+ const HttpRequestInfo* request,
+ const CompletionCallback& callback,
+ std::string* auth_token) override {
*url_ = request->url;
return HttpAuthHandlerMock::GenerateAuthTokenImpl(
credentials, request, callback, auth_token);
@@ -11153,31 +11149,31 @@
public:
explicit OneTimeCachingHostResolver(const HostPortPair& host_port)
: host_port_(host_port) {}
- virtual ~OneTimeCachingHostResolver() {}
+ ~OneTimeCachingHostResolver() override {}
RuleBasedHostResolverProc* rules() { return host_resolver_.rules(); }
// HostResolver methods:
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override {
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override {
return host_resolver_.Resolve(
info, priority, addresses, callback, out_req, net_log);
}
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override {
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override {
int rv = host_resolver_.ResolveFromCache(info, addresses, net_log);
if (rv == OK && info.host_port_pair().Equals(host_port_))
host_resolver_.GetHostCache()->clear();
return rv;
}
- virtual void CancelRequest(RequestHandle req) override {
+ void CancelRequest(RequestHandle req) override {
host_resolver_.CancelRequest(req);
}
@@ -12202,92 +12198,81 @@
public base::SupportsWeakPtr<FakeStream> {
public:
explicit FakeStream(RequestPriority priority) : priority_(priority) {}
- virtual ~FakeStream() {}
+ ~FakeStream() override {}
RequestPriority priority() const { return priority_; }
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override {
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override {
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
+ int ReadResponseHeaders(const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual void Close(bool not_reusable) override {}
+ void Close(bool not_reusable) override {}
- virtual bool IsResponseBodyComplete() const override {
+ bool IsResponseBodyComplete() const override {
ADD_FAILURE();
return false;
}
- virtual bool CanFindEndOfResponse() const override {
- return false;
- }
+ bool CanFindEndOfResponse() const override { return false; }
- virtual bool IsConnectionReused() const override {
+ bool IsConnectionReused() const override {
ADD_FAILURE();
return false;
}
- virtual void SetConnectionReused() override {
- ADD_FAILURE();
- }
+ void SetConnectionReused() override { ADD_FAILURE(); }
- virtual bool IsConnectionReusable() const override {
+ bool IsConnectionReusable() const override {
ADD_FAILURE();
return false;
}
- virtual int64 GetTotalReceivedBytes() const override {
+ int64 GetTotalReceivedBytes() const override {
ADD_FAILURE();
return 0;
}
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override {
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override {
ADD_FAILURE();
return false;
}
- virtual void GetSSLInfo(SSLInfo* ssl_info) override {
+ void GetSSLInfo(SSLInfo* ssl_info) override { ADD_FAILURE(); }
+
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {
ADD_FAILURE();
}
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override {
- ADD_FAILURE();
- }
-
- virtual bool IsSpdyHttpStream() const override {
+ bool IsSpdyHttpStream() const override {
ADD_FAILURE();
return false;
}
- virtual void Drain(HttpNetworkSession* session) override {
- ADD_FAILURE();
- }
+ void Drain(HttpNetworkSession* session) override { ADD_FAILURE(); }
- virtual void SetPriority(RequestPriority priority) override {
- priority_ = priority;
- }
+ void SetPriority(RequestPriority priority) override { priority_ = priority; }
private:
RequestPriority priority_;
@@ -12313,7 +12298,7 @@
delegate_(delegate),
websocket_stream_create_helper_(create_helper) {}
- virtual ~FakeStreamRequest() {}
+ ~FakeStreamRequest() override {}
RequestPriority priority() const { return priority_; }
@@ -12333,32 +12318,23 @@
return weak_stream;
}
- virtual int RestartTunnelWithProxyAuth(
- const AuthCredentials& credentials) override {
+ int RestartTunnelWithProxyAuth(const AuthCredentials& credentials) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual LoadState GetLoadState() const override {
+ LoadState GetLoadState() const override {
ADD_FAILURE();
return LoadState();
}
- virtual void SetPriority(RequestPriority priority) override {
- priority_ = priority;
- }
+ void SetPriority(RequestPriority priority) override { priority_ = priority; }
- virtual bool was_npn_negotiated() const override {
- return false;
- }
+ bool was_npn_negotiated() const override { return false; }
- virtual NextProto protocol_negotiated() const override {
- return kProtoUnknown;
- }
+ NextProto protocol_negotiated() const override { return kProtoUnknown; }
- virtual bool using_spdy() const override {
- return false;
- }
+ bool using_spdy() const override { return false; }
private:
RequestPriority priority_;
@@ -12372,7 +12348,7 @@
class FakeStreamFactory : public HttpStreamFactory {
public:
FakeStreamFactory() {}
- virtual ~FakeStreamFactory() {}
+ ~FakeStreamFactory() override {}
// Returns a WeakPtr<> to the last HttpStreamRequest returned by
// RequestStream() (which may be NULL if it was destroyed already).
@@ -12380,19 +12356,18 @@
return last_stream_request_;
}
- virtual HttpStreamRequest* RequestStream(
- const HttpRequestInfo& info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HttpStreamRequest::Delegate* delegate,
- const BoundNetLog& net_log) override {
+ HttpStreamRequest* RequestStream(const HttpRequestInfo& info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HttpStreamRequest::Delegate* delegate,
+ const BoundNetLog& net_log) override {
FakeStreamRequest* fake_request = new FakeStreamRequest(priority, delegate);
last_stream_request_ = fake_request->AsWeakPtr();
return fake_request;
}
- virtual HttpStreamRequest* RequestWebSocketHandshakeStream(
+ HttpStreamRequest* RequestWebSocketHandshakeStream(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
@@ -12406,15 +12381,15 @@
return fake_request;
}
- virtual void PreconnectStreams(int num_streams,
- const HttpRequestInfo& info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config) override {
+ void PreconnectStreams(int num_streams,
+ const HttpRequestInfo& info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config) override {
ADD_FAILURE();
}
- virtual const HostMappingRules* GetHostMappingRules() const override {
+ const HostMappingRules* GetHostMappingRules() const override {
ADD_FAILURE();
return NULL;
}
@@ -12430,21 +12405,21 @@
class FakeWebSocketStreamCreateHelper :
public WebSocketHandshakeStreamBase::CreateHelper {
public:
- virtual WebSocketHandshakeStreamBase* CreateBasicStream(
+ WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
bool using_proxy) override {
NOTREACHED();
return NULL;
}
- virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
+ WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& session,
bool use_relative_url) override {
NOTREACHED();
return NULL;
};
- virtual ~FakeWebSocketStreamCreateHelper() {}
+ ~FakeWebSocketStreamCreateHelper() override {}
virtual scoped_ptr<WebSocketStream> Upgrade() {
NOTREACHED();
diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h
index 87eeda4..e4f8382 100644
--- a/net/http/http_proxy_client_socket.h
+++ b/net/http/http_proxy_client_socket.h
@@ -52,42 +52,41 @@
bool is_https_proxy);
// On destruction Disconnect() is called.
- virtual ~HttpProxyClientSocket();
+ ~HttpProxyClientSocket() override;
// ProxyClientSocket implementation.
- virtual const HttpResponseInfo* GetConnectResponseInfo() const override;
- virtual HttpStream* CreateConnectResponseStream() override;
- virtual int RestartWithAuth(const CompletionCallback& callback) override;
- virtual const scoped_refptr<HttpAuthController>& GetAuthController() const
- override;
- virtual bool IsUsingSpdy() const override;
- virtual NextProto GetProtocolNegotiated() const override;
+ const HttpResponseInfo* GetConnectResponseInfo() const override;
+ HttpStream* CreateConnectResponseStream() override;
+ int RestartWithAuth(const CompletionCallback& callback) override;
+ const scoped_refptr<HttpAuthController>& GetAuthController() const override;
+ bool IsUsingSpdy() const override;
+ NextProto GetProtocolNegotiated() const override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
private:
enum State {
diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h
index 9dac090..988191b 100644
--- a/net/http/http_proxy_client_socket_pool.h
+++ b/net/http/http_proxy_client_socket_pool.h
@@ -111,12 +111,12 @@
HostResolver* host_resolver,
Delegate* delegate,
NetLog* net_log);
- virtual ~HttpProxyConnectJob();
+ ~HttpProxyConnectJob() override;
// ConnectJob methods.
- virtual LoadState GetLoadState() const override;
+ LoadState GetLoadState() const override;
- virtual void GetAdditionalErrorState(ClientSocketHandle* handle) override;
+ void GetAdditionalErrorState(ClientSocketHandle* handle) override;
private:
enum State {
@@ -157,7 +157,7 @@
// that the tunnel needs authentication credentials, the socket will be
// returned in this case, and must be release back to the pool; or
// a standard net error code will be returned.
- virtual int ConnectInternal() override;
+ int ConnectInternal() override;
scoped_refptr<HttpProxySocketParams> params_;
TransportClientSocketPool* const transport_pool_;
@@ -197,59 +197,57 @@
const ProxyDelegate* proxy_delegate,
NetLog* net_log);
- virtual ~HttpProxyClientSocketPool();
+ ~HttpProxyClientSocketPool() override;
// ClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* connect_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
+ int RequestSocket(const std::string& group_name,
+ const void* connect_params,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
- virtual void RequestSockets(const std::string& group_name,
- const void* params,
- int num_sockets,
- const BoundNetLog& net_log) override;
+ void RequestSockets(const std::string& group_name,
+ const void* params,
+ int num_sockets,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
- virtual void FlushWithError(int error) override;
+ void FlushWithError(int error) override;
- virtual void CloseIdleSockets() override;
+ void CloseIdleSockets() override;
- virtual int IdleSocketCount() const override;
+ int IdleSocketCount() const override;
- virtual int IdleSocketCountInGroup(
- const std::string& group_name) const override;
+ int IdleSocketCountInGroup(const std::string& group_name) const override;
- virtual LoadState GetLoadState(
- const std::string& group_name,
- const ClientSocketHandle* handle) const override;
+ LoadState GetLoadState(const std::string& group_name,
+ const ClientSocketHandle* handle) const override;
- virtual base::DictionaryValue* GetInfoAsValue(
+ base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const override;
+ ClientSocketPoolHistograms* histograms() const override;
// LowerLayeredPool implementation.
- virtual bool IsStalled() const override;
+ bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
// HigherLayeredPool implementation.
- virtual bool CloseOneIdleConnection() override;
+ bool CloseOneIdleConnection() override;
private:
typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase;
@@ -264,12 +262,12 @@
NetLog* net_log);
// ClientSocketPoolBase::ConnectJobFactory methods.
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc
index 98b7322..d256646 100644
--- a/net/http/http_proxy_client_socket_pool_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -66,8 +66,7 @@
on_tunnel_headers_received_called_(false) {
}
- virtual ~TestProxyDelegate() override {
- }
+ ~TestProxyDelegate() override {}
bool on_before_tunnel_request_called() const {
return on_before_tunnel_request_called_;
@@ -89,31 +88,26 @@
}
// ProxyDelegate:
- virtual void OnResolveProxy(const GURL& url,
- int load_flags,
- const ProxyService& proxy_service,
- ProxyInfo* result) override {
- }
+ void OnResolveProxy(const GURL& url,
+ int load_flags,
+ const ProxyService& proxy_service,
+ ProxyInfo* result) override {}
- virtual void OnFallback(const ProxyServer& bad_proxy,
- int net_error) override {
- }
+ void OnFallback(const ProxyServer& bad_proxy, int net_error) override {}
- virtual void OnBeforeSendHeaders(URLRequest* request,
- const ProxyInfo& proxy_info,
- HttpRequestHeaders* headers) override {
- }
+ void OnBeforeSendHeaders(URLRequest* request,
+ const ProxyInfo& proxy_info,
+ HttpRequestHeaders* headers) override {}
- virtual void OnBeforeTunnelRequest(
- const net::HostPortPair& proxy_server,
- net::HttpRequestHeaders* extra_headers) override {
+ void OnBeforeTunnelRequest(const net::HostPortPair& proxy_server,
+ net::HttpRequestHeaders* extra_headers) override {
on_before_tunnel_request_called_ = true;
if (extra_headers) {
extra_headers->SetHeader("Foo", proxy_server.ToString());
}
}
- virtual void OnTunnelHeadersReceived(
+ void OnTunnelHeadersReceived(
const net::HostPortPair& origin,
const net::HostPortPair& proxy_server,
const net::HttpResponseHeaders& response_headers) override {
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc
index 5a8713c..cb2f1a9 100644
--- a/net/http/http_response_body_drainer_unittest.cc
+++ b/net/http/http_response_body_drainer_unittest.cc
@@ -74,59 +74,56 @@
is_last_chunk_zero_size_(false),
is_complete_(false),
weak_factory_(this) {}
- virtual ~MockHttpStream() {}
+ ~MockHttpStream() override {}
// HttpStream implementation.
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override {
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override {
return ERR_UNEXPECTED;
}
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override {
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override {
return ERR_UNEXPECTED;
}
- virtual UploadProgress GetUploadProgress() const override {
- return UploadProgress();
- }
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
+ UploadProgress GetUploadProgress() const override { return UploadProgress(); }
+ int ReadResponseHeaders(const CompletionCallback& callback) override {
return ERR_UNEXPECTED;
}
- virtual bool CanFindEndOfResponse() const override { return true; }
- virtual bool IsConnectionReused() const override { return false; }
- virtual void SetConnectionReused() override {}
- virtual bool IsConnectionReusable() const override { return false; }
- virtual int64 GetTotalReceivedBytes() const override { return 0; }
- virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override {}
+ bool CanFindEndOfResponse() const override { return true; }
+ bool IsConnectionReused() const override { return false; }
+ void SetConnectionReused() override {}
+ bool IsConnectionReusable() const override { return false; }
+ int64 GetTotalReceivedBytes() const override { return 0; }
+ void GetSSLInfo(SSLInfo* ssl_info) override {}
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {}
// Mocked API
- virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual void Close(bool not_reusable) override {
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void Close(bool not_reusable) override {
CHECK(!closed_);
closed_ = true;
result_waiter_->set_result(not_reusable);
}
- virtual HttpStream* RenewStreamForAuth() override {
- return NULL;
+ HttpStream* RenewStreamForAuth() override { return NULL; }
+
+ bool IsResponseBodyComplete() const override { return is_complete_; }
+
+ bool IsSpdyHttpStream() const override { return false; }
+
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override {
+ return false;
}
- virtual bool IsResponseBodyComplete() const override { return is_complete_; }
+ void Drain(HttpNetworkSession*) override {}
- virtual bool IsSpdyHttpStream() const override { return false; }
-
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override { return false; }
-
- virtual void Drain(HttpNetworkSession*) override {}
-
- virtual void SetPriority(RequestPriority priority) override {}
+ void SetPriority(RequestPriority priority) override {}
// Methods to tweak/observer mock behavior:
void set_stall_reads_forever() { stall_reads_forever_ = true; }
diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h
index b68db36..7b5f2f6 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -30,7 +30,7 @@
NON_EXPORTED_BASE(public base::NonThreadSafe) {
public:
HttpServerPropertiesImpl();
- virtual ~HttpServerPropertiesImpl();
+ ~HttpServerPropertiesImpl() override;
// Initializes |spdy_servers_map_| with the servers (host/port) from
// |spdy_servers| that either support SPDY or not.
@@ -69,94 +69,89 @@
// -----------------------------
// Gets a weak pointer for this object.
- virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() override;
+ base::WeakPtr<HttpServerProperties> GetWeakPtr() override;
// Deletes all data.
- virtual void Clear() override;
+ void Clear() override;
// Returns true if |server| supports SPDY.
- virtual bool SupportsSpdy(const HostPortPair& server) override;
+ bool SupportsSpdy(const HostPortPair& server) override;
// Add |server| into the persistent store.
- virtual void SetSupportsSpdy(const HostPortPair& server,
- bool support_spdy) override;
+ void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override;
// Returns true if |server| has an Alternate-Protocol header.
- virtual bool HasAlternateProtocol(const HostPortPair& server) override;
+ bool HasAlternateProtocol(const HostPortPair& server) override;
// Returns the Alternate-Protocol and port for |server|.
// HasAlternateProtocol(server) must be true.
- virtual AlternateProtocolInfo GetAlternateProtocol(
+ AlternateProtocolInfo GetAlternateProtocol(
const HostPortPair& server) override;
// Sets the Alternate-Protocol for |server|.
- virtual void SetAlternateProtocol(
- const HostPortPair& server,
- uint16 alternate_port,
- AlternateProtocol alternate_protocol,
- double probability) override;
+ void SetAlternateProtocol(const HostPortPair& server,
+ uint16 alternate_port,
+ AlternateProtocol alternate_protocol,
+ double probability) override;
// Sets the Alternate-Protocol for |server| to be BROKEN.
- virtual void SetBrokenAlternateProtocol(const HostPortPair& server) override;
+ void SetBrokenAlternateProtocol(const HostPortPair& server) override;
// Returns true if Alternate-Protocol for |server| was recently BROKEN.
- virtual bool WasAlternateProtocolRecentlyBroken(
- const HostPortPair& server) override;
+ bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override;
// Confirms that Alternate-Protocol for |server| is working.
- virtual void ConfirmAlternateProtocol(const HostPortPair& server) override;
+ void ConfirmAlternateProtocol(const HostPortPair& server) override;
// Clears the Alternate-Protocol for |server|.
- virtual void ClearAlternateProtocol(const HostPortPair& server) override;
+ void ClearAlternateProtocol(const HostPortPair& server) override;
// Returns all Alternate-Protocol mappings.
- virtual const AlternateProtocolMap& alternate_protocol_map() const override;
+ const AlternateProtocolMap& alternate_protocol_map() const override;
- virtual void SetAlternateProtocolExperiment(
+ void SetAlternateProtocolExperiment(
AlternateProtocolExperiment experiment) override;
- virtual void SetAlternateProtocolProbabilityThreshold(
- double threshold) override;
+ void SetAlternateProtocolProbabilityThreshold(double threshold) override;
- virtual AlternateProtocolExperiment GetAlternateProtocolExperiment()
- const override;
+ AlternateProtocolExperiment GetAlternateProtocolExperiment() const override;
// Gets a reference to the SettingsMap stored for a host.
// If no settings are stored, returns an empty SettingsMap.
- virtual const SettingsMap& GetSpdySettings(
+ const SettingsMap& GetSpdySettings(
const HostPortPair& host_port_pair) override;
// Saves an individual SPDY setting for a host. Returns true if SPDY setting
// is to be persisted.
- virtual bool SetSpdySetting(const HostPortPair& host_port_pair,
- SpdySettingsIds id,
- SpdySettingsFlags flags,
- uint32 value) override;
+ bool SetSpdySetting(const HostPortPair& host_port_pair,
+ SpdySettingsIds id,
+ SpdySettingsFlags flags,
+ uint32 value) override;
// Clears all entries in |spdy_settings_map_| for a host.
- virtual void ClearSpdySettings(const HostPortPair& host_port_pair) override;
+ void ClearSpdySettings(const HostPortPair& host_port_pair) override;
// Clears all entries in |spdy_settings_map_|.
- virtual void ClearAllSpdySettings() override;
+ void ClearAllSpdySettings() override;
// Returns all persistent SPDY settings.
- virtual const SpdySettingsMap& spdy_settings_map() const override;
+ const SpdySettingsMap& spdy_settings_map() const override;
// Methods for SupportsQuic.
- virtual SupportsQuic GetSupportsQuic(
+ SupportsQuic GetSupportsQuic(
const HostPortPair& host_port_pair) const override;
- virtual void SetSupportsQuic(const HostPortPair& host_port_pair,
- bool used_quic,
- const std::string& address) override;
+ void SetSupportsQuic(const HostPortPair& host_port_pair,
+ bool used_quic,
+ const std::string& address) override;
- virtual const SupportsQuicMap& supports_quic_map() const override;
+ const SupportsQuicMap& supports_quic_map() const override;
// Methods for NetworkStats.
- virtual void SetServerNetworkStats(const HostPortPair& host_port_pair,
- NetworkStats stats) override;
+ void SetServerNetworkStats(const HostPortPair& host_port_pair,
+ NetworkStats stats) override;
- virtual const NetworkStats* GetServerNetworkStats(
+ const NetworkStats* GetServerNetworkStats(
const HostPortPair& host_port_pair) const override;
private:
diff --git a/net/http/http_server_properties_manager.h b/net/http/http_server_properties_manager.h
index bcfe320..79506c4 100644
--- a/net/http/http_server_properties_manager.h
+++ b/net/http/http_server_properties_manager.h
@@ -57,7 +57,7 @@
PrefService* pref_service,
const char* pref_path,
scoped_refptr<base::SequencedTaskRunner> network_task_runner);
- virtual ~HttpServerPropertiesManager();
+ ~HttpServerPropertiesManager() override;
// Initialize on Network thread.
void InitializeOnNetworkThread();
@@ -78,95 +78,90 @@
// ----------------------------------
// Gets a weak pointer for this object.
- virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() override;
+ base::WeakPtr<HttpServerProperties> GetWeakPtr() override;
// Deletes all data. Works asynchronously.
- virtual void Clear() override;
+ void Clear() override;
// Returns true if |server| supports SPDY. Should only be called from IO
// thread.
- virtual bool SupportsSpdy(const HostPortPair& server) override;
+ bool SupportsSpdy(const HostPortPair& server) override;
// Add |server| as the SPDY server which supports SPDY protocol into the
// persisitent store. Should only be called from IO thread.
- virtual void SetSupportsSpdy(const HostPortPair& server,
- bool support_spdy) override;
+ void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override;
// Returns true if |server| has an Alternate-Protocol header.
- virtual bool HasAlternateProtocol(const HostPortPair& server) override;
+ bool HasAlternateProtocol(const HostPortPair& server) override;
// Returns the Alternate-Protocol and port for |server|.
// HasAlternateProtocol(server) must be true.
- virtual AlternateProtocolInfo GetAlternateProtocol(
+ AlternateProtocolInfo GetAlternateProtocol(
const HostPortPair& server) override;
// Sets the Alternate-Protocol for |server|.
- virtual void SetAlternateProtocol(
- const HostPortPair& server,
- uint16 alternate_port,
- AlternateProtocol alternate_protocol,
- double alternate_probability) override;
+ void SetAlternateProtocol(const HostPortPair& server,
+ uint16 alternate_port,
+ AlternateProtocol alternate_protocol,
+ double alternate_probability) override;
// Sets the Alternate-Protocol for |server| to be BROKEN.
- virtual void SetBrokenAlternateProtocol(const HostPortPair& server) override;
+ void SetBrokenAlternateProtocol(const HostPortPair& server) override;
// Returns true if Alternate-Protocol for |server| was recently BROKEN.
- virtual bool WasAlternateProtocolRecentlyBroken(
- const HostPortPair& server) override;
+ bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override;
// Confirms that Alternate-Protocol for |server| is working.
- virtual void ConfirmAlternateProtocol(const HostPortPair& server) override;
+ void ConfirmAlternateProtocol(const HostPortPair& server) override;
// Clears the Alternate-Protocol for |server|.
- virtual void ClearAlternateProtocol(const HostPortPair& server) override;
+ void ClearAlternateProtocol(const HostPortPair& server) override;
// Returns all Alternate-Protocol mappings.
- virtual const AlternateProtocolMap& alternate_protocol_map() const override;
+ const AlternateProtocolMap& alternate_protocol_map() const override;
- virtual void SetAlternateProtocolExperiment(
+ void SetAlternateProtocolExperiment(
AlternateProtocolExperiment experiment) override;
- virtual void SetAlternateProtocolProbabilityThreshold(
- double threshold) override;
+ void SetAlternateProtocolProbabilityThreshold(double threshold) override;
- virtual AlternateProtocolExperiment GetAlternateProtocolExperiment()
- const override;
+ AlternateProtocolExperiment GetAlternateProtocolExperiment() const override;
// Gets a reference to the SettingsMap stored for a host.
// If no settings are stored, returns an empty SettingsMap.
- virtual const SettingsMap& GetSpdySettings(
+ const SettingsMap& GetSpdySettings(
const HostPortPair& host_port_pair) override;
// Saves an individual SPDY setting for a host. Returns true if SPDY setting
// is to be persisted.
- virtual bool SetSpdySetting(const HostPortPair& host_port_pair,
- SpdySettingsIds id,
- SpdySettingsFlags flags,
- uint32 value) override;
+ bool SetSpdySetting(const HostPortPair& host_port_pair,
+ SpdySettingsIds id,
+ SpdySettingsFlags flags,
+ uint32 value) override;
// Clears all SPDY settings for a host.
- virtual void ClearSpdySettings(const HostPortPair& host_port_pair) override;
+ void ClearSpdySettings(const HostPortPair& host_port_pair) override;
// Clears all SPDY settings for all hosts.
- virtual void ClearAllSpdySettings() override;
+ void ClearAllSpdySettings() override;
// Returns all SPDY persistent settings.
- virtual const SpdySettingsMap& spdy_settings_map() const override;
+ const SpdySettingsMap& spdy_settings_map() const override;
// Methods for SupportsQuic.
- virtual SupportsQuic GetSupportsQuic(
+ SupportsQuic GetSupportsQuic(
const HostPortPair& host_port_pair) const override;
- virtual void SetSupportsQuic(const HostPortPair& host_port_pair,
- bool used_quic,
- const std::string& address) override;
+ void SetSupportsQuic(const HostPortPair& host_port_pair,
+ bool used_quic,
+ const std::string& address) override;
- virtual const SupportsQuicMap& supports_quic_map() const override;
+ const SupportsQuicMap& supports_quic_map() const override;
- virtual void SetServerNetworkStats(const HostPortPair& host_port_pair,
- NetworkStats stats) override;
+ void SetServerNetworkStats(const HostPortPair& host_port_pair,
+ NetworkStats stats) override;
- virtual const NetworkStats* GetServerNetworkStats(
+ const NetworkStats* GetServerNetworkStats(
const HostPortPair& host_port_pair) const override;
protected:
diff --git a/net/http/http_stream.h b/net/http/http_stream.h
index 22362e2..3dda50b 100644
--- a/net/http/http_stream.h
+++ b/net/http/http_stream.h
@@ -24,7 +24,7 @@
class NET_EXPORT_PRIVATE HttpStream : public HttpStreamBase {
public:
HttpStream() {}
- virtual ~HttpStream() {}
+ ~HttpStream() override {}
// Queries the UploadDataStream for its progress (bytes sent).
virtual UploadProgress GetUploadProgress() const = 0;
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h
index 91a59c2..8ee03a6 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -29,18 +29,17 @@
// RequestWebSocketHandshakeStream may only be called if |for_websockets|
// is true.
HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets);
- virtual ~HttpStreamFactoryImpl();
+ ~HttpStreamFactoryImpl() override;
// HttpStreamFactory interface
- virtual HttpStreamRequest* RequestStream(
- const HttpRequestInfo& info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HttpStreamRequest::Delegate* delegate,
- const BoundNetLog& net_log) override;
+ HttpStreamRequest* RequestStream(const HttpRequestInfo& info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HttpStreamRequest::Delegate* delegate,
+ const BoundNetLog& net_log) override;
- virtual HttpStreamRequest* RequestWebSocketHandshakeStream(
+ HttpStreamRequest* RequestWebSocketHandshakeStream(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
@@ -49,12 +48,12 @@
WebSocketHandshakeStreamBase::CreateHelper* create_helper,
const BoundNetLog& net_log) override;
- virtual void PreconnectStreams(int num_streams,
- const HttpRequestInfo& info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config) override;
- virtual const HostMappingRules* GetHostMappingRules() const override;
+ void PreconnectStreams(int num_streams,
+ const HttpRequestInfo& info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config) override;
+ const HostMappingRules* GetHostMappingRules() const override;
size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); }
diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h
index 3ab7d95..70def25 100644
--- a/net/http/http_stream_factory_impl_request.h
+++ b/net/http/http_stream_factory_impl_request.h
@@ -27,7 +27,7 @@
WebSocketHandshakeStreamBase::CreateHelper*
websocket_handshake_stream_create_helper,
const BoundNetLog& net_log);
- virtual ~Request();
+ ~Request() override;
// The GURL from the HttpRequestInfo the started the Request.
const GURL& url() const { return url_; }
@@ -98,13 +98,12 @@
// HttpStreamRequest methods.
- virtual int RestartTunnelWithProxyAuth(
- const AuthCredentials& credentials) override;
- virtual void SetPriority(RequestPriority priority) override;
- virtual LoadState GetLoadState() const override;
- virtual bool was_npn_negotiated() const override;
- virtual NextProto protocol_negotiated() const override;
- virtual bool using_spdy() const override;
+ int RestartTunnelWithProxyAuth(const AuthCredentials& credentials) override;
+ void SetPriority(RequestPriority priority) override;
+ LoadState GetLoadState() const override;
+ bool was_npn_negotiated() const override;
+ NextProto protocol_negotiated() const override;
+ bool using_spdy() const override;
private:
// Used to orphan all jobs in |jobs_| other than |job| which becomes "bound"
diff --git a/net/http/http_stream_factory_impl_request_unittest.cc b/net/http/http_stream_factory_impl_request_unittest.cc
index 422abd0..e204c61 100644
--- a/net/http/http_stream_factory_impl_request_unittest.cc
+++ b/net/http/http_stream_factory_impl_request_unittest.cc
@@ -28,34 +28,30 @@
public:
DoNothingRequestDelegate() {}
- virtual ~DoNothingRequestDelegate() {}
+ ~DoNothingRequestDelegate() override {}
// HttpStreamRequest::Delegate
- virtual void OnStreamReady(
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) override {}
- virtual void OnWebSocketHandshakeStreamReady(
+ void OnStreamReady(const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpStreamBase* stream) override {}
+ void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
WebSocketHandshakeStreamBase* stream) override {}
- virtual void OnStreamFailed(
- int status,
- const SSLConfig& used_ssl_config) override {}
- virtual void OnCertificateError(
- int status,
- const SSLConfig& used_ssl_config,
- const SSLInfo& ssl_info) override {}
- virtual void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpAuthController* auth_controller) override {}
- virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
- SSLCertRequestInfo* cert_info) override {}
- virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) override {}
+ void OnStreamFailed(int status, const SSLConfig& used_ssl_config) override {}
+ void OnCertificateError(int status,
+ const SSLConfig& used_ssl_config,
+ const SSLInfo& ssl_info) override {}
+ void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpAuthController* auth_controller) override {}
+ void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
+ SSLCertRequestInfo* cert_info) override {}
+ void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpStreamBase* stream) override {}
};
} // namespace
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index c1c42c3..1efbd46 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -52,51 +52,49 @@
explicit MockWebSocketHandshakeStream(StreamType type) : type_(type) {}
- virtual ~MockWebSocketHandshakeStream() {}
+ ~MockWebSocketHandshakeStream() override {}
StreamType type() const {
return type_;
}
// HttpStreamBase methods
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override {
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override {
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
+ int ReadResponseHeaders(const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual void Close(bool not_reusable) override {}
- virtual bool IsResponseBodyComplete() const override { return false; }
- virtual bool CanFindEndOfResponse() const override { return false; }
- virtual bool IsConnectionReused() const override { return false; }
- virtual void SetConnectionReused() override {}
- virtual bool IsConnectionReusable() const override { return false; }
- virtual int64 GetTotalReceivedBytes() const override { return 0; }
- virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const
- override {
+ void Close(bool not_reusable) override {}
+ bool IsResponseBodyComplete() const override { return false; }
+ bool CanFindEndOfResponse() const override { return false; }
+ bool IsConnectionReused() const override { return false; }
+ void SetConnectionReused() override {}
+ bool IsConnectionReusable() const override { return false; }
+ int64 GetTotalReceivedBytes() const override { return 0; }
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override {
return false;
}
- virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override {}
- virtual bool IsSpdyHttpStream() const override { return false; }
- virtual void Drain(HttpNetworkSession* session) override {}
- virtual void SetPriority(RequestPriority priority) override {}
+ void GetSSLInfo(SSLInfo* ssl_info) override {}
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {}
+ bool IsSpdyHttpStream() const override { return false; }
+ void Drain(HttpNetworkSession* session) override {}
+ void SetPriority(RequestPriority priority) override {}
- virtual scoped_ptr<WebSocketStream> Upgrade() override {
+ scoped_ptr<WebSocketStream> Upgrade() override {
return scoped_ptr<WebSocketStream>();
}
@@ -124,7 +122,7 @@
private:
// HttpStreamFactoryImpl methods.
- virtual void OnPreconnectsCompleteInternal() override {
+ void OnPreconnectsCompleteInternal() override {
preconnect_done_ = true;
if (waiting_for_preconnect_)
base::MessageLoop::current()->Quit();
@@ -142,10 +140,9 @@
// HttpStreamRequest::Delegate
- virtual void OnStreamReady(
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) override {
+ void OnStreamReady(const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpStreamBase* stream) override {
stream_done_ = true;
if (waiting_for_stream_)
base::MessageLoop::current()->Quit();
@@ -154,7 +151,7 @@
used_proxy_info_ = used_proxy_info;
}
- virtual void OnWebSocketHandshakeStreamReady(
+ void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
WebSocketHandshakeStreamBase* stream) override {
@@ -166,27 +163,24 @@
used_proxy_info_ = used_proxy_info;
}
- virtual void OnStreamFailed(
- int status,
- const SSLConfig& used_ssl_config) override {}
+ void OnStreamFailed(int status, const SSLConfig& used_ssl_config) override {}
- virtual void OnCertificateError(
- int status,
- const SSLConfig& used_ssl_config,
- const SSLInfo& ssl_info) override {}
+ void OnCertificateError(int status,
+ const SSLConfig& used_ssl_config,
+ const SSLInfo& ssl_info) override {}
- virtual void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpAuthController* auth_controller) override {}
+ void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpAuthController* auth_controller) override {}
- virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
- SSLCertRequestInfo* cert_info) override {}
+ void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
+ SSLCertRequestInfo* cert_info) override {}
- virtual void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
- const SSLConfig& used_ssl_config,
- const ProxyInfo& used_proxy_info,
- HttpStreamBase* stream) override {}
+ void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ HttpStreamBase* stream) override {}
void WaitForStream() {
while (!stream_done_) {
@@ -232,7 +226,7 @@
: MockWebSocketHandshakeStream(kStreamTypeSpdy),
spdy_session_(spdy_session) {}
- virtual ~WebSocketSpdyHandshakeStream() {}
+ ~WebSocketSpdyHandshakeStream() override {}
SpdySession* spdy_session() { return spdy_session_.get(); }
@@ -247,7 +241,7 @@
: MockWebSocketHandshakeStream(kStreamTypeBasic),
connection_(connection.Pass()) {}
- virtual ~WebSocketBasicHandshakeStream() {
+ ~WebSocketBasicHandshakeStream() override {
connection_->socket()->Disconnect();
}
@@ -260,15 +254,15 @@
class WebSocketStreamCreateHelper
: public WebSocketHandshakeStreamBase::CreateHelper {
public:
- virtual ~WebSocketStreamCreateHelper() {}
+ ~WebSocketStreamCreateHelper() override {}
- virtual WebSocketHandshakeStreamBase* CreateBasicStream(
+ WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
bool using_proxy) override {
return new WebSocketBasicHandshakeStream(connection.Pass());
}
- virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
+ WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& spdy_session,
bool use_relative_url) override {
return new WebSocketSpdyHandshakeStream(spdy_session);
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 4c1041b..8cd876f 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -162,7 +162,7 @@
int capacity() const { return capacity_; };
private:
- virtual ~SeekableIOBuffer() {
+ ~SeekableIOBuffer() override {
// data_ will be deleted in IOBuffer::~IOBuffer().
data_ = real_data_;
}
diff --git a/net/http/http_transaction_test_util.h b/net/http/http_transaction_test_util.h
index e0f5bda..e6e8312 100644
--- a/net/http/http_transaction_test_util.h
+++ b/net/http/http_transaction_test_util.h
@@ -168,61 +168,57 @@
public:
MockNetworkTransaction(net::RequestPriority priority,
MockNetworkLayer* factory);
- virtual ~MockNetworkTransaction();
+ ~MockNetworkTransaction() override;
- virtual int Start(const net::HttpRequestInfo* request,
- const net::CompletionCallback& callback,
- const net::BoundNetLog& net_log) override;
+ int Start(const net::HttpRequestInfo* request,
+ const net::CompletionCallback& callback,
+ const net::BoundNetLog& net_log) override;
- virtual int RestartIgnoringLastError(
+ int RestartIgnoringLastError(
const net::CompletionCallback& callback) override;
- virtual int RestartWithCertificate(
- net::X509Certificate* client_cert,
- const net::CompletionCallback& callback) override;
+ int RestartWithCertificate(net::X509Certificate* client_cert,
+ const net::CompletionCallback& callback) override;
- virtual int RestartWithAuth(
- const net::AuthCredentials& credentials,
- const net::CompletionCallback& callback) override;
+ int RestartWithAuth(const net::AuthCredentials& credentials,
+ const net::CompletionCallback& callback) override;
- virtual bool IsReadyToRestartForAuth() override;
+ bool IsReadyToRestartForAuth() override;
- virtual int Read(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) override;
+ int Read(net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) override;
- virtual void StopCaching() override;
+ void StopCaching() override;
- virtual bool GetFullRequestHeaders(
- net::HttpRequestHeaders* headers) const override;
+ bool GetFullRequestHeaders(net::HttpRequestHeaders* headers) const override;
- virtual int64 GetTotalReceivedBytes() const override;
+ int64 GetTotalReceivedBytes() const override;
- virtual void DoneReading() override;
+ void DoneReading() override;
- virtual const net::HttpResponseInfo* GetResponseInfo() const override;
+ const net::HttpResponseInfo* GetResponseInfo() const override;
- virtual net::LoadState GetLoadState() const override;
+ net::LoadState GetLoadState() const override;
- virtual net::UploadProgress GetUploadProgress() const override;
+ net::UploadProgress GetUploadProgress() const override;
- virtual void SetQuicServerInfo(
- net::QuicServerInfo* quic_server_info) override;
+ void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override;
- virtual bool GetLoadTimingInfo(
- net::LoadTimingInfo* load_timing_info) const override;
+ bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
- virtual void SetPriority(net::RequestPriority priority) override;
+ void SetPriority(net::RequestPriority priority) override;
- virtual void SetWebSocketHandshakeStreamCreateHelper(
+ void SetWebSocketHandshakeStreamCreateHelper(
CreateHelper* create_helper) override;
- virtual void SetBeforeNetworkStartCallback(
+ void SetBeforeNetworkStartCallback(
const BeforeNetworkStartCallback& callback) override;
- virtual void SetBeforeProxyHeadersSentCallback(
+ void SetBeforeProxyHeadersSentCallback(
const BeforeProxyHeadersSentCallback& callback) override;
- virtual int ResumeNetworkStart() override;
+ int ResumeNetworkStart() override;
CreateHelper* websocket_handshake_stream_create_helper() {
return websocket_handshake_stream_create_helper_;
@@ -260,7 +256,7 @@
public base::SupportsWeakPtr<MockNetworkLayer> {
public:
MockNetworkLayer();
- virtual ~MockNetworkLayer();
+ ~MockNetworkLayer() override;
int transaction_count() const { return transaction_count_; }
bool done_reading_called() const { return done_reading_called_; }
@@ -290,11 +286,10 @@
}
// net::HttpTransactionFactory:
- virtual int CreateTransaction(
- net::RequestPriority priority,
- scoped_ptr<net::HttpTransaction>* trans) override;
- virtual net::HttpCache* GetCache() override;
- virtual net::HttpNetworkSession* GetSession() override;
+ int CreateTransaction(net::RequestPriority priority,
+ scoped_ptr<net::HttpTransaction>* trans) override;
+ net::HttpCache* GetCache() override;
+ net::HttpNetworkSession* GetSession() override;
private:
int transaction_count_;
diff --git a/net/http/mock_allow_url_security_manager.h b/net/http/mock_allow_url_security_manager.h
index 3e19f9b..2a0b205 100644
--- a/net/http/mock_allow_url_security_manager.h
+++ b/net/http/mock_allow_url_security_manager.h
@@ -14,10 +14,10 @@
class MockAllowURLSecurityManager : public URLSecurityManager {
public:
MockAllowURLSecurityManager();
- virtual ~MockAllowURLSecurityManager();
+ ~MockAllowURLSecurityManager() override;
- virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
- virtual bool CanDelegate(const GURL& auth_origin) const override;
+ bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
+ bool CanDelegate(const GURL& auth_origin) const override;
private:
DISALLOW_COPY_AND_ASSIGN(MockAllowURLSecurityManager);
diff --git a/net/http/mock_gssapi_library_posix.h b/net/http/mock_gssapi_library_posix.h
index cbd35e5..17e0d47 100644
--- a/net/http/mock_gssapi_library_posix.h
+++ b/net/http/mock_gssapi_library_posix.h
@@ -73,7 +73,7 @@
};
MockGSSAPILibrary();
- virtual ~MockGSSAPILibrary();
+ ~MockGSSAPILibrary() override;
// Establishes an expectation for a |init_sec_context()| call.
//
@@ -122,67 +122,58 @@
// Initializes the library, including any necessary dynamic libraries.
// This is done separately from construction (which happens at startup time)
// in order to delay work until the class is actually needed.
- virtual bool Init() override;
+ bool Init() override;
// These methods match the ones in the GSSAPI library.
- virtual OM_uint32 import_name(
- OM_uint32* minor_status,
- const gss_buffer_t input_name_buffer,
- const gss_OID input_name_type,
- gss_name_t* output_name) override;
- virtual OM_uint32 release_name(
- OM_uint32* minor_status,
- gss_name_t* input_name) override;
- virtual OM_uint32 release_buffer(
- OM_uint32* minor_status,
- gss_buffer_t buffer) override;
- virtual OM_uint32 display_name(
- OM_uint32* minor_status,
- const gss_name_t input_name,
- gss_buffer_t output_name_buffer,
- gss_OID* output_name_type) override;
- virtual OM_uint32 display_status(
- OM_uint32* minor_status,
- OM_uint32 status_value,
- int status_type,
- const gss_OID mech_type,
- OM_uint32* message_contex,
- gss_buffer_t status_string) override;
- virtual OM_uint32 init_sec_context(
- OM_uint32* minor_status,
- const gss_cred_id_t initiator_cred_handle,
- gss_ctx_id_t* context_handle,
- const gss_name_t target_name,
- const gss_OID mech_type,
- OM_uint32 req_flags,
- OM_uint32 time_req,
- const gss_channel_bindings_t input_chan_bindings,
- const gss_buffer_t input_token,
- gss_OID* actual_mech_type,
- gss_buffer_t output_token,
- OM_uint32* ret_flags,
- OM_uint32* time_rec) override;
- virtual OM_uint32 wrap_size_limit(
- OM_uint32* minor_status,
- const gss_ctx_id_t context_handle,
- int conf_req_flag,
- gss_qop_t qop_req,
- OM_uint32 req_output_size,
- OM_uint32* max_input_size) override;
- virtual OM_uint32 delete_sec_context(
- OM_uint32* minor_status,
- gss_ctx_id_t* context_handle,
- gss_buffer_t output_token) override;
- virtual OM_uint32 inquire_context(
- OM_uint32* minor_status,
- const gss_ctx_id_t context_handle,
- gss_name_t* src_name,
- gss_name_t* targ_name,
- OM_uint32* lifetime_rec,
- gss_OID* mech_type,
- OM_uint32* ctx_flags,
- int* locally_initiated,
- int* open) override;
+ OM_uint32 import_name(OM_uint32* minor_status,
+ const gss_buffer_t input_name_buffer,
+ const gss_OID input_name_type,
+ gss_name_t* output_name) override;
+ OM_uint32 release_name(OM_uint32* minor_status,
+ gss_name_t* input_name) override;
+ OM_uint32 release_buffer(OM_uint32* minor_status,
+ gss_buffer_t buffer) override;
+ OM_uint32 display_name(OM_uint32* minor_status,
+ const gss_name_t input_name,
+ gss_buffer_t output_name_buffer,
+ gss_OID* output_name_type) override;
+ OM_uint32 display_status(OM_uint32* minor_status,
+ OM_uint32 status_value,
+ int status_type,
+ const gss_OID mech_type,
+ OM_uint32* message_contex,
+ gss_buffer_t status_string) override;
+ OM_uint32 init_sec_context(OM_uint32* minor_status,
+ const gss_cred_id_t initiator_cred_handle,
+ gss_ctx_id_t* context_handle,
+ const gss_name_t target_name,
+ const gss_OID mech_type,
+ OM_uint32 req_flags,
+ OM_uint32 time_req,
+ const gss_channel_bindings_t input_chan_bindings,
+ const gss_buffer_t input_token,
+ gss_OID* actual_mech_type,
+ gss_buffer_t output_token,
+ OM_uint32* ret_flags,
+ OM_uint32* time_rec) override;
+ OM_uint32 wrap_size_limit(OM_uint32* minor_status,
+ const gss_ctx_id_t context_handle,
+ int conf_req_flag,
+ gss_qop_t qop_req,
+ OM_uint32 req_output_size,
+ OM_uint32* max_input_size) override;
+ OM_uint32 delete_sec_context(OM_uint32* minor_status,
+ gss_ctx_id_t* context_handle,
+ gss_buffer_t output_token) override;
+ OM_uint32 inquire_context(OM_uint32* minor_status,
+ const gss_ctx_id_t context_handle,
+ gss_name_t* src_name,
+ gss_name_t* targ_name,
+ OM_uint32* lifetime_rec,
+ gss_OID* mech_type,
+ OM_uint32* ctx_flags,
+ int* locally_initiated,
+ int* open) override;
private:
FRIEND_TEST_ALL_PREFIXES(HttpAuthGSSAPIPOSIXTest, GSSAPICycle);
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index 325454e..4ca542e 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -459,8 +459,8 @@
class MockDiskCache::NotImplementedIterator : public Iterator {
public:
- virtual int OpenNextEntry(disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) override {
+ int OpenNextEntry(disk_cache::Entry** next_entry,
+ const net::CompletionCallback& callback) override {
return net::ERR_NOT_IMPLEMENTED;
}
};
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index 9b2caf5..7e3a67c 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -25,28 +25,38 @@
bool is_doomed() const { return doomed_; }
- virtual void Doom() override;
- virtual void Close() override;
- virtual std::string GetKey() const override;
- virtual base::Time GetLastUsed() const override;
- virtual base::Time GetLastModified() const override;
- virtual int32 GetDataSize(int index) const override;
- virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) override;
- virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback,
- bool truncate) override;
- virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) override;
- virtual int WriteSparseData(
- int64 offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) override;
- virtual int GetAvailableRange(
- int64 offset, int len, int64* start,
- const net::CompletionCallback& callback) override;
- virtual bool CouldBeSparse() const override;
- virtual void CancelSparseIO() override;
- virtual int ReadyForSparseIO(
+ void Doom() override;
+ void Close() override;
+ std::string GetKey() const override;
+ base::Time GetLastUsed() const override;
+ base::Time GetLastModified() const override;
+ int32 GetDataSize(int index) const override;
+ int ReadData(int index,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) override;
+ int WriteData(int index,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback,
+ bool truncate) override;
+ int ReadSparseData(int64 offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) override;
+ int WriteSparseData(int64 offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) override;
+ int GetAvailableRange(int64 offset,
+ int len,
+ int64* start,
+ const net::CompletionCallback& callback) override;
+ bool CouldBeSparse() const override;
+ void CancelSparseIO() override;
+ int ReadyForSparseIO(
const net::CompletionCallback& completion_callback) override;
// Fail most subsequent requests.
@@ -63,7 +73,7 @@
friend class base::RefCounted<MockDiskEntry>;
struct CallbackInfo;
- virtual ~MockDiskEntry();
+ ~MockDiskEntry() override;
// Unlike the callbacks for MockHttpTransaction, we want this one to run even
// if the consumer called Close on the MockDiskEntry. We achieve that by
@@ -96,28 +106,28 @@
class MockDiskCache : public disk_cache::Backend {
public:
MockDiskCache();
- virtual ~MockDiskCache();
+ ~MockDiskCache() override;
- virtual net::CacheType GetCacheType() const override;
- virtual int32 GetEntryCount() const override;
- virtual int OpenEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) override;
- virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) override;
- virtual int DoomEntry(const std::string& key,
- const net::CompletionCallback& callback) override;
- virtual int DoomAllEntries(const net::CompletionCallback& callback) override;
- virtual int DoomEntriesBetween(
- base::Time initial_time,
- base::Time end_time,
- const net::CompletionCallback& callback) override;
- virtual int DoomEntriesSince(
- base::Time initial_time,
- const net::CompletionCallback& callback) override;
- virtual scoped_ptr<Iterator> CreateIterator() override;
- virtual void GetStats(
- std::vector<std::pair<std::string, std::string> >* stats) override;
- virtual void OnExternalCacheHit(const std::string& key) override;
+ net::CacheType GetCacheType() const override;
+ int32 GetEntryCount() const override;
+ int OpenEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ const net::CompletionCallback& callback) override;
+ int CreateEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ const net::CompletionCallback& callback) override;
+ int DoomEntry(const std::string& key,
+ const net::CompletionCallback& callback) override;
+ int DoomAllEntries(const net::CompletionCallback& callback) override;
+ int DoomEntriesBetween(base::Time initial_time,
+ base::Time end_time,
+ const net::CompletionCallback& callback) override;
+ int DoomEntriesSince(base::Time initial_time,
+ const net::CompletionCallback& callback) override;
+ scoped_ptr<Iterator> CreateIterator() override;
+ void GetStats(
+ std::vector<std::pair<std::string, std::string>>* stats) override;
+ void OnExternalCacheHit(const std::string& key) override;
// Returns number of times a cache entry was successfully opened.
int open_count() const { return open_count_; }
@@ -156,9 +166,9 @@
class MockBackendFactory : public net::HttpCache::BackendFactory {
public:
- virtual int CreateBackend(net::NetLog* net_log,
- scoped_ptr<disk_cache::Backend>* backend,
- const net::CompletionCallback& callback) override;
+ int CreateBackend(net::NetLog* net_log,
+ scoped_ptr<disk_cache::Backend>* backend,
+ const net::CompletionCallback& callback) override;
};
class MockHttpCache {
@@ -210,26 +220,27 @@
// This version of the disk cache doesn't invoke CreateEntry callbacks.
class MockDiskCacheNoCB : public MockDiskCache {
- virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) override;
+ int CreateEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ const net::CompletionCallback& callback) override;
};
class MockBackendNoCbFactory : public net::HttpCache::BackendFactory {
public:
- virtual int CreateBackend(net::NetLog* net_log,
- scoped_ptr<disk_cache::Backend>* backend,
- const net::CompletionCallback& callback) override;
+ int CreateBackend(net::NetLog* net_log,
+ scoped_ptr<disk_cache::Backend>* backend,
+ const net::CompletionCallback& callback) override;
};
// This backend factory allows us to control the backend instantiation.
class MockBlockingBackendFactory : public net::HttpCache::BackendFactory {
public:
MockBlockingBackendFactory();
- virtual ~MockBlockingBackendFactory();
+ ~MockBlockingBackendFactory() override;
- virtual int CreateBackend(net::NetLog* net_log,
- scoped_ptr<disk_cache::Backend>* backend,
- const net::CompletionCallback& callback) override;
+ int CreateBackend(net::NetLog* net_log,
+ scoped_ptr<disk_cache::Backend>* backend,
+ const net::CompletionCallback& callback) override;
// Completes the backend creation. Any blocked call will be notified via the
// provided callback.
diff --git a/net/http/proxy_client_socket.h b/net/http/proxy_client_socket.h
index da255f3..aa59038 100644
--- a/net/http/proxy_client_socket.h
+++ b/net/http/proxy_client_socket.h
@@ -25,7 +25,7 @@
class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket {
public:
ProxyClientSocket() {}
- virtual ~ProxyClientSocket() {}
+ ~ProxyClientSocket() override {}
// Returns the HttpResponseInfo (including HTTP Headers) from
// the response to the CONNECT request.
diff --git a/net/http/proxy_connect_redirect_http_stream.h b/net/http/proxy_connect_redirect_http_stream.h
index ddaf9b7..701d18d 100644
--- a/net/http/proxy_connect_redirect_http_stream.h
+++ b/net/http/proxy_connect_redirect_http_stream.h
@@ -20,52 +20,50 @@
// GetLoadTimingInfo(), or NULL if there is none. Does not take
// ownership of |load_timing_info|.
explicit ProxyConnectRedirectHttpStream(LoadTimingInfo* load_timing_info);
- virtual ~ProxyConnectRedirectHttpStream();
+ ~ProxyConnectRedirectHttpStream() override;
// All functions below are expected not to be called except for the
// marked one.
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override;
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override;
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override;
+ int ReadResponseHeaders(const CompletionCallback& callback) override;
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// This function may be called.
- virtual void Close(bool not_reusable) override;
+ void Close(bool not_reusable) override;
- virtual bool IsResponseBodyComplete() const override;
+ bool IsResponseBodyComplete() const override;
// This function may be called.
- virtual bool CanFindEndOfResponse() const override;
+ bool CanFindEndOfResponse() const override;
- virtual bool IsConnectionReused() const override;
- virtual void SetConnectionReused() override;
- virtual bool IsConnectionReusable() const override;
+ bool IsConnectionReused() const override;
+ void SetConnectionReused() override;
+ bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const override;
+ int64 GetTotalReceivedBytes() const override;
// This function may be called.
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) override;
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override;
- virtual bool IsSpdyHttpStream() const override;
- virtual void Drain(HttpNetworkSession* session) override;
+ void GetSSLInfo(SSLInfo* ssl_info) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ bool IsSpdyHttpStream() const override;
+ void Drain(HttpNetworkSession* session) override;
// This function may be called.
- virtual void SetPriority(RequestPriority priority) override;
+ void SetPriority(RequestPriority priority) override;
- virtual UploadProgress GetUploadProgress() const override;
- virtual HttpStream* RenewStreamForAuth() override;
+ UploadProgress GetUploadProgress() const override;
+ HttpStream* RenewStreamForAuth() override;
private:
bool has_load_timing_info_;
diff --git a/net/http/transport_security_persister.h b/net/http/transport_security_persister.h
index 5081c38..09b32ac 100644
--- a/net/http/transport_security_persister.h
+++ b/net/http/transport_security_persister.h
@@ -62,10 +62,10 @@
const base::FilePath& profile_path,
const scoped_refptr<base::SequencedTaskRunner>& background_runner,
bool readonly);
- virtual ~TransportSecurityPersister();
+ ~TransportSecurityPersister() override;
// Called by the TransportSecurityState when it changes its state.
- virtual void StateIsDirty(TransportSecurityState*) override;
+ void StateIsDirty(TransportSecurityState*) override;
// ImportantFileWriter::DataSerializer:
//
@@ -97,7 +97,7 @@
// The reason for hashing them is so that the stored state does not
// trivially reveal a user's browsing history to an attacker reading the
// serialized state on disk.
- virtual bool SerializeData(std::string* data) override;
+ bool SerializeData(std::string* data) override;
// Clears any existing non-static entries, and then re-populates
// |transport_security_state_|.
diff --git a/net/http/url_security_manager.h b/net/http/url_security_manager.h
index 2835d89..c0d93a2 100644
--- a/net/http/url_security_manager.h
+++ b/net/http/url_security_manager.h
@@ -61,11 +61,11 @@
// The URLSecurityManagerWhitelist takes ownership of the whitelists.
URLSecurityManagerWhitelist(const HttpAuthFilter* whitelist_default,
const HttpAuthFilter* whitelist_delegation);
- virtual ~URLSecurityManagerWhitelist();
+ ~URLSecurityManagerWhitelist() override;
// URLSecurityManager methods.
- virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
- virtual bool CanDelegate(const GURL& auth_origin) const override;
+ bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
+ bool CanDelegate(const GURL& auth_origin) const override;
private:
scoped_ptr<const HttpAuthFilter> whitelist_default_;
diff --git a/net/proxy/dhcp_proxy_script_fetcher.h b/net/proxy/dhcp_proxy_script_fetcher.h
index bb293de..85d4df8 100644
--- a/net/proxy/dhcp_proxy_script_fetcher.h
+++ b/net/proxy/dhcp_proxy_script_fetcher.h
@@ -83,12 +83,13 @@
: public DhcpProxyScriptFetcher {
public:
DoNothingDhcpProxyScriptFetcher();
- virtual ~DoNothingDhcpProxyScriptFetcher();
+ ~DoNothingDhcpProxyScriptFetcher() override;
- virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) override;
- virtual void Cancel() override;
- virtual const GURL& GetPacURL() const override;
+ int Fetch(base::string16* utf16_text,
+ const CompletionCallback& callback) override;
+ void Cancel() override;
+ const GURL& GetPacURL() const override;
+
private:
GURL gurl_;
DISALLOW_COPY_AND_ASSIGN(DoNothingDhcpProxyScriptFetcher);
diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h
index 5a616dd..8ae551d 100644
--- a/net/proxy/mock_proxy_resolver.h
+++ b/net/proxy/mock_proxy_resolver.h
@@ -70,20 +70,19 @@
typedef std::vector<scoped_refptr<Request> > RequestsList;
- virtual ~MockAsyncProxyResolverBase();
+ ~MockAsyncProxyResolverBase() override;
// ProxyResolver implementation.
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const net::CompletionCallback& callback,
- RequestHandle* request_handle,
- const BoundNetLog& /*net_log*/) override;
- virtual void CancelRequest(RequestHandle request_handle) override;
- virtual LoadState GetLoadState(RequestHandle request_handle) const override;
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& callback) override;
- virtual void CancelSetPacScript() override;
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const net::CompletionCallback& callback,
+ RequestHandle* request_handle,
+ const BoundNetLog& /*net_log*/) override;
+ void CancelRequest(RequestHandle request_handle) override;
+ LoadState GetLoadState(RequestHandle request_handle) const override;
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const net::CompletionCallback& callback) override;
+ void CancelSetPacScript() override;
const RequestsList& pending_requests() const {
return pending_requests_;
diff --git a/net/proxy/mock_proxy_script_fetcher.h b/net/proxy/mock_proxy_script_fetcher.h
index 910c6b2..458f477 100644
--- a/net/proxy/mock_proxy_script_fetcher.h
+++ b/net/proxy/mock_proxy_script_fetcher.h
@@ -20,14 +20,14 @@
class MockProxyScriptFetcher : public ProxyScriptFetcher {
public:
MockProxyScriptFetcher();
- virtual ~MockProxyScriptFetcher();
+ ~MockProxyScriptFetcher() override;
// ProxyScriptFetcher implementation.
- virtual int Fetch(const GURL& url,
- base::string16* text,
- const CompletionCallback& callback) override;
- virtual void Cancel() override;
- virtual URLRequestContext* GetRequestContext() const override;
+ int Fetch(const GURL& url,
+ base::string16* text,
+ const CompletionCallback& callback) override;
+ void Cancel() override;
+ URLRequestContext* GetRequestContext() const override;
void NotifyFetchCompletion(int result, const std::string& ascii_text);
const GURL& pending_request_url() const;
diff --git a/net/proxy/multi_threaded_proxy_resolver.cc b/net/proxy/multi_threaded_proxy_resolver.cc
index a2a6515..863711c 100644
--- a/net/proxy/multi_threaded_proxy_resolver.cc
+++ b/net/proxy/multi_threaded_proxy_resolver.cc
@@ -175,7 +175,7 @@
}
// Runs on the worker thread.
- virtual void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) override {
+ void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) override {
ProxyResolver* resolver = executor()->resolver();
int rv = resolver->SetPacScript(script_data_, CompletionCallback());
@@ -186,7 +186,7 @@
}
protected:
- virtual ~SetPacScriptJob() {}
+ ~SetPacScriptJob() override {}
private:
// Runs the completion callback on the origin thread.
@@ -222,12 +222,12 @@
BoundNetLog* net_log() { return &net_log_; }
- virtual void WaitingForThread() override {
+ void WaitingForThread() override {
was_waiting_for_thread_ = true;
net_log_.BeginEvent(NetLog::TYPE_WAITING_FOR_PROXY_RESOLVER_THREAD);
}
- virtual void FinishedWaitingForThread() override {
+ void FinishedWaitingForThread() override {
DCHECK(executor());
if (was_waiting_for_thread_) {
@@ -240,7 +240,7 @@
}
// Runs on the worker thread.
- virtual void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) override {
+ void Run(scoped_refptr<base::MessageLoopProxy> origin_loop) override {
ProxyResolver* resolver = executor()->resolver();
int rv = resolver->GetProxyForURL(
url_, &results_buf_, CompletionCallback(), NULL, net_log_);
@@ -252,7 +252,7 @@
}
protected:
- virtual ~GetProxyForURLJob() {}
+ ~GetProxyForURLJob() override {}
private:
// Runs the completion callback on the origin thread.
diff --git a/net/proxy/multi_threaded_proxy_resolver.h b/net/proxy/multi_threaded_proxy_resolver.h
index 0a14461..107e5f8 100644
--- a/net/proxy/multi_threaded_proxy_resolver.h
+++ b/net/proxy/multi_threaded_proxy_resolver.h
@@ -88,20 +88,19 @@
MultiThreadedProxyResolver(ProxyResolverFactory* resolver_factory,
size_t max_num_threads);
- virtual ~MultiThreadedProxyResolver();
+ ~MultiThreadedProxyResolver() override;
// ProxyResolver implementation:
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle request) override;
- virtual LoadState GetLoadState(RequestHandle request) const override;
- virtual void CancelSetPacScript() override;
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) override;
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle request) override;
+ LoadState GetLoadState(RequestHandle request) const override;
+ void CancelSetPacScript() override;
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const CompletionCallback& callback) override;
private:
class Executor;
diff --git a/net/proxy/multi_threaded_proxy_resolver_unittest.cc b/net/proxy/multi_threaded_proxy_resolver_unittest.cc
index d2e465c..7a8db63 100644
--- a/net/proxy/multi_threaded_proxy_resolver_unittest.cc
+++ b/net/proxy/multi_threaded_proxy_resolver_unittest.cc
@@ -36,11 +36,11 @@
request_count_(0) {}
// ProxyResolver implementation.
- virtual int GetProxyForURL(const GURL& query_url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override {
+ int GetProxyForURL(const GURL& query_url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override {
if (resolve_latency_ != base::TimeDelta())
base::PlatformThread::Sleep(resolve_latency_);
@@ -58,22 +58,17 @@
return request_count_++;
}
- virtual void CancelRequest(RequestHandle request) override {
- NOTREACHED();
- }
+ void CancelRequest(RequestHandle request) override { NOTREACHED(); }
- virtual LoadState GetLoadState(RequestHandle request) const override {
+ LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() override {
- NOTREACHED();
- }
+ void CancelSetPacScript() override { NOTREACHED(); }
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) override {
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const CompletionCallback& callback) override {
CheckIsOnWorkerThread();
last_script_data_ = script_data;
return OK;
@@ -133,11 +128,11 @@
blocked_.Wait();
}
- virtual int GetProxyForURL(const GURL& query_url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override {
+ int GetProxyForURL(const GURL& query_url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override {
if (should_block_) {
blocked_.Signal();
unblocked_.Wait();
@@ -160,31 +155,28 @@
: ProxyResolver(impl->expects_pac_bytes()),
impl_(impl) {}
- virtual int GetProxyForURL(const GURL& query_url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override {
+ int GetProxyForURL(const GURL& query_url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override {
return impl_->GetProxyForURL(
query_url, results, callback, request, net_log);
}
- virtual void CancelRequest(RequestHandle request) override {
+ void CancelRequest(RequestHandle request) override {
impl_->CancelRequest(request);
}
- virtual LoadState GetLoadState(RequestHandle request) const override {
+ LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() override {
- impl_->CancelSetPacScript();
- }
+ void CancelSetPacScript() override { impl_->CancelSetPacScript(); }
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) override {
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const CompletionCallback& callback) override {
return impl_->SetPacScript(script_data, callback);
}
@@ -200,7 +192,7 @@
: ProxyResolverFactory(resolver->expects_pac_bytes()),
resolver_(resolver) {}
- virtual ProxyResolver* CreateProxyResolver() override {
+ ProxyResolver* CreateProxyResolver() override {
return new ForwardingProxyResolver(resolver_);
}
@@ -213,11 +205,9 @@
public:
BlockableProxyResolverFactory() : ProxyResolverFactory(true) {}
- virtual ~BlockableProxyResolverFactory() {
- STLDeleteElements(&resolvers_);
- }
+ ~BlockableProxyResolverFactory() override { STLDeleteElements(&resolvers_); }
- virtual ProxyResolver* CreateProxyResolver() override {
+ ProxyResolver* CreateProxyResolver() override {
BlockableProxyResolver* resolver = new BlockableProxyResolver;
resolvers_.push_back(resolver);
return new ForwardingProxyResolver(resolver);
diff --git a/net/proxy/network_delegate_error_observer.h b/net/proxy/network_delegate_error_observer.h
index 70a2bed..6fad578 100644
--- a/net/proxy/network_delegate_error_observer.h
+++ b/net/proxy/network_delegate_error_observer.h
@@ -24,11 +24,10 @@
public:
NetworkDelegateErrorObserver(NetworkDelegate* network_delegate,
base::MessageLoopProxy* origin_loop);
- virtual ~NetworkDelegateErrorObserver();
+ ~NetworkDelegateErrorObserver() override;
// ProxyResolverErrorObserver implementation.
- virtual void OnPACScriptError(int line_number, const base::string16& error)
- override;
+ void OnPACScriptError(int line_number, const base::string16& error) override;
private:
class Core;
diff --git a/net/proxy/network_delegate_error_observer_unittest.cc b/net/proxy/network_delegate_error_observer_unittest.cc
index 8547761..5d2c501 100644
--- a/net/proxy/network_delegate_error_observer_unittest.cc
+++ b/net/proxy/network_delegate_error_observer_unittest.cc
@@ -19,25 +19,25 @@
class TestNetworkDelegate : public net::NetworkDelegate {
public:
TestNetworkDelegate() : got_pac_error_(false) {}
- virtual ~TestNetworkDelegate() {}
+ ~TestNetworkDelegate() override {}
bool got_pac_error() const { return got_pac_error_; }
private:
// net::NetworkDelegate implementation.
- virtual int OnBeforeURLRequest(URLRequest* request,
- const CompletionCallback& callback,
- GURL* new_url) override {
+ int OnBeforeURLRequest(URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) override {
return OK;
}
- virtual int OnBeforeSendHeaders(URLRequest* request,
- const CompletionCallback& callback,
- HttpRequestHeaders* headers) override {
+ int OnBeforeSendHeaders(URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) override {
return OK;
}
- virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) override {}
- virtual int OnHeadersReceived(
+ void OnSendHeaders(URLRequest* request,
+ const HttpRequestHeaders& headers) override {}
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
@@ -45,44 +45,40 @@
GURL* allowed_unsafe_redirect_url) override {
return net::OK;
}
- virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) override {}
- virtual void OnResponseStarted(URLRequest* request) override {}
- virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) override {}
- virtual void OnCompleted(URLRequest* request, bool started) override {}
- virtual void OnURLRequestDestroyed(URLRequest* request) override {}
+ void OnBeforeRedirect(URLRequest* request,
+ const GURL& new_location) override {}
+ void OnResponseStarted(URLRequest* request) override {}
+ void OnRawBytesRead(const URLRequest& request, int bytes_read) override {}
+ void OnCompleted(URLRequest* request, bool started) override {}
+ void OnURLRequestDestroyed(URLRequest* request) override {}
- virtual void OnPACScriptError(int line_number,
- const base::string16& error) override {
+ void OnPACScriptError(int line_number, const base::string16& error) override {
got_pac_error_ = true;
}
- virtual AuthRequiredResponse OnAuthRequired(
- URLRequest* request,
- const AuthChallengeInfo& auth_info,
- const AuthCallback& callback,
- AuthCredentials* credentials) override {
+ AuthRequiredResponse OnAuthRequired(URLRequest* request,
+ const AuthChallengeInfo& auth_info,
+ const AuthCallback& callback,
+ AuthCredentials* credentials) override {
return AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
- virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) override {
+ bool OnCanGetCookies(const URLRequest& request,
+ const CookieList& cookie_list) override {
return true;
}
- virtual bool OnCanSetCookie(const URLRequest& request,
- const std::string& cookie_line,
- CookieOptions* options) override {
+ bool OnCanSetCookie(const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) override {
return true;
}
- virtual bool OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const override {
+ bool OnCanAccessFile(const net::URLRequest& request,
+ const base::FilePath& path) const override {
return true;
}
- virtual bool OnCanThrottleRequest(const URLRequest& request) const override {
+ bool OnCanThrottleRequest(const URLRequest& request) const override {
return false;
}
- virtual int OnBeforeSocketStreamConnect(
- SocketStream* stream,
- const CompletionCallback& callback) override {
+ int OnBeforeSocketStreamConnect(SocketStream* stream,
+ const CompletionCallback& callback) override {
return OK;
}
diff --git a/net/proxy/polling_proxy_config_service.h b/net/proxy/polling_proxy_config_service.h
index dc0db48..c823056 100644
--- a/net/proxy/polling_proxy_config_service.h
+++ b/net/proxy/polling_proxy_config_service.h
@@ -20,10 +20,10 @@
class NET_EXPORT_PRIVATE PollingProxyConfigService : public ProxyConfigService {
public:
// ProxyConfigService implementation:
- virtual void AddObserver(Observer* observer) override;
- virtual void RemoveObserver(Observer* observer) override;
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
- virtual void OnLazyPoll() override;
+ void AddObserver(Observer* observer) override;
+ void RemoveObserver(Observer* observer) override;
+ ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
+ void OnLazyPoll() override;
protected:
// Function for retrieving the current proxy configuration.
@@ -38,7 +38,7 @@
base::TimeDelta poll_interval,
GetConfigFunction get_config_func);
- virtual ~PollingProxyConfigService();
+ ~PollingProxyConfigService() override;
// Polls for changes by posting a task to the worker pool.
void CheckForChangesNow();
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index debb2e8..970e3bb 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -27,7 +27,7 @@
optional_port_(optional_port) {
}
- virtual bool Matches(const GURL& url) const override {
+ bool Matches(const GURL& url) const override {
if (optional_port_ != -1 && url.EffectiveIntPort() != optional_port_)
return false; // Didn't match port expectation.
@@ -40,7 +40,7 @@
hostname_pattern_);
}
- virtual std::string ToString() const override {
+ std::string ToString() const override {
std::string str;
if (!optional_scheme_.empty())
base::StringAppendF(&str, "%s://", optional_scheme_.c_str());
@@ -50,7 +50,7 @@
return str;
}
- virtual Rule* Clone() const override {
+ Rule* Clone() const override {
return new HostnamePatternRule(optional_scheme_,
hostname_pattern_,
optional_port_);
@@ -64,20 +64,16 @@
class BypassLocalRule : public ProxyBypassRules::Rule {
public:
- virtual bool Matches(const GURL& url) const override {
+ bool Matches(const GURL& url) const override {
const std::string& host = url.host();
if (host == "127.0.0.1" || host == "[::1]")
return true;
return host.find('.') == std::string::npos;
}
- virtual std::string ToString() const override {
- return "<local>";
- }
+ std::string ToString() const override { return "<local>"; }
- virtual Rule* Clone() const override {
- return new BypassLocalRule();
- }
+ Rule* Clone() const override { return new BypassLocalRule(); }
};
// Rule for matching a URL that is an IP address, if that IP address falls
@@ -96,7 +92,7 @@
prefix_length_in_bits_(prefix_length_in_bits) {
}
- virtual bool Matches(const GURL& url) const override {
+ bool Matches(const GURL& url) const override {
if (!url.HostIsIPAddress())
return false;
@@ -113,11 +109,9 @@
prefix_length_in_bits_);
}
- virtual std::string ToString() const override {
- return description_;
- }
+ std::string ToString() const override { return description_; }
- virtual Rule* Clone() const override {
+ Rule* Clone() const override {
return new BypassIPBlockRule(description_,
optional_scheme_,
ip_prefix_,
diff --git a/net/proxy/proxy_config_service_fixed.h b/net/proxy/proxy_config_service_fixed.h
index 14185c6..a95bf78 100644
--- a/net/proxy/proxy_config_service_fixed.h
+++ b/net/proxy/proxy_config_service_fixed.h
@@ -16,12 +16,12 @@
class NET_EXPORT ProxyConfigServiceFixed : public ProxyConfigService {
public:
explicit ProxyConfigServiceFixed(const ProxyConfig& pc);
- virtual ~ProxyConfigServiceFixed();
+ ~ProxyConfigServiceFixed() override;
// ProxyConfigService methods:
- virtual void AddObserver(Observer* observer) override {}
- virtual void RemoveObserver(Observer* observer) override {}
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
+ void AddObserver(Observer* observer) override {}
+ void RemoveObserver(Observer* observer) override {}
+ ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
private:
ProxyConfig pc_;
diff --git a/net/proxy/proxy_config_service_mac.h b/net/proxy/proxy_config_service_mac.h
index 6c60daf..87c8162 100644
--- a/net/proxy/proxy_config_service_mac.h
+++ b/net/proxy/proxy_config_service_mac.h
@@ -27,13 +27,13 @@
// (however it may be constructed from a different thread).
explicit ProxyConfigServiceMac(
const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_task_runner);
- virtual ~ProxyConfigServiceMac();
+ ~ProxyConfigServiceMac() override;
public:
// ProxyConfigService implementation:
- virtual void AddObserver(Observer* observer) override;
- virtual void RemoveObserver(Observer* observer) override;
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
+ void AddObserver(Observer* observer) override;
+ void RemoveObserver(Observer* observer) override;
+ ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override;
private:
class Helper;
@@ -46,10 +46,9 @@
: proxy_config_service_(proxy_config_service) {}
// NetworkConfigWatcherMac::Delegate implementation:
- virtual void StartReachabilityNotifications() override {}
- virtual void SetDynamicStoreNotificationKeys(
- SCDynamicStoreRef store) override;
- virtual void OnNetworkConfigChange(CFArrayRef changed_keys) override;
+ void StartReachabilityNotifications() override {}
+ void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store) override;
+ void OnNetworkConfigChange(CFArrayRef changed_keys) override;
private:
ProxyConfigServiceMac* const proxy_config_service_;
diff --git a/net/proxy/proxy_resolver_mac.h b/net/proxy/proxy_resolver_mac.h
index c732988..ef10b5c 100644
--- a/net/proxy/proxy_resolver_mac.h
+++ b/net/proxy/proxy_resolver_mac.h
@@ -18,24 +18,23 @@
class NET_EXPORT ProxyResolverMac : public ProxyResolver {
public:
ProxyResolverMac();
- virtual ~ProxyResolverMac();
+ ~ProxyResolverMac() override;
// ProxyResolver methods:
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const net::CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override;
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const net::CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle request) override;
+ void CancelRequest(RequestHandle request) override;
- virtual LoadState GetLoadState(RequestHandle request) const override;
+ LoadState GetLoadState(RequestHandle request) const override;
- virtual void CancelSetPacScript() override;
+ void CancelSetPacScript() override;
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& /*callback*/) override;
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const net::CompletionCallback& /*callback*/) override;
private:
scoped_refptr<ProxyResolverScriptData> script_data_;
diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc
index 061c13e..5db69d8 100644
--- a/net/proxy/proxy_resolver_perftest.cc
+++ b/net/proxy/proxy_resolver_perftest.cc
@@ -199,20 +199,17 @@
public:
MockJSBindings() {}
- virtual void Alert(const base::string16& message) override {
- CHECK(false);
- }
+ void Alert(const base::string16& message) override { CHECK(false); }
- virtual bool ResolveDns(const std::string& host,
- ResolveDnsOperation op,
- std::string* output,
- bool* terminate) override {
+ bool ResolveDns(const std::string& host,
+ ResolveDnsOperation op,
+ std::string* output,
+ bool* terminate) override {
CHECK(false);
return false;
}
- virtual void OnError(int line_number,
- const base::string16& message) override {
+ void OnError(int line_number, const base::string16& message) override {
CHECK(false);
}
};
diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc
index dc224cd..d7916e0 100644
--- a/net/proxy/proxy_resolver_v8.cc
+++ b/net/proxy/proxy_resolver_v8.cc
@@ -93,13 +93,11 @@
const scoped_refptr<ProxyResolverScriptData>& script_data)
: script_data_(script_data) {}
- virtual const uint16_t* data() const override {
+ const uint16_t* data() const override {
return reinterpret_cast<const uint16*>(script_data_->utf16().data());
}
- virtual size_t length() const override {
- return script_data_->utf16().size();
- }
+ size_t length() const override { return script_data_->utf16().size(); }
private:
const scoped_refptr<ProxyResolverScriptData> script_data_;
@@ -117,13 +115,9 @@
DCHECK(base::IsStringASCII(ascii));
}
- virtual const char* data() const override {
- return ascii_;
- }
+ const char* data() const override { return ascii_; }
- virtual size_t length() const override {
- return length_;
- }
+ size_t length() const override { return length_; }
private:
const char* ascii_;
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h
index 38b958d..64d1983 100644
--- a/net/proxy/proxy_resolver_v8.h
+++ b/net/proxy/proxy_resolver_v8.h
@@ -76,23 +76,22 @@
// Constructs a ProxyResolverV8.
ProxyResolverV8();
- virtual ~ProxyResolverV8();
+ ~ProxyResolverV8() override;
JSBindings* js_bindings() const { return js_bindings_; }
void set_js_bindings(JSBindings* js_bindings) { js_bindings_ = js_bindings; }
// ProxyResolver implementation:
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const net::CompletionCallback& /*callback*/,
- RequestHandle* /*request*/,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle request) override;
- virtual LoadState GetLoadState(RequestHandle request) const override;
- virtual void CancelSetPacScript() override;
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const net::CompletionCallback& /*callback*/) override;
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const net::CompletionCallback& /*callback*/,
+ RequestHandle* /*request*/,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle request) override;
+ LoadState GetLoadState(RequestHandle request) const override;
+ void CancelSetPacScript() override;
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const net::CompletionCallback& /*callback*/) override;
// Create an isolate to use for the proxy resolver. If the embedder invokes
// this method multiple times, it must be invoked in a thread safe manner,
diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc
index b5e934b..17145d1 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -119,7 +119,7 @@
base::string16 message;
};
- virtual ~Job();
+ ~Job() override;
void CheckIsOnWorkerThread() const;
void CheckIsOnOriginThread() const;
@@ -145,12 +145,12 @@
int ExecuteProxyResolver();
// Implementation of ProxyResolverv8::JSBindings
- virtual bool ResolveDns(const std::string& host,
- ResolveDnsOperation op,
- std::string* output,
- bool* terminate) override;
- virtual void Alert(const base::string16& message) override;
- virtual void OnError(int line_number, const base::string16& error) override;
+ bool ResolveDns(const std::string& host,
+ ResolveDnsOperation op,
+ std::string* output,
+ bool* terminate) override;
+ void Alert(const base::string16& message) override;
+ void OnError(int line_number, const base::string16& error) override;
bool ResolveDnsBlocking(const std::string& host,
ResolveDnsOperation op,
diff --git a/net/proxy/proxy_resolver_v8_tracing.h b/net/proxy/proxy_resolver_v8_tracing.h
index 92eac03..85aca51 100644
--- a/net/proxy/proxy_resolver_v8_tracing.h
+++ b/net/proxy/proxy_resolver_v8_tracing.h
@@ -42,20 +42,19 @@
ProxyResolverErrorObserver* error_observer,
NetLog* net_log);
- virtual ~ProxyResolverV8Tracing();
+ ~ProxyResolverV8Tracing() override;
// ProxyResolver implementation:
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(RequestHandle request) override;
- virtual LoadState GetLoadState(RequestHandle request) const override;
- virtual void CancelSetPacScript() override;
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& script_data,
- const CompletionCallback& callback) override;
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(RequestHandle request) override;
+ LoadState GetLoadState(RequestHandle request) const override;
+ void CancelSetPacScript() override;
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
+ const CompletionCallback& callback) override;
private:
class Job;
diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
index a6e38cb..0c16a1a 100644
--- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
@@ -70,8 +70,7 @@
public:
MockErrorObserver() : event_(true, false) {}
- virtual void OnPACScriptError(int line_number,
- const base::string16& error) override {
+ void OnPACScriptError(int line_number, const base::string16& error) override {
{
base::AutoLock l(lock_);
output += base::StringPrintf("Error: line %d: %s\n", line_number,
@@ -763,12 +762,12 @@
BlockableHostResolver()
: num_cancelled_requests_(0), waiting_for_resolve_(false) {}
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override {
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override {
EXPECT_FALSE(callback.is_null());
EXPECT_TRUE(out_req);
@@ -789,14 +788,14 @@
return ERR_IO_PENDING;
}
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override {
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override {
NOTREACHED();
return ERR_DNS_CACHE_MISS;
}
- virtual void CancelRequest(RequestHandle req) override {
+ void CancelRequest(RequestHandle req) override {
EXPECT_EQ(reinterpret_cast<RequestHandle*>(1), req);
num_cancelled_requests_++;
}
diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc
index d0d01d9..76ad232 100644
--- a/net/proxy/proxy_resolver_v8_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_unittest.cc
@@ -26,15 +26,15 @@
MockJSBindings() : my_ip_address_count(0), my_ip_address_ex_count(0),
should_terminate(false) {}
- virtual void Alert(const base::string16& message) override {
+ void Alert(const base::string16& message) override {
VLOG(1) << "PAC-alert: " << message; // Helpful when debugging.
alerts.push_back(base::UTF16ToUTF8(message));
}
- virtual bool ResolveDns(const std::string& host,
- ResolveDnsOperation op,
- std::string* output,
- bool* terminate) override {
+ bool ResolveDns(const std::string& host,
+ ResolveDnsOperation op,
+ std::string* output,
+ bool* terminate) override {
*terminate = should_terminate;
if (op == MY_IP_ADDRESS) {
@@ -65,8 +65,7 @@
return false;
}
- virtual void OnError(int line_number,
- const base::string16& message) override {
+ void OnError(int line_number, const base::string16& message) override {
// Helpful when debugging.
VLOG(1) << "PAC-error: [" << line_number << "] " << message;
@@ -102,8 +101,7 @@
set_js_bindings(&mock_js_bindings_);
}
- virtual ~ProxyResolverV8WithMockBindings() {
- }
+ ~ProxyResolverV8WithMockBindings() override {}
MockJSBindings* mock_js_bindings() {
return &mock_js_bindings_;
diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc
index 880a187..ee2958c 100644
--- a/net/proxy/proxy_script_decider_unittest.cc
+++ b/net/proxy/proxy_script_decider_unittest.cc
@@ -105,9 +105,9 @@
}
// ProxyScriptFetcher implementation.
- virtual int Fetch(const GURL& url,
- base::string16* text,
- const CompletionCallback& callback) override {
+ int Fetch(const GURL& url,
+ base::string16* text,
+ const CompletionCallback& callback) override {
const Rules::Rule& rule = rules_->GetRuleByUrl(url);
int rv = rule.fetch_error;
EXPECT_NE(ERR_UNEXPECTED, rv);
@@ -116,9 +116,9 @@
return rv;
}
- virtual void Cancel() override {}
+ void Cancel() override {}
- virtual URLRequestContext* GetRequestContext() const override {
+ URLRequestContext* GetRequestContext() const override {
return request_context_;
}
@@ -131,12 +131,12 @@
class MockDhcpProxyScriptFetcher : public DhcpProxyScriptFetcher {
public:
MockDhcpProxyScriptFetcher();
- virtual ~MockDhcpProxyScriptFetcher();
+ ~MockDhcpProxyScriptFetcher() override;
- virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) override;
- virtual void Cancel() override;
- virtual const GURL& GetPacURL() const override;
+ int Fetch(base::string16* utf16_text,
+ const CompletionCallback& callback) override;
+ void Cancel() override;
+ const GURL& GetPacURL() const override;
virtual void SetPacURL(const GURL& url);
@@ -642,18 +642,15 @@
: gurl_("http://dhcppac/"), expected_text_(expected_text) {
}
- virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) override {
+ int Fetch(base::string16* utf16_text,
+ const CompletionCallback& callback) override {
*utf16_text = expected_text_;
return OK;
}
- virtual void Cancel() override {
- }
+ void Cancel() override {}
- virtual const GURL& GetPacURL() const override {
- return gurl_;
- }
+ const GURL& GetPacURL() const override { return gurl_; }
const base::string16& expected_text() const {
return expected_text_;
@@ -722,10 +719,10 @@
public base::SupportsWeakPtr<AsyncFailDhcpFetcher> {
public:
AsyncFailDhcpFetcher() {}
- virtual ~AsyncFailDhcpFetcher() {}
+ ~AsyncFailDhcpFetcher() override {}
- virtual int Fetch(base::string16* utf16_text,
- const CompletionCallback& callback) override {
+ int Fetch(base::string16* utf16_text,
+ const CompletionCallback& callback) override {
callback_ = callback;
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -733,13 +730,9 @@
return ERR_IO_PENDING;
}
- virtual void Cancel() override {
- callback_.Reset();
- }
+ void Cancel() override { callback_.Reset(); }
- virtual const GURL& GetPacURL() const override {
- return dummy_gurl_;
- }
+ const GURL& GetPacURL() const override { return dummy_gurl_; }
void CallbackWithFailure() {
if (!callback_.is_null())
diff --git a/net/proxy/proxy_script_fetcher_impl.h b/net/proxy/proxy_script_fetcher_impl.h
index 8cdcf81..54afa4c 100644
--- a/net/proxy/proxy_script_fetcher_impl.h
+++ b/net/proxy/proxy_script_fetcher_impl.h
@@ -36,7 +36,7 @@
// fetcher and the context; you can break such cycles by calling Cancel().
explicit ProxyScriptFetcherImpl(URLRequestContext* url_request_context);
- virtual ~ProxyScriptFetcherImpl();
+ ~ProxyScriptFetcherImpl() override;
// Used by unit-tests to modify the default limits.
base::TimeDelta SetTimeoutConstraint(base::TimeDelta timeout);
@@ -45,19 +45,20 @@
void OnResponseCompleted(URLRequest* request);
// ProxyScriptFetcher methods:
- virtual int Fetch(const GURL& url, base::string16* text,
- const net::CompletionCallback& callback) override;
- virtual void Cancel() override;
- virtual URLRequestContext* GetRequestContext() const override;
+ int Fetch(const GURL& url,
+ base::string16* text,
+ const net::CompletionCallback& callback) override;
+ void Cancel() override;
+ URLRequestContext* GetRequestContext() const override;
// URLRequest::Delegate methods:
- virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) override;
- virtual void OnSSLCertificateError(URLRequest* request,
- const SSLInfo& ssl_info,
- bool is_hsts_ok) override;
- virtual void OnResponseStarted(URLRequest* request) override;
- virtual void OnReadCompleted(URLRequest* request, int num_bytes) override;
+ void OnAuthRequired(URLRequest* request,
+ AuthChallengeInfo* auth_info) override;
+ void OnSSLCertificateError(URLRequest* request,
+ const SSLInfo& ssl_info,
+ bool is_hsts_ok) override;
+ void OnResponseStarted(URLRequest* request) override;
+ void OnReadCompleted(URLRequest* request, int num_bytes) override;
private:
enum { kBufSize = 4096 };
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index 5eb887e..2073d00 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -84,9 +84,7 @@
storage_.set_job_factory(job_factory);
}
- virtual ~RequestContext() {
- AssertNoURLRequests();
- }
+ ~RequestContext() override { AssertNoURLRequests(); }
private:
URLRequestContextStorage storage_;
@@ -112,26 +110,26 @@
class BasicNetworkDelegate : public NetworkDelegate {
public:
BasicNetworkDelegate() {}
- virtual ~BasicNetworkDelegate() {}
+ ~BasicNetworkDelegate() override {}
private:
- virtual int OnBeforeURLRequest(URLRequest* request,
- const CompletionCallback& callback,
- GURL* new_url) override {
+ int OnBeforeURLRequest(URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) override {
EXPECT_TRUE(request->load_flags() & LOAD_DISABLE_CERT_REVOCATION_CHECKING);
return OK;
}
- virtual int OnBeforeSendHeaders(URLRequest* request,
- const CompletionCallback& callback,
- HttpRequestHeaders* headers) override {
+ int OnBeforeSendHeaders(URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) override {
return OK;
}
- virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) override {}
+ void OnSendHeaders(URLRequest* request,
+ const HttpRequestHeaders& headers) override {}
- virtual int OnHeadersReceived(
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
@@ -140,22 +138,21 @@
return OK;
}
- virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) override {}
+ void OnBeforeRedirect(URLRequest* request,
+ const GURL& new_location) override {}
- virtual void OnResponseStarted(URLRequest* request) override {}
+ void OnResponseStarted(URLRequest* request) override {}
- virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) override {}
+ void OnRawBytesRead(const URLRequest& request, int bytes_read) override {}
- virtual void OnCompleted(URLRequest* request, bool started) override {}
+ void OnCompleted(URLRequest* request, bool started) override {}
- virtual void OnURLRequestDestroyed(URLRequest* request) override {}
+ void OnURLRequestDestroyed(URLRequest* request) override {}
- virtual void OnPACScriptError(int line_number,
- const base::string16& error) override {}
+ void OnPACScriptError(int line_number, const base::string16& error) override {
+ }
- virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
+ NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
@@ -163,28 +160,27 @@
return NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
- virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) override {
+ bool OnCanGetCookies(const URLRequest& request,
+ const CookieList& cookie_list) override {
return true;
}
- virtual bool OnCanSetCookie(const URLRequest& request,
- const std::string& cookie_line,
- CookieOptions* options) override {
+ bool OnCanSetCookie(const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) override {
return true;
}
- virtual bool OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const override {
+ bool OnCanAccessFile(const net::URLRequest& request,
+ const base::FilePath& path) const override {
return true;
}
- virtual bool OnCanThrottleRequest(const URLRequest& request) const override {
+ bool OnCanThrottleRequest(const URLRequest& request) const override {
return false;
}
- virtual int OnBeforeSocketStreamConnect(
- SocketStream* stream,
- const CompletionCallback& callback) override {
+ int OnBeforeSocketStreamConnect(SocketStream* stream,
+ const CompletionCallback& callback) override {
return OK;
}
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index cb1011c..f83806c 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -119,9 +119,9 @@
public:
DefaultPollPolicy() {}
- virtual Mode GetNextDelay(int initial_error,
- TimeDelta current_delay,
- TimeDelta* next_delay) const override {
+ Mode GetNextDelay(int initial_error,
+ TimeDelta current_delay,
+ TimeDelta* next_delay) const override {
if (initial_error != OK) {
// Re-try policy for failures.
const int kDelay1Seconds = 8;
@@ -160,10 +160,9 @@
class ProxyConfigServiceDirect : public ProxyConfigService {
public:
// ProxyConfigService implementation:
- virtual void AddObserver(Observer* observer) override {}
- virtual void RemoveObserver(Observer* observer) override {}
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config)
- override {
+ void AddObserver(Observer* observer) override {}
+ void RemoveObserver(Observer* observer) override {}
+ ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override {
*config = ProxyConfig::CreateDirect();
config->set_source(PROXY_CONFIG_SOURCE_UNKNOWN);
return CONFIG_VALID;
@@ -176,28 +175,24 @@
ProxyResolverNull() : ProxyResolver(false /*expects_pac_bytes*/) {}
// ProxyResolver implementation.
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override {
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual void CancelRequest(RequestHandle request) override {
- NOTREACHED();
- }
+ void CancelRequest(RequestHandle request) override { NOTREACHED(); }
- virtual LoadState GetLoadState(RequestHandle request) const override {
+ LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() override {
- NOTREACHED();
- }
+ void CancelSetPacScript() override { NOTREACHED(); }
- virtual int SetPacScript(
+ int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& /*script_data*/,
const CompletionCallback& /*callback*/) override {
return ERR_NOT_IMPLEMENTED;
@@ -212,31 +207,26 @@
: ProxyResolver(false /*expects_pac_bytes*/),
pac_string_(pac_string) {}
- virtual int GetProxyForURL(const GURL& url,
- ProxyInfo* results,
- const CompletionCallback& callback,
- RequestHandle* request,
- const BoundNetLog& net_log) override {
+ int GetProxyForURL(const GURL& url,
+ ProxyInfo* results,
+ const CompletionCallback& callback,
+ RequestHandle* request,
+ const BoundNetLog& net_log) override {
results->UsePacString(pac_string_);
return OK;
}
- virtual void CancelRequest(RequestHandle request) override {
- NOTREACHED();
- }
+ void CancelRequest(RequestHandle request) override { NOTREACHED(); }
- virtual LoadState GetLoadState(RequestHandle request) const override {
+ LoadState GetLoadState(RequestHandle request) const override {
NOTREACHED();
return LOAD_STATE_IDLE;
}
- virtual void CancelSetPacScript() override {
- NOTREACHED();
- }
+ void CancelSetPacScript() override { NOTREACHED(); }
- virtual int SetPacScript(
- const scoped_refptr<ProxyResolverScriptData>& pac_script,
- const CompletionCallback& callback) override {
+ int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& pac_script,
+ const CompletionCallback& callback) override {
return OK;
}
@@ -250,7 +240,7 @@
ProxyResolverFactoryForSystem()
: ProxyResolverFactory(false /*expects_pac_bytes*/) {}
- virtual ProxyResolver* CreateProxyResolver() override {
+ ProxyResolver* CreateProxyResolver() override {
DCHECK(IsSupported());
#if defined(OS_WIN)
return new ProxyResolverWinHttp();
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index 942c6a4..040a0f8 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -97,7 +97,7 @@
ProxyResolver* resolver,
NetLog* net_log);
- virtual ~ProxyService();
+ ~ProxyService() override;
// Used internally to handle PAC queries.
// TODO(eroman): consider naming this simply "Request".
@@ -375,14 +375,14 @@
// NetworkChangeNotifier::IPAddressObserver
// When this is called, we re-fetch PAC scripts and re-run WPAD.
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
// NetworkChangeNotifier::DNSObserver
// We respond as above.
- virtual void OnDNSChanged() override;
+ void OnDNSChanged() override;
// ProxyConfigService::Observer
- virtual void OnProxyConfigChanged(
+ void OnProxyConfigChanged(
const ProxyConfig& config,
ProxyConfigService::ConfigAvailability availability) override;
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index acc015e..aab3de3 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -37,8 +37,9 @@
public:
ImmediatePollPolicy() {}
- virtual Mode GetNextDelay(int error, base::TimeDelta current_delay,
- base::TimeDelta* next_delay) const override {
+ Mode GetNextDelay(int error,
+ base::TimeDelta current_delay,
+ base::TimeDelta* next_delay) const override {
*next_delay = base::TimeDelta::FromMilliseconds(1);
return MODE_USE_TIMER;
}
@@ -53,8 +54,9 @@
public:
NeverPollPolicy() {}
- virtual Mode GetNextDelay(int error, base::TimeDelta current_delay,
- base::TimeDelta* next_delay) const override {
+ Mode GetNextDelay(int error,
+ base::TimeDelta current_delay,
+ base::TimeDelta* next_delay) const override {
*next_delay = base::TimeDelta::FromDays(60);
return MODE_USE_TIMER;
}
@@ -68,8 +70,9 @@
public:
ImmediateAfterActivityPollPolicy() {}
- virtual Mode GetNextDelay(int error, base::TimeDelta current_delay,
- base::TimeDelta* next_delay) const override {
+ Mode GetNextDelay(int error,
+ base::TimeDelta current_delay,
+ base::TimeDelta* next_delay) const override {
*next_delay = base::TimeDelta();
return MODE_START_AFTER_ACTIVITY;
}
@@ -127,16 +130,15 @@
config_(ProxyConfig::CreateFromCustomPacURL(GURL(pac_url))) {
}
- virtual void AddObserver(Observer* observer) override {
+ void AddObserver(Observer* observer) override {
observers_.AddObserver(observer);
}
- virtual void RemoveObserver(Observer* observer) override {
+ void RemoveObserver(Observer* observer) override {
observers_.RemoveObserver(observer);
}
- virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* results)
- override {
+ ConfigAvailability GetLatestProxyConfig(ProxyConfig* results) override {
if (availability_ == CONFIG_VALID)
*results = config_;
return availability_;
@@ -165,10 +167,10 @@
proxy_service_(NULL) {
}
- virtual void OnResolveProxy(const GURL& url,
- int load_flags,
- const ProxyService& proxy_service,
- ProxyInfo* result) override {
+ void OnResolveProxy(const GURL& url,
+ int load_flags,
+ const ProxyService& proxy_service,
+ ProxyInfo* result) override {
on_resolve_proxy_called_ = true;
proxy_service_ = &proxy_service;
DCHECK(!add_proxy_ || !remove_proxy_);
@@ -210,8 +212,8 @@
proxy_fallback_net_error_(OK) {
}
- virtual void OnProxyFallback(const ProxyServer& proxy_server,
- int net_error) override {
+ void OnProxyFallback(const ProxyServer& proxy_server,
+ int net_error) override {
proxy_server_ = proxy_server;
proxy_fallback_net_error_ = net_error;
on_proxy_fallback_called_ = true;
diff --git a/net/quic/congestion_control/pacing_sender.cc b/net/quic/congestion_control/pacing_sender.cc
index 03e5534..d53fccc 100644
--- a/net/quic/congestion_control/pacing_sender.cc
+++ b/net/quic/congestion_control/pacing_sender.cc
@@ -62,13 +62,9 @@
next_packet_send_time_ = QuicTime::Zero();
return in_flight;
}
- // The next packet should be sent as soon as the current packets has
- // been transferred. We pace at twice the rate of the underlying
- // sender's bandwidth estimate during slow start and 1.25x during congestion
- // avoidance to ensure pacing doesn't prevent us from filling the window.
- const float kPacingAggression = sender_->InSlowStart() ? 2 : 1.25;
- QuicTime::Delta delay =
- BandwidthEstimate().Scale(kPacingAggression).TransferTime(bytes);
+ // The next packet should be sent as soon as the current packets has been
+ // transferred.
+ QuicTime::Delta delay = PacingRate().TransferTime(bytes);
// If the last send was delayed, and the alarm took a long time to get
// invoked, allow the connection to make up for lost time.
if (was_last_send_delayed_) {
@@ -145,6 +141,10 @@
return QuicTime::Delta::Zero();
}
+QuicBandwidth PacingSender::PacingRate() const {
+ return sender_->PacingRate();
+}
+
QuicBandwidth PacingSender::BandwidthEstimate() const {
return sender_->BandwidthEstimate();
}
diff --git a/net/quic/congestion_control/pacing_sender.h b/net/quic/congestion_control/pacing_sender.h
index e50527d..5271dbc 100644
--- a/net/quic/congestion_control/pacing_sender.h
+++ b/net/quic/congestion_control/pacing_sender.h
@@ -32,37 +32,38 @@
PacingSender(SendAlgorithmInterface* sender,
QuicTime::Delta alarm_granularity,
uint32 initial_packet_burst);
- virtual ~PacingSender();
+ ~PacingSender() override;
// SendAlgorithmInterface methods.
- virtual void SetFromConfig(const QuicConfig& config, bool is_server) override;
- virtual void SetNumEmulatedConnections(int num_connections) override;
- virtual void OnIncomingQuicCongestionFeedbackFrame(
+ void SetFromConfig(const QuicConfig& config, bool is_server) override;
+ void SetNumEmulatedConnections(int num_connections) override;
+ void OnIncomingQuicCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& feedback,
QuicTime feedback_receive_time) override;
- virtual void OnCongestionEvent(bool rtt_updated,
- QuicByteCount bytes_in_flight,
- const CongestionVector& acked_packets,
- const CongestionVector& lost_packets) override;
- virtual bool OnPacketSent(QuicTime sent_time,
- QuicByteCount bytes_in_flight,
- QuicPacketSequenceNumber sequence_number,
- QuicByteCount bytes,
- HasRetransmittableData is_retransmittable) override;
- virtual void OnRetransmissionTimeout(bool packets_retransmitted) override;
- virtual void RevertRetransmissionTimeout() override;
- virtual QuicTime::Delta TimeUntilSend(
+ void OnCongestionEvent(bool rtt_updated,
+ QuicByteCount bytes_in_flight,
+ const CongestionVector& acked_packets,
+ const CongestionVector& lost_packets) override;
+ bool OnPacketSent(QuicTime sent_time,
+ QuicByteCount bytes_in_flight,
+ QuicPacketSequenceNumber sequence_number,
+ QuicByteCount bytes,
+ HasRetransmittableData is_retransmittable) override;
+ void OnRetransmissionTimeout(bool packets_retransmitted) override;
+ void RevertRetransmissionTimeout() override;
+ QuicTime::Delta TimeUntilSend(
QuicTime now,
QuicByteCount bytes_in_flight,
HasRetransmittableData has_retransmittable_data) const override;
- virtual QuicBandwidth BandwidthEstimate() const override;
- virtual bool HasReliableBandwidthEstimate() const override;
- virtual QuicTime::Delta RetransmissionDelay() const override;
- virtual QuicByteCount GetCongestionWindow() const override;
- virtual bool InSlowStart() const override;
- virtual bool InRecovery() const override;
- virtual QuicByteCount GetSlowStartThreshold() const override;
- virtual CongestionControlType GetCongestionControlType() const override;
+ QuicBandwidth PacingRate() const override;
+ QuicBandwidth BandwidthEstimate() const override;
+ bool HasReliableBandwidthEstimate() const override;
+ QuicTime::Delta RetransmissionDelay() const override;
+ QuicByteCount GetCongestionWindow() const override;
+ bool InSlowStart() const override;
+ bool InRecovery() const override;
+ QuicByteCount GetSlowStartThreshold() const override;
+ CongestionControlType GetCongestionControlType() const override;
private:
scoped_ptr<SendAlgorithmInterface> sender_; // Underlying sender.
diff --git a/net/quic/congestion_control/pacing_sender_test.cc b/net/quic/congestion_control/pacing_sender_test.cc
index f887c54..0be0b0a 100644
--- a/net/quic/congestion_control/pacing_sender_test.cc
+++ b/net/quic/congestion_control/pacing_sender_test.cc
@@ -134,14 +134,10 @@
}
TEST_F(PacingSenderTest, VariousSending) {
- // Start the test in slow start.
- EXPECT_CALL(*mock_sender_, InSlowStart()).WillRepeatedly(Return(true));
-
- // Configure bandwith of 1 packet per 2 ms, for which the pacing rate
- // will be 1 packet per 1 ms.
- EXPECT_CALL(*mock_sender_, BandwidthEstimate())
+ // Configure pacing rate of 1 packet per 1 ms.
+ EXPECT_CALL(*mock_sender_, PacingRate())
.WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
- kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
+ kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))));
// Now update the RTT and verify that packets are actually paced.
EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytesInFlight, _, _));
@@ -204,14 +200,10 @@
}
TEST_F(PacingSenderTest, CongestionAvoidanceSending) {
- // Start the test in congestion avoidance.
- EXPECT_CALL(*mock_sender_, InSlowStart()).WillRepeatedly(Return(false));
-
- // Configure bandwith of 1 packet per 2 ms, for which the pacing rate
- // will be 1 packet per 1 ms.
- EXPECT_CALL(*mock_sender_, BandwidthEstimate())
+ // Configure pacing rate of 1 packet per 1 ms.
+ EXPECT_CALL(*mock_sender_, PacingRate())
.WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
- kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
+ kMaxPacketSize * 1.25, QuicTime::Delta::FromMilliseconds(2))));
// Now update the RTT and verify that packets are actually paced.
EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytesInFlight, _, _));
@@ -272,14 +264,11 @@
pacing_sender_.reset(new PacingSender(mock_sender_,
QuicTime::Delta::FromMilliseconds(1),
10));
- // Start the test in slow start.
- EXPECT_CALL(*mock_sender_, InSlowStart()).WillRepeatedly(Return(true));
- // Configure bandwith of 1 packet per 2 ms, for which the pacing rate
- // will be 1 packet per 1 ms.
- EXPECT_CALL(*mock_sender_, BandwidthEstimate())
+ // Configure pacing rate of 1 packet per 1 ms.
+ EXPECT_CALL(*mock_sender_, PacingRate())
.WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
- kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
+ kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))));
// Update the RTT and verify that the first 10 packets aren't paced.
EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytesInFlight, _, _));
@@ -330,14 +319,11 @@
pacing_sender_.reset(new PacingSender(mock_sender_,
QuicTime::Delta::FromMilliseconds(1),
10));
- // Start the test in slow start.
- EXPECT_CALL(*mock_sender_, InSlowStart()).WillRepeatedly(Return(true));
- // Configure bandwith of 1 packet per 2 ms, for which the pacing rate
- // will be 1 packet per 1 ms.
- EXPECT_CALL(*mock_sender_, BandwidthEstimate())
+ // Configure pacing rate of 1 packet per 1 ms.
+ EXPECT_CALL(*mock_sender_, PacingRate())
.WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
- kMaxPacketSize, QuicTime::Delta::FromMilliseconds(2))));
+ kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))));
// Send 10 packets, and verify that they are not paced.
for (int i = 0 ; i < kInitialBurstPackets; ++i) {
diff --git a/net/quic/congestion_control/rtt_stats.cc b/net/quic/congestion_control/rtt_stats.cc
index b03686d..2eb0b8d 100644
--- a/net/quic/congestion_control/rtt_stats.cc
+++ b/net/quic/congestion_control/rtt_stats.cc
@@ -68,7 +68,7 @@
<< (rtt_sample.IsZero() ? "Zero" : "Infinite");
return;
}
- // RTT can't be negative.
+ // RTT can't be non-positive.
DCHECK_LT(0, rtt_sample.ToMicroseconds());
latest_rtt_ = rtt_sample;
@@ -138,4 +138,11 @@
return smoothed_rtt_;
}
+QuicTime::Delta RttStats::MinRtt() const {
+ if (!HasUpdates()) {
+ return QuicTime::Delta::FromMicroseconds(initial_rtt_us_);
+ }
+ return min_rtt_;
+}
+
} // namespace net
diff --git a/net/quic/congestion_control/rtt_stats.h b/net/quic/congestion_control/rtt_stats.h
index 5e01687..b7ec6b9 100644
--- a/net/quic/congestion_control/rtt_stats.h
+++ b/net/quic/congestion_control/rtt_stats.h
@@ -43,6 +43,11 @@
QuicTime::Delta SmoothedRtt() const;
+ // Returns the min_rtt for the entire connection if a min has been measured.
+ // This returns an initial non-zero RTT estimate if no measurements have yet
+ // been made.
+ QuicTime::Delta MinRtt() const;
+
int64 initial_rtt_us() const {
return initial_rtt_us_;
}
@@ -56,11 +61,6 @@
return latest_rtt_;
}
- // Returns the min_rtt for the entire connection.
- QuicTime::Delta min_rtt() const {
- return min_rtt_;
- }
-
// Returns the min_rtt since SampleNewRecentMinRtt has been called, or the
// min_rtt for the entire connection if SampleNewMinRtt was never called.
QuicTime::Delta recent_min_rtt() const {
diff --git a/net/quic/congestion_control/rtt_stats_test.cc b/net/quic/congestion_control/rtt_stats_test.cc
index 6b5ff7d..9b7ada1 100644
--- a/net/quic/congestion_control/rtt_stats_test.cc
+++ b/net/quic/congestion_control/rtt_stats_test.cc
@@ -26,36 +26,44 @@
RttStats rtt_stats_;
};
+TEST_F(RttStatsTest, DefaultsBeforeUpdate) {
+ EXPECT_LT(0u, rtt_stats_.initial_rtt_us());
+ EXPECT_EQ(QuicTime::Delta::FromMicroseconds(rtt_stats_.initial_rtt_us()),
+ rtt_stats_.MinRtt());
+ EXPECT_EQ(QuicTime::Delta::FromMicroseconds(rtt_stats_.initial_rtt_us()),
+ rtt_stats_.SmoothedRtt());
+}
+
TEST_F(RttStatsTest, MinRtt) {
- rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100),
+ rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(200),
QuicTime::Delta::Zero(),
QuicTime::Zero());
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(100), rtt_stats_.min_rtt());
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(100),
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(200), rtt_stats_.MinRtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(200),
rtt_stats_.recent_min_rtt());
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(10),
QuicTime::Delta::Zero(),
QuicTime::Zero().Add(
QuicTime::Delta::FromMilliseconds(10)));
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.recent_min_rtt());
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(50),
QuicTime::Delta::Zero(),
QuicTime::Zero().Add(
QuicTime::Delta::FromMilliseconds(20)));
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.recent_min_rtt());
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(50),
QuicTime::Delta::Zero(),
QuicTime::Zero().Add(
QuicTime::Delta::FromMilliseconds(30)));
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.recent_min_rtt());
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(50),
QuicTime::Delta::Zero(),
QuicTime::Zero().Add(
QuicTime::Delta::FromMilliseconds(40)));
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.recent_min_rtt());
}
@@ -63,7 +71,7 @@
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(10),
QuicTime::Delta::Zero(),
QuicTime::Zero());
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.recent_min_rtt());
rtt_stats_.SampleNewRecentMinRtt(4);
@@ -71,14 +79,14 @@
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(50),
QuicTime::Delta::Zero(),
QuicTime::Zero());
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10),
rtt_stats_.recent_min_rtt());
}
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(50),
QuicTime::Delta::Zero(),
QuicTime::Zero());
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(50), rtt_stats_.recent_min_rtt());
}
@@ -89,7 +97,7 @@
QuicTime now = QuicTime::Zero();
QuicTime::Delta rtt_sample = QuicTime::Delta::FromMilliseconds(10);
rtt_stats_.UpdateRtt(rtt_sample, QuicTime::Delta::Zero(), now);
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.recent_min_rtt());
// Gradually increase the rtt samples and ensure the recent_min_rtt starts
@@ -98,7 +106,7 @@
now = now.Add(QuicTime::Delta::FromMilliseconds(25));
rtt_sample = rtt_sample.Add(QuicTime::Delta::FromMilliseconds(10));
rtt_stats_.UpdateRtt(rtt_sample, QuicTime::Delta::Zero(), now);
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(rtt_sample, RttStatsPeer::GetQuarterWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample.Subtract(QuicTime::Delta::FromMilliseconds(10)),
RttStatsPeer::GetHalfWindowRtt(&rtt_stats_));
@@ -120,7 +128,7 @@
// A new quarter rtt low sets that, but nothing else.
rtt_sample = rtt_sample.Subtract(QuicTime::Delta::FromMilliseconds(5));
rtt_stats_.UpdateRtt(rtt_sample, QuicTime::Delta::Zero(), now);
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(rtt_sample, RttStatsPeer::GetQuarterWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample.Subtract(QuicTime::Delta::FromMilliseconds(5)),
RttStatsPeer::GetHalfWindowRtt(&rtt_stats_));
@@ -130,7 +138,7 @@
// A new half rtt low sets that and the quarter rtt low.
rtt_sample = rtt_sample.Subtract(QuicTime::Delta::FromMilliseconds(15));
rtt_stats_.UpdateRtt(rtt_sample, QuicTime::Delta::Zero(), now);
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(rtt_sample, RttStatsPeer::GetQuarterWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample, RttStatsPeer::GetHalfWindowRtt(&rtt_stats_));
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(70),
@@ -139,7 +147,7 @@
// A new full window loss sets the recent_min_rtt, but not min_rtt.
rtt_sample = QuicTime::Delta::FromMilliseconds(65);
rtt_stats_.UpdateRtt(rtt_sample, QuicTime::Delta::Zero(), now);
- EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.min_rtt());
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(10), rtt_stats_.MinRtt());
EXPECT_EQ(rtt_sample, RttStatsPeer::GetQuarterWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample, RttStatsPeer::GetHalfWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample, rtt_stats_.recent_min_rtt());
@@ -148,7 +156,7 @@
rtt_sample = QuicTime::Delta::FromMilliseconds(5);
rtt_stats_.UpdateRtt(rtt_sample, QuicTime::Delta::Zero(), now);
- EXPECT_EQ(rtt_sample, rtt_stats_.min_rtt());
+ EXPECT_EQ(rtt_sample, rtt_stats_.MinRtt());
EXPECT_EQ(rtt_sample, RttStatsPeer::GetQuarterWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample, RttStatsPeer::GetHalfWindowRtt(&rtt_stats_));
EXPECT_EQ(rtt_sample, rtt_stats_.recent_min_rtt());
@@ -157,7 +165,7 @@
TEST_F(RttStatsTest, ExpireSmoothedMetrics) {
QuicTime::Delta initial_rtt = QuicTime::Delta::FromMilliseconds(10);
rtt_stats_.UpdateRtt(initial_rtt, QuicTime::Delta::Zero(), QuicTime::Zero());
- EXPECT_EQ(initial_rtt, rtt_stats_.min_rtt());
+ EXPECT_EQ(initial_rtt, rtt_stats_.MinRtt());
EXPECT_EQ(initial_rtt, rtt_stats_.recent_min_rtt());
EXPECT_EQ(initial_rtt, rtt_stats_.SmoothedRtt());
diff --git a/net/quic/congestion_control/send_algorithm_interface.h b/net/quic/congestion_control/send_algorithm_interface.h
index 14383f8..4a11693 100644
--- a/net/quic/congestion_control/send_algorithm_interface.h
+++ b/net/quic/congestion_control/send_algorithm_interface.h
@@ -82,6 +82,8 @@
QuicByteCount bytes_in_flight,
HasRetransmittableData has_retransmittable_data) const = 0;
+ virtual QuicBandwidth PacingRate() const = 0;
+
// What's the current estimated bandwidth in bytes per second.
// Returns 0 when it does not have an estimate.
virtual QuicBandwidth BandwidthEstimate() const = 0;
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index 0aae5fd..91b95cf 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -98,7 +98,7 @@
const CongestionVector& lost_packets) {
if (rtt_updated && InSlowStart() &&
hybrid_slow_start_.ShouldExitSlowStart(rtt_stats_->latest_rtt(),
- rtt_stats_->min_rtt(),
+ rtt_stats_->MinRtt(),
congestion_window_)) {
slowstart_threshold_ = congestion_window_;
}
@@ -204,7 +204,18 @@
return min(receive_window_, GetCongestionWindow());
}
+QuicBandwidth TcpCubicSender::PacingRate() const {
+ // We pace at twice the rate of the underlying sender's bandwidth estimate
+ // during slow start and 1.25x during congestion avoidance to ensure pacing
+ // doesn't prevent us from filling the window.
+ return BandwidthEstimate().Scale(InSlowStart() ? 2 : 1.25);
+}
+
QuicBandwidth TcpCubicSender::BandwidthEstimate() const {
+ if (rtt_stats_->SmoothedRtt().IsZero()) {
+ LOG(DFATAL) << "In BandwidthEstimate(), smoothed RTT is zero!";
+ return QuicBandwidth::Zero();
+ }
return QuicBandwidth::FromBytesAndTimeDelta(GetCongestionWindow(),
rtt_stats_->SmoothedRtt());
}
@@ -217,9 +228,8 @@
if (!rtt_stats_->HasUpdates()) {
return QuicTime::Delta::Zero();
}
- return QuicTime::Delta::FromMicroseconds(
- rtt_stats_->SmoothedRtt().ToMicroseconds() +
- 4 * rtt_stats_->mean_deviation().ToMicroseconds());
+ return rtt_stats_->SmoothedRtt().Add(
+ rtt_stats_->mean_deviation().Multiply(4));
}
QuicByteCount TcpCubicSender::GetCongestionWindow() const {
@@ -294,7 +304,7 @@
} else {
congestion_window_ = min(max_tcp_congestion_window_,
cubic_.CongestionWindowAfterAck(
- congestion_window_, rtt_stats_->min_rtt()));
+ congestion_window_, rtt_stats_->MinRtt()));
DVLOG(1) << "Cubic; congestion window: " << congestion_window_
<< " slowstart threshold: " << slowstart_threshold_;
}
diff --git a/net/quic/congestion_control/tcp_cubic_sender.h b/net/quic/congestion_control/tcp_cubic_sender.h
index dd0df58..ed0428a 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.h
+++ b/net/quic/congestion_control/tcp_cubic_sender.h
@@ -35,37 +35,38 @@
bool reno,
QuicTcpCongestionWindow max_tcp_congestion_window,
QuicConnectionStats* stats);
- virtual ~TcpCubicSender();
+ ~TcpCubicSender() override;
// Start implementation of SendAlgorithmInterface.
- virtual void SetFromConfig(const QuicConfig& config, bool is_server) override;
- virtual void SetNumEmulatedConnections(int num_connections) override;
- virtual void OnIncomingQuicCongestionFeedbackFrame(
+ void SetFromConfig(const QuicConfig& config, bool is_server) override;
+ void SetNumEmulatedConnections(int num_connections) override;
+ void OnIncomingQuicCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& feedback,
QuicTime feedback_receive_time) override;
- virtual void OnCongestionEvent(bool rtt_updated,
- QuicByteCount bytes_in_flight,
- const CongestionVector& acked_packets,
- const CongestionVector& lost_packets) override;
- virtual bool OnPacketSent(QuicTime sent_time,
- QuicByteCount bytes_in_flight,
- QuicPacketSequenceNumber sequence_number,
- QuicByteCount bytes,
- HasRetransmittableData is_retransmittable) override;
- virtual void OnRetransmissionTimeout(bool packets_retransmitted) override;
- virtual void RevertRetransmissionTimeout() override;
- virtual QuicTime::Delta TimeUntilSend(
+ void OnCongestionEvent(bool rtt_updated,
+ QuicByteCount bytes_in_flight,
+ const CongestionVector& acked_packets,
+ const CongestionVector& lost_packets) override;
+ bool OnPacketSent(QuicTime sent_time,
+ QuicByteCount bytes_in_flight,
+ QuicPacketSequenceNumber sequence_number,
+ QuicByteCount bytes,
+ HasRetransmittableData is_retransmittable) override;
+ void OnRetransmissionTimeout(bool packets_retransmitted) override;
+ void RevertRetransmissionTimeout() override;
+ QuicTime::Delta TimeUntilSend(
QuicTime now,
QuicByteCount bytes_in_flight,
HasRetransmittableData has_retransmittable_data) const override;
- virtual QuicBandwidth BandwidthEstimate() const override;
- virtual bool HasReliableBandwidthEstimate() const override;
- virtual QuicTime::Delta RetransmissionDelay() const override;
- virtual QuicByteCount GetCongestionWindow() const override;
- virtual bool InSlowStart() const override;
- virtual bool InRecovery() const override;
- virtual QuicByteCount GetSlowStartThreshold() const override;
- virtual CongestionControlType GetCongestionControlType() const override;
+ QuicBandwidth PacingRate() const override;
+ QuicBandwidth BandwidthEstimate() const override;
+ bool HasReliableBandwidthEstimate() const override;
+ QuicTime::Delta RetransmissionDelay() const override;
+ QuicByteCount GetCongestionWindow() const override;
+ bool InSlowStart() const override;
+ bool InRecovery() const override;
+ QuicByteCount GetSlowStartThreshold() const override;
+ CongestionControlType GetCongestionControlType() const override;
// End implementation of SendAlgorithmInterface.
private:
diff --git a/net/quic/congestion_control/tcp_loss_algorithm.h b/net/quic/congestion_control/tcp_loss_algorithm.h
index 201354b..0b1c995 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm.h
+++ b/net/quic/congestion_control/tcp_loss_algorithm.h
@@ -21,19 +21,19 @@
class NET_EXPORT_PRIVATE TCPLossAlgorithm : public LossDetectionInterface {
public:
TCPLossAlgorithm();
- virtual ~TCPLossAlgorithm() {}
+ ~TCPLossAlgorithm() override {}
- virtual LossDetectionType GetLossDetectionType() const override;
+ LossDetectionType GetLossDetectionType() const override;
// Uses nack counts to decide when packets are lost.
- virtual SequenceNumberSet DetectLostPackets(
+ SequenceNumberSet DetectLostPackets(
const QuicUnackedPacketMap& unacked_packets,
const QuicTime& time,
QuicPacketSequenceNumber largest_observed,
const RttStats& rtt_stats) override;
// Returns a non-zero value when the early retransmit timer is active.
- virtual QuicTime GetLossTimeout() const override;
+ QuicTime GetLossTimeout() const override;
private:
QuicTime loss_detection_timeout_;
diff --git a/net/quic/congestion_control/tcp_loss_algorithm_test.cc b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
index 988f427..34bcc16 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
@@ -27,8 +27,8 @@
void SendDataPacket(QuicPacketSequenceNumber sequence_number) {
SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
nullptr, 0, new RetransmittableFrames());
- unacked_packets_.AddPacket(packet);
- unacked_packets_.SetSent(sequence_number, clock_.Now(), 1000, true);
+ unacked_packets_.AddSentPacket(packet, 0, NOT_RETRANSMISSION, clock_.Now(),
+ 1000, true);
}
void VerifyLosses(QuicPacketSequenceNumber largest_observed,
diff --git a/net/quic/congestion_control/tcp_receiver.h b/net/quic/congestion_control/tcp_receiver.h
index 89e9186..7dae4f4 100644
--- a/net/quic/congestion_control/tcp_receiver.h
+++ b/net/quic/congestion_control/tcp_receiver.h
@@ -24,12 +24,12 @@
static const QuicByteCount kReceiveWindowTCP;
// Start implementation of SendAlgorithmInterface.
- virtual bool GenerateCongestionFeedback(
+ bool GenerateCongestionFeedback(
QuicCongestionFeedbackFrame* feedback) override;
- virtual void RecordIncomingPacket(QuicByteCount bytes,
- QuicPacketSequenceNumber sequence_number,
- QuicTime timestamp) override;
+ void RecordIncomingPacket(QuicByteCount bytes,
+ QuicPacketSequenceNumber sequence_number,
+ QuicTime timestamp) override;
private:
QuicByteCount receive_window_;
diff --git a/net/quic/congestion_control/time_loss_algorithm.h b/net/quic/congestion_control/time_loss_algorithm.h
index de517ef..794a07d 100644
--- a/net/quic/congestion_control/time_loss_algorithm.h
+++ b/net/quic/congestion_control/time_loss_algorithm.h
@@ -21,14 +21,14 @@
class NET_EXPORT_PRIVATE TimeLossAlgorithm : public LossDetectionInterface {
public:
TimeLossAlgorithm();
- virtual ~TimeLossAlgorithm() {}
+ ~TimeLossAlgorithm() override {}
- virtual LossDetectionType GetLossDetectionType() const override;
+ LossDetectionType GetLossDetectionType() const override;
// Declares pending packets less than the largest observed lost when it has
// been 1.25 RTT since they were sent. Packets larger than the largest
// observed are retransmitted via TLP.
- virtual SequenceNumberSet DetectLostPackets(
+ SequenceNumberSet DetectLostPackets(
const QuicUnackedPacketMap& unacked_packets,
const QuicTime& time,
QuicPacketSequenceNumber largest_observed,
@@ -39,7 +39,7 @@
// TODO(ianswett): Ideally the RTT variance and the RTT would be used to
// determine the time a packet is considered lost.
// TODO(ianswett): Consider using Max(1.25 * srtt, 1.125 * last_rtt).
- virtual QuicTime GetLossTimeout() const override;
+ QuicTime GetLossTimeout() const override;
private:
QuicTime loss_detection_timeout_;
diff --git a/net/quic/congestion_control/time_loss_algorithm_test.cc b/net/quic/congestion_control/time_loss_algorithm_test.cc
index 4139019..374e563 100644
--- a/net/quic/congestion_control/time_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/time_loss_algorithm_test.cc
@@ -27,8 +27,8 @@
void SendDataPacket(QuicPacketSequenceNumber sequence_number) {
SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
nullptr, 0, new RetransmittableFrames());
- unacked_packets_.AddPacket(packet);
- unacked_packets_.SetSent(sequence_number, clock_.Now(), 1000, true);
+ unacked_packets_.AddSentPacket(packet, 0, NOT_RETRANSMISSION, clock_.Now(),
+ 1000, true);
}
void VerifyLosses(QuicPacketSequenceNumber largest_observed,
diff --git a/net/quic/crypto/aead_base_decrypter.h b/net/quic/crypto/aead_base_decrypter.h
index 116dbe1..5118b11 100644
--- a/net/quic/crypto/aead_base_decrypter.h
+++ b/net/quic/crypto/aead_base_decrypter.h
@@ -37,21 +37,21 @@
size_t auth_tag_size,
size_t nonce_prefix_size);
#endif
- virtual ~AeadBaseDecrypter();
+ ~AeadBaseDecrypter() override;
// QuicDecrypter implementation
- virtual bool SetKey(base::StringPiece key) override;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
- virtual bool Decrypt(base::StringPiece nonce,
- base::StringPiece associated_data,
- base::StringPiece ciphertext,
- unsigned char* output,
- size_t* output_length) override;
- virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
- base::StringPiece associated_data,
- base::StringPiece ciphertext) override;
- virtual base::StringPiece GetKey() const override;
- virtual base::StringPiece GetNoncePrefix() const override;
+ bool SetKey(base::StringPiece key) override;
+ bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
+ bool Decrypt(base::StringPiece nonce,
+ base::StringPiece associated_data,
+ base::StringPiece ciphertext,
+ unsigned char* output,
+ size_t* output_length) override;
+ QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
+ base::StringPiece associated_data,
+ base::StringPiece ciphertext) override;
+ base::StringPiece GetKey() const override;
+ base::StringPiece GetNoncePrefix() const override;
protected:
// Make these constants available to the subclasses so that the subclasses
diff --git a/net/quic/crypto/aead_base_encrypter.h b/net/quic/crypto/aead_base_encrypter.h
index 89c7a1f..7d9b6fc 100644
--- a/net/quic/crypto/aead_base_encrypter.h
+++ b/net/quic/crypto/aead_base_encrypter.h
@@ -37,24 +37,24 @@
size_t auth_tag_size,
size_t nonce_prefix_size);
#endif
- virtual ~AeadBaseEncrypter();
+ ~AeadBaseEncrypter() override;
// QuicEncrypter implementation
- virtual bool SetKey(base::StringPiece key) override;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
- virtual bool Encrypt(base::StringPiece nonce,
- base::StringPiece associated_data,
- base::StringPiece plaintext,
- unsigned char* output) override;
- virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
- base::StringPiece associated_data,
- base::StringPiece plaintext) override;
- virtual size_t GetKeySize() const override;
- virtual size_t GetNoncePrefixSize() const override;
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
- virtual size_t GetCiphertextSize(size_t plaintext_size) const override;
- virtual base::StringPiece GetKey() const override;
- virtual base::StringPiece GetNoncePrefix() const override;
+ bool SetKey(base::StringPiece key) override;
+ bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
+ bool Encrypt(base::StringPiece nonce,
+ base::StringPiece associated_data,
+ base::StringPiece plaintext,
+ unsigned char* output) override;
+ QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
+ base::StringPiece associated_data,
+ base::StringPiece plaintext) override;
+ size_t GetKeySize() const override;
+ size_t GetNoncePrefixSize() const override;
+ size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
+ size_t GetCiphertextSize(size_t plaintext_size) const override;
+ base::StringPiece GetKey() const override;
+ base::StringPiece GetNoncePrefix() const override;
protected:
// Make these constants available to the subclasses so that the subclasses
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter.h b/net/quic/crypto/aes_128_gcm_12_decrypter.h
index 4395dc2..3de537e 100644
--- a/net/quic/crypto/aes_128_gcm_12_decrypter.h
+++ b/net/quic/crypto/aes_128_gcm_12_decrypter.h
@@ -23,7 +23,7 @@
};
Aes128Gcm12Decrypter();
- virtual ~Aes128Gcm12Decrypter();
+ ~Aes128Gcm12Decrypter() override;
#if !defined(USE_OPENSSL)
protected:
diff --git a/net/quic/crypto/aes_128_gcm_12_encrypter.h b/net/quic/crypto/aes_128_gcm_12_encrypter.h
index afbeb14..bff3ec5 100644
--- a/net/quic/crypto/aes_128_gcm_12_encrypter.h
+++ b/net/quic/crypto/aes_128_gcm_12_encrypter.h
@@ -23,7 +23,7 @@
};
Aes128Gcm12Encrypter();
- virtual ~Aes128Gcm12Encrypter();
+ ~Aes128Gcm12Encrypter() override;
#if !defined(USE_OPENSSL)
protected:
diff --git a/net/quic/crypto/chacha20_poly1305_decrypter.h b/net/quic/crypto/chacha20_poly1305_decrypter.h
index e3c3e7f..04f5341 100644
--- a/net/quic/crypto/chacha20_poly1305_decrypter.h
+++ b/net/quic/crypto/chacha20_poly1305_decrypter.h
@@ -24,7 +24,7 @@
};
ChaCha20Poly1305Decrypter();
- virtual ~ChaCha20Poly1305Decrypter();
+ ~ChaCha20Poly1305Decrypter() override;
// Returns true if the underlying crypto library supports ChaCha20+Poly1305.
static bool IsSupported();
diff --git a/net/quic/crypto/chacha20_poly1305_encrypter.h b/net/quic/crypto/chacha20_poly1305_encrypter.h
index b99fa27..1dcfd7c 100644
--- a/net/quic/crypto/chacha20_poly1305_encrypter.h
+++ b/net/quic/crypto/chacha20_poly1305_encrypter.h
@@ -24,7 +24,7 @@
};
ChaCha20Poly1305Encrypter();
- virtual ~ChaCha20Poly1305Encrypter();
+ ~ChaCha20Poly1305Encrypter() override;
// Returns true if the underlying crypto library supports ChaCha20+Poly1305.
static bool IsSupported();
diff --git a/net/quic/crypto/channel_id_chromium.h b/net/quic/crypto/channel_id_chromium.h
index 72f694d..20a1d8d 100644
--- a/net/quic/crypto/channel_id_chromium.h
+++ b/net/quic/crypto/channel_id_chromium.h
@@ -20,12 +20,12 @@
class NET_EXPORT_PRIVATE ChannelIDKeyChromium: public ChannelIDKey {
public:
explicit ChannelIDKeyChromium(crypto::ECPrivateKey* ec_private_key);
- virtual ~ChannelIDKeyChromium();
+ ~ChannelIDKeyChromium() override;
// ChannelIDKey interface
- virtual bool Sign(base::StringPiece signed_data,
- std::string* out_signature) const override;
- virtual std::string SerializeKey() const override;
+ bool Sign(base::StringPiece signed_data,
+ std::string* out_signature) const override;
+ std::string SerializeKey() const override;
private:
scoped_ptr<crypto::ECPrivateKey> ec_private_key_;
@@ -36,13 +36,12 @@
public:
explicit ChannelIDSourceChromium(
ChannelIDService* channel_id_service);
- virtual ~ChannelIDSourceChromium();
+ ~ChannelIDSourceChromium() override;
// ChannelIDSource interface
- virtual QuicAsyncStatus GetChannelIDKey(
- const std::string& hostname,
- scoped_ptr<ChannelIDKey>* channel_id_key,
- ChannelIDSourceCallback* callback) override;
+ QuicAsyncStatus GetChannelIDKey(const std::string& hostname,
+ scoped_ptr<ChannelIDKey>* channel_id_key,
+ ChannelIDSourceCallback* callback) override;
private:
class Job;
diff --git a/net/quic/crypto/common_cert_set.cc b/net/quic/crypto/common_cert_set.cc
index 0d39ecc..cc4f91b 100644
--- a/net/quic/crypto/common_cert_set.cc
+++ b/net/quic/crypto/common_cert_set.cc
@@ -69,12 +69,12 @@
class CommonCertSetsQUIC : public CommonCertSets {
public:
// CommonCertSets interface.
- virtual StringPiece GetCommonHashes() const override {
+ StringPiece GetCommonHashes() const override {
return StringPiece(reinterpret_cast<const char*>(kSetHashes),
sizeof(uint64) * arraysize(kSetHashes));
}
- virtual StringPiece GetCert(uint64 hash, uint32 index) const override {
+ StringPiece GetCert(uint64 hash, uint32 index) const override {
for (size_t i = 0; i < arraysize(kSets); i++) {
if (kSets[i].hash == hash) {
if (index < kSets[i].num_certs) {
@@ -89,8 +89,10 @@
return StringPiece();
}
- virtual bool MatchCert(StringPiece cert, StringPiece common_set_hashes,
- uint64* out_hash, uint32* out_index) const override {
+ bool MatchCert(StringPiece cert,
+ StringPiece common_set_hashes,
+ uint64* out_hash,
+ uint32* out_index) const override {
if (common_set_hashes.size() % sizeof(uint64) != 0) {
return false;
}
@@ -140,7 +142,7 @@
private:
CommonCertSetsQUIC() {}
- virtual ~CommonCertSetsQUIC() {}
+ ~CommonCertSetsQUIC() override {}
friend struct DefaultSingletonTraits<CommonCertSetsQUIC>;
DISALLOW_COPY_AND_ASSIGN(CommonCertSetsQUIC);
diff --git a/net/quic/crypto/crypto_framer.cc b/net/quic/crypto/crypto_framer.cc
index 3f61115..029ec53 100644
--- a/net/quic/crypto/crypto_framer.cc
+++ b/net/quic/crypto/crypto_framer.cc
@@ -26,10 +26,9 @@
public:
OneShotVisitor() : error_(false) {}
- virtual void OnError(CryptoFramer* framer) override { error_ = true; }
+ void OnError(CryptoFramer* framer) override { error_ = true; }
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override {
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override {
out_.reset(new CryptoHandshakeMessage(message));
}
diff --git a/net/quic/crypto/crypto_framer_test.cc b/net/quic/crypto/crypto_framer_test.cc
index f9ea55d..ce815a8 100644
--- a/net/quic/crypto/crypto_framer_test.cc
+++ b/net/quic/crypto/crypto_framer_test.cc
@@ -33,13 +33,12 @@
public:
TestCryptoVisitor() : error_count_(0) {}
- virtual void OnError(CryptoFramer* framer) override {
+ void OnError(CryptoFramer* framer) override {
DLOG(ERROR) << "CryptoFramer Error: " << framer->error();
++error_count_;
}
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override {
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override {
messages_.push_back(message);
}
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index 1f3380a..1905109 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -155,8 +155,8 @@
*called_ = false;
}
- virtual void RunImpl(const CryptoHandshakeMessage& client_hello,
- const Result& result) override {
+ void RunImpl(const CryptoHandshakeMessage& client_hello,
+ const Result& result) override {
{
// Ensure that the strike register client lock is not held.
QuicCryptoServerConfigPeer peer(&test_->config_);
diff --git a/net/quic/crypto/curve25519_key_exchange.h b/net/quic/crypto/curve25519_key_exchange.h
index 310c614..cdb6d1a 100644
--- a/net/quic/crypto/curve25519_key_exchange.h
+++ b/net/quic/crypto/curve25519_key_exchange.h
@@ -20,7 +20,7 @@
// Diffie-Hellman on curve25519. See http://cr.yp.to/ecdh.html
class NET_EXPORT_PRIVATE Curve25519KeyExchange : public KeyExchange {
public:
- virtual ~Curve25519KeyExchange();
+ ~Curve25519KeyExchange() override;
// New creates a new object from a private key. If the private key is
// invalid, nullptr is returned.
@@ -31,11 +31,11 @@
static std::string NewPrivateKey(QuicRandom* rand);
// KeyExchange interface.
- virtual KeyExchange* NewKeyPair(QuicRandom* rand) const override;
- virtual bool CalculateSharedKey(const base::StringPiece& peer_public_value,
- std::string* shared_key) const override;
- virtual base::StringPiece public_value() const override;
- virtual QuicTag tag() const override;
+ KeyExchange* NewKeyPair(QuicRandom* rand) const override;
+ bool CalculateSharedKey(const base::StringPiece& peer_public_value,
+ std::string* shared_key) const override;
+ base::StringPiece public_value() const override;
+ QuicTag tag() const override;
private:
Curve25519KeyExchange();
diff --git a/net/quic/crypto/local_strike_register_client.h b/net/quic/crypto/local_strike_register_client.h
index b121299..5f576e9 100644
--- a/net/quic/crypto/local_strike_register_client.h
+++ b/net/quic/crypto/local_strike_register_client.h
@@ -26,10 +26,10 @@
const uint8 orbit[8],
StrikeRegister::StartupType startup);
- virtual bool IsKnownOrbit(base::StringPiece orbit) const override;
- virtual void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
- QuicWallTime now,
- ResultCallback* cb) override;
+ bool IsKnownOrbit(base::StringPiece orbit) const override;
+ void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
+ QuicWallTime now,
+ ResultCallback* cb) override;
private:
mutable base::Lock m_;
diff --git a/net/quic/crypto/local_strike_register_client_test.cc b/net/quic/crypto/local_strike_register_client_test.cc
index 70d2428..a2c3ce2 100644
--- a/net/quic/crypto/local_strike_register_client_test.cc
+++ b/net/quic/crypto/local_strike_register_client_test.cc
@@ -35,8 +35,8 @@
}
protected:
- virtual void RunImpl(bool nonce_is_valid_and_unique,
- InsertStatus nonce_error) override {
+ void RunImpl(bool nonce_is_valid_and_unique,
+ InsertStatus nonce_error) override {
*called_ = true;
*saved_value_ = nonce_is_valid_and_unique;
*saved_nonce_error_ = nonce_error;
diff --git a/net/quic/crypto/null_decrypter.h b/net/quic/crypto/null_decrypter.h
index 03038bd..6f23290 100644
--- a/net/quic/crypto/null_decrypter.h
+++ b/net/quic/crypto/null_decrypter.h
@@ -19,21 +19,21 @@
class NET_EXPORT_PRIVATE NullDecrypter : public QuicDecrypter {
public:
NullDecrypter();
- virtual ~NullDecrypter() {}
+ ~NullDecrypter() override {}
// QuicDecrypter implementation
- virtual bool SetKey(base::StringPiece key) override;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
- virtual bool Decrypt(base::StringPiece nonce,
- base::StringPiece associated_data,
- base::StringPiece ciphertext,
- unsigned char* output,
- size_t* output_length) override;
- virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
- base::StringPiece associated_data,
- base::StringPiece ciphertext) override;
- virtual base::StringPiece GetKey() const override;
- virtual base::StringPiece GetNoncePrefix() const override;
+ bool SetKey(base::StringPiece key) override;
+ bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
+ bool Decrypt(base::StringPiece nonce,
+ base::StringPiece associated_data,
+ base::StringPiece ciphertext,
+ unsigned char* output,
+ size_t* output_length) override;
+ QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
+ base::StringPiece associated_data,
+ base::StringPiece ciphertext) override;
+ base::StringPiece GetKey() const override;
+ base::StringPiece GetNoncePrefix() const override;
private:
bool ReadHash(QuicDataReader* reader, uint128* hash);
diff --git a/net/quic/crypto/null_encrypter.h b/net/quic/crypto/null_encrypter.h
index fbd2dff..b52bd9c 100644
--- a/net/quic/crypto/null_encrypter.h
+++ b/net/quic/crypto/null_encrypter.h
@@ -17,24 +17,24 @@
class NET_EXPORT_PRIVATE NullEncrypter : public QuicEncrypter {
public:
NullEncrypter();
- virtual ~NullEncrypter() {}
+ ~NullEncrypter() override {}
// QuicEncrypter implementation
- virtual bool SetKey(base::StringPiece key) override;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
- virtual bool Encrypt(base::StringPiece nonce,
- base::StringPiece associated_data,
- base::StringPiece plaintext,
- unsigned char* output) override;
- virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
- base::StringPiece associated_data,
- base::StringPiece plaintext) override;
- virtual size_t GetKeySize() const override;
- virtual size_t GetNoncePrefixSize() const override;
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
- virtual size_t GetCiphertextSize(size_t plaintext_size) const override;
- virtual base::StringPiece GetKey() const override;
- virtual base::StringPiece GetNoncePrefix() const override;
+ bool SetKey(base::StringPiece key) override;
+ bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
+ bool Encrypt(base::StringPiece nonce,
+ base::StringPiece associated_data,
+ base::StringPiece plaintext,
+ unsigned char* output) override;
+ QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
+ base::StringPiece associated_data,
+ base::StringPiece plaintext) override;
+ size_t GetKeySize() const override;
+ size_t GetNoncePrefixSize() const override;
+ size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
+ size_t GetCiphertextSize(size_t plaintext_size) const override;
+ base::StringPiece GetKey() const override;
+ base::StringPiece GetNoncePrefix() const override;
private:
size_t GetHashLength() const;
diff --git a/net/quic/crypto/p256_key_exchange.h b/net/quic/crypto/p256_key_exchange.h
index 36ba296..9e22a33 100644
--- a/net/quic/crypto/p256_key_exchange.h
+++ b/net/quic/crypto/p256_key_exchange.h
@@ -26,7 +26,7 @@
// Diffie-Hellman on NIST P-256.
class NET_EXPORT_PRIVATE P256KeyExchange : public KeyExchange {
public:
- virtual ~P256KeyExchange();
+ ~P256KeyExchange() override;
// New creates a new key exchange object from a private key. If
// |private_key| is invalid, nullptr is returned.
@@ -38,11 +38,11 @@
static std::string NewPrivateKey();
// KeyExchange interface.
- virtual KeyExchange* NewKeyPair(QuicRandom* rand) const override;
- virtual bool CalculateSharedKey(const base::StringPiece& peer_public_value,
- std::string* shared_key) const override;
- virtual base::StringPiece public_value() const override;
- virtual QuicTag tag() const override;
+ KeyExchange* NewKeyPair(QuicRandom* rand) const override;
+ bool CalculateSharedKey(const base::StringPiece& peer_public_value,
+ std::string* shared_key) const override;
+ base::StringPiece public_value() const override;
+ QuicTag tag() const override;
private:
enum {
diff --git a/net/quic/crypto/proof_source_chromium.h b/net/quic/crypto/proof_source_chromium.h
index 3d1849e..334466c 100644
--- a/net/quic/crypto/proof_source_chromium.h
+++ b/net/quic/crypto/proof_source_chromium.h
@@ -20,14 +20,14 @@
class NET_EXPORT_PRIVATE ProofSourceChromium : public ProofSource {
public:
ProofSourceChromium();
- virtual ~ProofSourceChromium() {}
+ ~ProofSourceChromium() override {}
// ProofSource interface
- virtual bool GetProof(const std::string& hostname,
- const std::string& server_config,
- bool ecdsa_ok,
- const std::vector<std::string>** out_certs,
- std::string* out_signature) override;
+ bool GetProof(const std::string& hostname,
+ const std::string& server_config,
+ bool ecdsa_ok,
+ const std::vector<std::string>** out_certs,
+ std::string* out_signature) override;
private:
DISALLOW_COPY_AND_ASSIGN(ProofSourceChromium);
diff --git a/net/quic/crypto/proof_test.cc b/net/quic/crypto/proof_test.cc
index 0dde97c..5336e72 100644
--- a/net/quic/crypto/proof_test.cc
+++ b/net/quic/crypto/proof_test.cc
@@ -38,9 +38,9 @@
ok_(ok),
error_details_(error_details) {}
- virtual void Run(bool ok,
- const string& error_details,
- scoped_ptr<ProofVerifyDetails>* details) override {
+ void Run(bool ok,
+ const string& error_details,
+ scoped_ptr<ProofVerifyDetails>* details) override {
*ok_ = ok;
*error_details_ = error_details;
diff --git a/net/quic/crypto/proof_verifier_chromium.h b/net/quic/crypto/proof_verifier_chromium.h
index 057cc16..c51a024 100644
--- a/net/quic/crypto/proof_verifier_chromium.h
+++ b/net/quic/crypto/proof_verifier_chromium.h
@@ -30,7 +30,7 @@
public:
// ProofVerifyDetails implementation
- virtual ProofVerifyDetails* Clone() const override;
+ ProofVerifyDetails* Clone() const override;
CertVerifyResult cert_verify_result;
@@ -56,18 +56,17 @@
public:
ProofVerifierChromium(CertVerifier* cert_verifier,
TransportSecurityState* transport_security_state);
- virtual ~ProofVerifierChromium();
+ ~ProofVerifierChromium() override;
// ProofVerifier interface
- virtual QuicAsyncStatus VerifyProof(
- const std::string& hostname,
- const std::string& server_config,
- const std::vector<std::string>& certs,
- const std::string& signature,
- const ProofVerifyContext* verify_context,
- std::string* error_details,
- scoped_ptr<ProofVerifyDetails>* verify_details,
- ProofVerifierCallback* callback) override;
+ QuicAsyncStatus VerifyProof(const std::string& hostname,
+ const std::string& server_config,
+ const std::vector<std::string>& certs,
+ const std::string& signature,
+ const ProofVerifyContext* verify_context,
+ std::string* error_details,
+ scoped_ptr<ProofVerifyDetails>* verify_details,
+ ProofVerifierCallback* callback) override;
private:
class Job;
diff --git a/net/quic/crypto/quic_crypto_client_config_test.cc b/net/quic/crypto/quic_crypto_client_config_test.cc
index d2c4920..21f4bd3 100644
--- a/net/quic/crypto/quic_crypto_client_config_test.cc
+++ b/net/quic/crypto/quic_crypto_client_config_test.cc
@@ -18,10 +18,10 @@
namespace {
class TestProofVerifyDetails : public ProofVerifyDetails {
- virtual ~TestProofVerifyDetails() {}
+ ~TestProofVerifyDetails() override {}
// ProofVerifyDetails implementation
- virtual ProofVerifyDetails* Clone() const override {
+ ProofVerifyDetails* Clone() const override {
return new TestProofVerifyDetails;
}
};
diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc
index d5a2b75..08cdb7e 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -107,8 +107,8 @@
}
protected:
- virtual void RunImpl(bool nonce_is_valid_and_unique,
- InsertStatus nonce_error) override {
+ void RunImpl(bool nonce_is_valid_and_unique,
+ InsertStatus nonce_error) override {
DVLOG(1) << "Using client nonce, unique: " << nonce_is_valid_and_unique
<< " nonce_error: " << nonce_error;
result_->info.unique = nonce_is_valid_and_unique;
diff --git a/net/quic/crypto/quic_crypto_server_config_test.cc b/net/quic/crypto/quic_crypto_server_config_test.cc
index 59d6cf4..0743a18 100644
--- a/net/quic/crypto/quic_crypto_server_config_test.cc
+++ b/net/quic/crypto/quic_crypto_server_config_test.cc
@@ -207,7 +207,7 @@
is_known_orbit_called_(false) {
}
- virtual bool IsKnownOrbit(StringPiece orbit) const override {
+ bool IsKnownOrbit(StringPiece orbit) const override {
// Ensure that the strike register client lock is not held.
QuicCryptoServerConfigPeer peer(config_);
base::Lock* m = peer.GetStrikeRegisterClientLock();
@@ -220,10 +220,9 @@
return true;
}
- virtual void VerifyNonceIsValidAndUnique(
- StringPiece nonce,
- QuicWallTime now,
- ResultCallback* cb) override {
+ void VerifyNonceIsValidAndUnique(StringPiece nonce,
+ QuicWallTime now,
+ ResultCallback* cb) override {
LOG(FATAL) << "Not implemented";
}
diff --git a/net/quic/crypto/quic_random.cc b/net/quic/crypto/quic_random.cc
index bc85c2d..6b34465 100644
--- a/net/quic/crypto/quic_random.cc
+++ b/net/quic/crypto/quic_random.cc
@@ -17,14 +17,13 @@
static DefaultRandom* GetInstance();
// QuicRandom implementation
- virtual void RandBytes(void* data, size_t len) override;
- virtual uint64 RandUint64() override;
- virtual void Reseed(const void* additional_entropy,
- size_t entropy_len) override;
+ void RandBytes(void* data, size_t len) override;
+ uint64 RandUint64() override;
+ void Reseed(const void* additional_entropy, size_t entropy_len) override;
private:
DefaultRandom() {};
- virtual ~DefaultRandom() {}
+ ~DefaultRandom() override {}
friend struct DefaultSingletonTraits<DefaultRandom>;
DISALLOW_COPY_AND_ASSIGN(DefaultRandom);
diff --git a/net/quic/quic_alarm_test.cc b/net/quic/quic_alarm_test.cc
index 47e23e3..dfd40ed 100644
--- a/net/quic/quic_alarm_test.cc
+++ b/net/quic/quic_alarm_test.cc
@@ -32,12 +32,12 @@
}
protected:
- virtual void SetImpl() override {
+ void SetImpl() override {
DCHECK(deadline().IsInitialized());
scheduled_ = true;
}
- virtual void CancelImpl() override {
+ void CancelImpl() override {
DCHECK(!deadline().IsInitialized());
scheduled_ = false;
}
diff --git a/net/quic/quic_client_session.h b/net/quic/quic_client_session.h
index 430ef52..b1a35d9 100644
--- a/net/quic/quic_client_session.h
+++ b/net/quic/quic_client_session.h
@@ -98,7 +98,7 @@
const QuicConfig& config,
base::TaskRunner* task_runner,
NetLog* net_log);
- virtual ~QuicClientSession();
+ ~QuicClientSession() override;
// Initialize session's connection to |server_id|.
void InitializeSession(
@@ -123,31 +123,28 @@
void CancelRequest(StreamRequest* request);
// QuicSession methods:
- virtual void OnStreamFrames(
- const std::vector<QuicStreamFrame>& frames) override;
- virtual QuicReliableClientStream* CreateOutgoingDataStream() override;
- virtual QuicCryptoClientStream* GetCryptoStream() override;
- virtual void CloseStream(QuicStreamId stream_id) override;
- virtual void SendRstStream(QuicStreamId id,
- QuicRstStreamErrorCode error,
- QuicStreamOffset bytes_written) override;
- virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
- virtual void OnCryptoHandshakeMessageSent(
+ void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override;
+ QuicReliableClientStream* CreateOutgoingDataStream() override;
+ QuicCryptoClientStream* GetCryptoStream() override;
+ void CloseStream(QuicStreamId stream_id) override;
+ void SendRstStream(QuicStreamId id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written) override;
+ void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
+ void OnCryptoHandshakeMessageSent(
const CryptoHandshakeMessage& message) override;
- virtual void OnCryptoHandshakeMessageReceived(
+ void OnCryptoHandshakeMessageReceived(
const CryptoHandshakeMessage& message) override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) const override;
// QuicClientSessionBase methods:
- virtual void OnProofValid(
- const QuicCryptoClientConfig::CachedState& cached) override;
- virtual void OnProofVerifyDetailsAvailable(
+ void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override;
+ void OnProofVerifyDetailsAvailable(
const ProofVerifyDetails& verify_details) override;
// QuicConnectionVisitorInterface methods:
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
- virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) override;
+ void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ void OnSuccessfulVersionNegotiation(const QuicVersion& version) override;
// Performs a crypto handshake with the server.
int CryptoConnect(bool require_confirmation,
@@ -182,7 +179,7 @@
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
+ QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
private:
friend class test::QuicClientSessionPeer;
diff --git a/net/quic/quic_client_session_base.h b/net/quic/quic_client_session_base.h
index ae0644e..d72996c 100644
--- a/net/quic/quic_client_session_base.h
+++ b/net/quic/quic_client_session_base.h
@@ -16,7 +16,7 @@
QuicClientSessionBase(QuicConnection* connection,
const QuicConfig& config);
- virtual ~QuicClientSessionBase();
+ ~QuicClientSessionBase() override;
// Called when the proof in |cached| is marked valid. If this is a secure
// QUIC session, then this will happen only after the proof verifier
@@ -33,7 +33,7 @@
const ProofVerifyDetails& verify_details) = 0;
// Override base class to set FEC policy before any data is sent by client.
- virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
+ void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
private:
DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase);
diff --git a/net/quic/quic_config.h b/net/quic/quic_config.h
index 7be4569..5328ef6 100644
--- a/net/quic/quic_config.h
+++ b/net/quic/quic_config.h
@@ -61,7 +61,7 @@
class NET_EXPORT_PRIVATE QuicNegotiableValue : public QuicConfigValue {
public:
QuicNegotiableValue(QuicTag tag, QuicConfigPresence presence);
- virtual ~QuicNegotiableValue();
+ ~QuicNegotiableValue() override;
bool negotiated() const {
return negotiated_;
@@ -75,7 +75,7 @@
public:
// Default and max values default to 0.
QuicNegotiableUint32(QuicTag name, QuicConfigPresence presence);
- virtual ~QuicNegotiableUint32();
+ ~QuicNegotiableUint32() override;
// Sets the maximum possible value that can be achieved after negotiation and
// also the default values to be assumed if PRESENCE_OPTIONAL and the *HLO msg
@@ -89,16 +89,15 @@
// Serialises |name_| and value to |out|. If |negotiated_| is true then
// |negotiated_value_| is serialised, otherwise |max_value_| is serialised.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
+ void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |negotiated_value_| to the minimum of |max_value_| and the
// corresponding value from |peer_hello|. If the corresponding value is
// missing and PRESENCE_OPTIONAL then |negotiated_value_| is set to
// |default_value_|.
- virtual QuicErrorCode ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- std::string* error_details) override;
+ QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
+ HelloType hello_type,
+ std::string* error_details) override;
private:
uint32 max_value_;
@@ -109,7 +108,7 @@
class NET_EXPORT_PRIVATE QuicNegotiableTag : public QuicNegotiableValue {
public:
QuicNegotiableTag(QuicTag name, QuicConfigPresence presence);
- virtual ~QuicNegotiableTag();
+ ~QuicNegotiableTag() override;
// Sets the possible values that |negotiated_tag_| can take after negotiation
// and the default value that |negotiated_tag_| takes if OPTIONAL and *HLO
@@ -123,15 +122,14 @@
// Serialises |name_| and vector (either possible or negotiated) to |out|. If
// |negotiated_| is true then |negotiated_tag_| is serialised, otherwise
// |possible_values_| is serialised.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
+ void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Selects the tag common to both tags in |client_hello| for |name_| and
// |possible_values_| with preference to tag in |possible_values_|. The
// selected tag is set as |negotiated_tag_|.
- virtual QuicErrorCode ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- std::string* error_details) override;
+ QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
+ HelloType hello_type,
+ std::string* error_details) override;
private:
// Reads the vector corresponding to |name_| from |msg| into |out|. If the
@@ -151,7 +149,7 @@
class NET_EXPORT_PRIVATE QuicFixedUint32 : public QuicConfigValue {
public:
QuicFixedUint32(QuicTag name, QuicConfigPresence presence);
- virtual ~QuicFixedUint32();
+ ~QuicFixedUint32() override;
bool HasSendValue() const;
@@ -166,13 +164,12 @@
void SetReceivedValue(uint32 value);
// If has_send_value is true, serialises |tag_| and |send_value_| to |out|.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
+ void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |value_| to the corresponding value from |peer_hello_| if it exists.
- virtual QuicErrorCode ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- std::string* error_details) override;
+ QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
+ HelloType hello_type,
+ std::string* error_details) override;
private:
uint32 send_value_;
@@ -185,7 +182,7 @@
class NET_EXPORT_PRIVATE QuicFixedTag : public QuicConfigValue {
public:
QuicFixedTag(QuicTag name, QuicConfigPresence presence);
- virtual ~QuicFixedTag();
+ ~QuicFixedTag() override;
bool HasSendValue() const;
@@ -200,13 +197,12 @@
void SetReceivedValue(QuicTag value);
// If has_send_value is true, serialises |tag_| and |send_value_| to |out|.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
+ void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |value_| to the corresponding value from |client_hello_| if it exists.
- virtual QuicErrorCode ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- std::string* error_details) override;
+ QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
+ HelloType hello_type,
+ std::string* error_details) override;
private:
QuicTag send_value_;
@@ -219,7 +215,7 @@
class NET_EXPORT_PRIVATE QuicFixedTagVector : public QuicConfigValue {
public:
QuicFixedTagVector(QuicTag name, QuicConfigPresence presence);
- virtual ~QuicFixedTagVector();
+ ~QuicFixedTagVector() override;
bool HasSendValues() const;
@@ -235,14 +231,13 @@
// If has_send_value is true, serialises |tag_vector_| and |send_value_| to
// |out|.
- virtual void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
+ void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
// Sets |receive_values_| to the corresponding value from |client_hello_| if
// it exists.
- virtual QuicErrorCode ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- std::string* error_details) override;
+ QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
+ HelloType hello_type,
+ std::string* error_details) override;
private:
QuicTagVector send_values_;
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index f684cf2..a0794f3 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -69,7 +69,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
connection_->SendAck();
return QuicTime::Zero();
}
@@ -89,7 +89,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
connection_->OnRetransmissionTimeout();
return QuicTime::Zero();
}
@@ -108,7 +108,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
connection_->WriteIfNotBlocked();
// Never reschedule the alarm, since CanWrite does that.
return QuicTime::Zero();
@@ -126,7 +126,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
connection_->CheckForTimeout();
// Never reschedule the alarm, since CheckForTimeout does that.
return QuicTime::Zero();
@@ -144,7 +144,7 @@
: connection_(connection) {
}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
connection_->SendPing();
return QuicTime::Zero();
}
@@ -196,6 +196,7 @@
connection_id_(connection_id),
peer_address_(address),
migrating_peer_port_(0),
+ last_packet_decrypted_(false),
last_packet_revived_(false),
last_size_(0),
last_decrypted_packet_level_(ENCRYPTION_NONE),
@@ -291,10 +292,16 @@
}
void QuicConnection::OnError(QuicFramer* framer) {
- // Packets that we cannot decrypt are dropped.
+ // Packets that we can not or have not decrypted are dropped.
// TODO(rch): add stats to measure this.
- if (!connected_ || framer->error() == QUIC_DECRYPTION_FAILURE) {
- return;
+ if (FLAGS_quic_drop_junk_packets) {
+ if (!connected_ || last_packet_decrypted_ == false) {
+ return;
+ }
+ } else {
+ if (!connected_ || framer->error() == QUIC_DECRYPTION_FAILURE) {
+ return;
+ }
}
SendConnectionCloseWithDetails(framer->error(), framer->detailed_error());
}
@@ -310,6 +317,8 @@
last_blocked_frames_.empty() &&
last_ping_frames_.empty() &&
last_close_frames_.empty());
+ last_packet_decrypted_ = false;
+ last_packet_revived_ = false;
}
void QuicConnection::OnPublicResetPacket(
@@ -435,6 +444,7 @@
void QuicConnection::OnDecryptedPacket(EncryptionLevel level) {
last_decrypted_packet_level_ = level;
+ last_packet_decrypted_ = true;
}
bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
@@ -1082,7 +1092,7 @@
const QuicConnectionStats& QuicConnection::GetStats() {
// Update rtt and estimated bandwidth.
stats_.min_rtt_us =
- sent_packet_manager_.GetRttStats()->min_rtt().ToMicroseconds();
+ sent_packet_manager_.GetRttStats()->MinRtt().ToMicroseconds();
stats_.srtt_us =
sent_packet_manager_.GetRttStats()->SmoothedRtt().ToMicroseconds();
stats_.estimated_bandwidth =
@@ -1102,7 +1112,6 @@
if (debug_visitor_.get() != nullptr) {
debug_visitor_->OnPacketReceived(self_address, peer_address, packet);
}
- last_packet_revived_ = false;
last_size_ = packet.length();
CheckForAddressMigration(self_address, peer_address);
@@ -1721,7 +1730,7 @@
if (fec_group_num == 0) {
return nullptr;
}
- if (group_map_.count(fec_group_num) == 0) {
+ if (!ContainsKey(group_map_, fec_group_num)) {
if (group_map_.size() >= kMaxFecGroups) { // Too many groups
if (fec_group_num < group_map_.begin()->first) {
// The group being requested is a group we've seen before and deleted.
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index fa117f8..0b5dd00 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -121,7 +121,7 @@
: public QuicPacketGenerator::DebugDelegate,
public QuicSentPacketManager::DebugDelegate {
public:
- virtual ~QuicConnectionDebugVisitor() {}
+ ~QuicConnectionDebugVisitor() override {}
// Called when a packet has been sent.
virtual void OnPacketSent(const SerializedPacket& serialized_packet,
@@ -252,7 +252,7 @@
bool owns_writer,
bool is_server,
const QuicVersionVector& supported_versions);
- virtual ~QuicConnection();
+ ~QuicConnection() override;
// Sets connection parameters from the supplied |config|.
void SetFromConfig(const QuicConfig& config);
@@ -299,7 +299,7 @@
virtual void SendConnectionCloseWithDetails(QuicErrorCode error,
const std::string& details);
// Notifies the visitor of the close and marks the connection as disconnected.
- virtual void CloseConnection(QuicErrorCode error, bool from_peer) override;
+ void CloseConnection(QuicErrorCode error, bool from_peer) override;
virtual void SendGoAway(QuicErrorCode error,
QuicStreamId last_good_stream_id,
const std::string& reason);
@@ -317,7 +317,7 @@
// QuicBlockedWriterInterface
// Called when the underlying connection becomes writable to allow queued
// writes to happen.
- virtual void OnCanWrite() override;
+ void OnCanWrite() override;
// Called when an error occurs while attempting to write a packet to the
// network.
@@ -335,47 +335,44 @@
}
// From QuicFramerVisitorInterface
- virtual void OnError(QuicFramer* framer) override;
- virtual bool OnProtocolVersionMismatch(QuicVersion received_version) override;
- virtual void OnPacket() override;
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) override;
- virtual void OnVersionNegotiationPacket(
+ void OnError(QuicFramer* framer) override;
+ bool OnProtocolVersionMismatch(QuicVersion received_version) override;
+ void OnPacket() override;
+ void OnPublicResetPacket(const QuicPublicResetPacket& packet) override;
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& packet) override;
- virtual void OnRevivedPacket() override;
- virtual bool OnUnauthenticatedPublicHeader(
+ void OnRevivedPacket() override;
+ bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) override;
- virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
- virtual void OnDecryptedPacket(EncryptionLevel level) override;
- virtual bool OnPacketHeader(const QuicPacketHeader& header) override;
- virtual void OnFecProtectedPayload(base::StringPiece payload) override;
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) override;
- virtual bool OnAckFrame(const QuicAckFrame& frame) override;
- virtual bool OnCongestionFeedbackFrame(
+ bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
+ void OnDecryptedPacket(EncryptionLevel level) override;
+ bool OnPacketHeader(const QuicPacketHeader& header) override;
+ void OnFecProtectedPayload(base::StringPiece payload) override;
+ bool OnStreamFrame(const QuicStreamFrame& frame) override;
+ bool OnAckFrame(const QuicAckFrame& frame) override;
+ bool OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& frame) override;
- virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
- virtual bool OnPingFrame(const QuicPingFrame& frame) override;
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
- virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) override;
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override;
- virtual void OnFecData(const QuicFecData& fec) override;
- virtual void OnPacketComplete() override;
+ bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
+ bool OnPingFrame(const QuicPingFrame& frame) override;
+ bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
+ bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override;
+ bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
+ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
+ bool OnBlockedFrame(const QuicBlockedFrame& frame) override;
+ void OnFecData(const QuicFecData& fec) override;
+ void OnPacketComplete() override;
// QuicPacketGenerator::DelegateInterface
- virtual bool ShouldGeneratePacket(TransmissionType transmission_type,
- HasRetransmittableData retransmittable,
- IsHandshake handshake) override;
- virtual QuicAckFrame* CreateAckFrame() override;
- virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() override;
- virtual QuicStopWaitingFrame* CreateStopWaitingFrame() override;
- virtual void OnSerializedPacket(const SerializedPacket& packet) override;
+ bool ShouldGeneratePacket(TransmissionType transmission_type,
+ HasRetransmittableData retransmittable,
+ IsHandshake handshake) override;
+ QuicAckFrame* CreateAckFrame() override;
+ QuicCongestionFeedbackFrame* CreateFeedbackFrame() override;
+ QuicStopWaitingFrame* CreateStopWaitingFrame() override;
+ void OnSerializedPacket(const SerializedPacket& packet) override;
// QuicSentPacketManager::NetworkChangeVisitor
- virtual void OnCongestionWindowChange(
- QuicByteCount congestion_window) override;
+ void OnCongestionWindowChange(QuicByteCount congestion_window) override;
// Called by the crypto stream when the handshake completes. In the server's
// case this is when the SHLO has been ACKed. Clients call this on receipt of
@@ -683,6 +680,9 @@
// Used to store latest peer port to possibly migrate to later.
int migrating_peer_port_;
+ // True if the last packet has gotten far enough in the framer to be
+ // decrypted.
+ bool last_packet_decrypted_;
bool last_packet_revived_; // True if the last packet was revived from FEC.
size_t last_size_; // Size of the last received packet.
EncryptionLevel last_decrypted_packet_level_;
diff --git a/net/quic/quic_connection_helper.cc b/net/quic/quic_connection_helper.cc
index 83c1648..195dfb3 100644
--- a/net/quic/quic_connection_helper.cc
+++ b/net/quic/quic_connection_helper.cc
@@ -29,7 +29,7 @@
weak_factory_(this) {}
protected:
- virtual void SetImpl() override {
+ void SetImpl() override {
DCHECK(deadline().IsInitialized());
if (task_deadline_.IsInitialized()) {
if (task_deadline_ <= deadline()) {
@@ -54,7 +54,7 @@
task_deadline_ = deadline();
}
- virtual void CancelImpl() override {
+ void CancelImpl() override {
DCHECK(!deadline().IsInitialized());
// Since tasks can not be un-posted, OnAlarm will be invoked which
// will notice that deadline is not Initialized and will do nothing.
diff --git a/net/quic/quic_connection_helper.h b/net/quic/quic_connection_helper.h
index e1754e5..140bf9a 100644
--- a/net/quic/quic_connection_helper.h
+++ b/net/quic/quic_connection_helper.h
@@ -34,12 +34,12 @@
QuicConnectionHelper(base::TaskRunner* task_runner,
const QuicClock* clock,
QuicRandom* random_generator);
- virtual ~QuicConnectionHelper();
+ ~QuicConnectionHelper() override;
// QuicConnectionHelperInterface
- virtual const QuicClock* GetClock() const override;
- virtual QuicRandom* GetRandomGenerator() override;
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
+ const QuicClock* GetClock() const override;
+ QuicRandom* GetRandomGenerator() override;
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
private:
base::TaskRunner* task_runner_;
diff --git a/net/quic/quic_connection_helper_test.cc b/net/quic/quic_connection_helper_test.cc
index 8a2c931..f5a6907 100644
--- a/net/quic/quic_connection_helper_test.cc
+++ b/net/quic/quic_connection_helper_test.cc
@@ -17,7 +17,7 @@
public:
TestDelegate() : fired_(false) {}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
fired_ = true;
return QuicTime::Zero();
}
diff --git a/net/quic/quic_connection_logger.h b/net/quic/quic_connection_logger.h
index c714e3b..1d38049 100644
--- a/net/quic/quic_connection_logger.h
+++ b/net/quic/quic_connection_logger.h
@@ -29,49 +29,44 @@
public:
QuicConnectionLogger(QuicSession* session, const BoundNetLog& net_log);
- virtual ~QuicConnectionLogger();
+ ~QuicConnectionLogger() override;
// QuicPacketGenerator::DebugDelegateInterface
- virtual void OnFrameAddedToPacket(const QuicFrame& frame) override;
+ void OnFrameAddedToPacket(const QuicFrame& frame) override;
// QuicConnectionDebugVisitorInterface
- virtual void OnPacketSent(const SerializedPacket& serialized_packet,
- QuicPacketSequenceNumber original_sequence_number,
- EncryptionLevel level,
- TransmissionType transmission_type,
- const QuicEncryptedPacket& packet,
- QuicTime sent_time) override;
- virtual void OnPacketReceived(const IPEndPoint& self_address,
- const IPEndPoint& peer_address,
- const QuicEncryptedPacket& packet) override;
- virtual void OnIncorrectConnectionId(
- QuicConnectionId connection_id) override;
- virtual void OnUndecryptablePacket() override;
- virtual void OnDuplicatePacket(QuicPacketSequenceNumber sequence_number)
- override;
- virtual void OnProtocolVersionMismatch(QuicVersion version) override;
- virtual void OnPacketHeader(const QuicPacketHeader& header) override;
- virtual void OnStreamFrame(const QuicStreamFrame& frame) override;
- virtual void OnAckFrame(const QuicAckFrame& frame) override;
- virtual void OnCongestionFeedbackFrame(
+ void OnPacketSent(const SerializedPacket& serialized_packet,
+ QuicPacketSequenceNumber original_sequence_number,
+ EncryptionLevel level,
+ TransmissionType transmission_type,
+ const QuicEncryptedPacket& packet,
+ QuicTime sent_time) override;
+ void OnPacketReceived(const IPEndPoint& self_address,
+ const IPEndPoint& peer_address,
+ const QuicEncryptedPacket& packet) override;
+ void OnIncorrectConnectionId(QuicConnectionId connection_id) override;
+ void OnUndecryptablePacket() override;
+ void OnDuplicatePacket(QuicPacketSequenceNumber sequence_number) override;
+ void OnProtocolVersionMismatch(QuicVersion version) override;
+ void OnPacketHeader(const QuicPacketHeader& header) override;
+ void OnStreamFrame(const QuicStreamFrame& frame) override;
+ void OnAckFrame(const QuicAckFrame& frame) override;
+ void OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& frame) override;
- virtual void OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
- virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
- virtual void OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) override;
- virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
- virtual void OnBlockedFrame(const QuicBlockedFrame& frame) override;
- virtual void OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
- virtual void OnPingFrame(const QuicPingFrame& frame) override;
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) override;
- virtual void OnVersionNegotiationPacket(
+ void OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
+ void OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
+ void OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override;
+ void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
+ void OnBlockedFrame(const QuicBlockedFrame& frame) override;
+ void OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
+ void OnPingFrame(const QuicPingFrame& frame) override;
+ void OnPublicResetPacket(const QuicPublicResetPacket& packet) override;
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& packet) override;
- virtual void OnRevivedPacket(const QuicPacketHeader& revived_header,
- base::StringPiece payload) override;
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
- virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) override;
+ void OnRevivedPacket(const QuicPacketHeader& revived_header,
+ base::StringPiece payload) override;
+ void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ void OnSuccessfulVersionNegotiation(const QuicVersion& version) override;
void OnCryptoHandshakeMessageReceived(
const CryptoHandshakeMessage& message);
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index b084428..1c47f32 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -90,51 +90,45 @@
: tag_(tag) {
}
- virtual ~TaggingEncrypter() {}
+ ~TaggingEncrypter() override {}
// QuicEncrypter interface.
- virtual bool SetKey(StringPiece key) override { return true; }
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
- return true;
- }
+ bool SetKey(StringPiece key) override { return true; }
+ bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; }
- virtual bool Encrypt(StringPiece nonce,
- StringPiece associated_data,
- StringPiece plaintext,
- unsigned char* output) override {
+ bool Encrypt(StringPiece nonce,
+ StringPiece associated_data,
+ StringPiece plaintext,
+ unsigned char* output) override {
memcpy(output, plaintext.data(), plaintext.size());
output += plaintext.size();
memset(output, tag_, kTagSize);
return true;
}
- virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
- StringPiece associated_data,
- StringPiece plaintext) override {
+ QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
+ StringPiece associated_data,
+ StringPiece plaintext) override {
const size_t len = plaintext.size() + kTagSize;
uint8* buffer = new uint8[len];
Encrypt(StringPiece(), associated_data, plaintext, buffer);
return new QuicData(reinterpret_cast<char*>(buffer), len, true);
}
- virtual size_t GetKeySize() const override { return 0; }
- virtual size_t GetNoncePrefixSize() const override { return 0; }
+ size_t GetKeySize() const override { return 0; }
+ size_t GetNoncePrefixSize() const override { return 0; }
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override {
+ size_t GetMaxPlaintextSize(size_t ciphertext_size) const override {
return ciphertext_size - kTagSize;
}
- virtual size_t GetCiphertextSize(size_t plaintext_size) const override {
+ size_t GetCiphertextSize(size_t plaintext_size) const override {
return plaintext_size + kTagSize;
}
- virtual StringPiece GetKey() const override {
- return StringPiece();
- }
+ StringPiece GetKey() const override { return StringPiece(); }
- virtual StringPiece GetNoncePrefix() const override {
- return StringPiece();
- }
+ StringPiece GetNoncePrefix() const override { return StringPiece(); }
private:
enum {
@@ -150,19 +144,17 @@
// have the same value and then removes them.
class TaggingDecrypter : public QuicDecrypter {
public:
- virtual ~TaggingDecrypter() {}
+ ~TaggingDecrypter() override {}
// QuicDecrypter interface
- virtual bool SetKey(StringPiece key) override { return true; }
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
- return true;
- }
+ bool SetKey(StringPiece key) override { return true; }
+ bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; }
- virtual bool Decrypt(StringPiece nonce,
- StringPiece associated_data,
- StringPiece ciphertext,
- unsigned char* output,
- size_t* output_length) override {
+ bool Decrypt(StringPiece nonce,
+ StringPiece associated_data,
+ StringPiece ciphertext,
+ unsigned char* output,
+ size_t* output_length) override {
if (ciphertext.size() < kTagSize) {
return false;
}
@@ -174,9 +166,9 @@
return true;
}
- virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
- StringPiece associated_data,
- StringPiece ciphertext) override {
+ QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
+ StringPiece associated_data,
+ StringPiece ciphertext) override {
if (ciphertext.size() < kTagSize) {
return nullptr;
}
@@ -190,8 +182,8 @@
true /* owns buffer */);
}
- virtual StringPiece GetKey() const override { return StringPiece(); }
- virtual StringPiece GetNoncePrefix() const override { return StringPiece(); }
+ StringPiece GetKey() const override { return StringPiece(); }
+ StringPiece GetNoncePrefix() const override { return StringPiece(); }
protected:
virtual uint8 GetTag(StringPiece ciphertext) {
@@ -219,12 +211,10 @@
class StrictTaggingDecrypter : public TaggingDecrypter {
public:
explicit StrictTaggingDecrypter(uint8 tag) : tag_(tag) {}
- virtual ~StrictTaggingDecrypter() {}
+ ~StrictTaggingDecrypter() override {}
// TaggingQuicDecrypter
- virtual uint8 GetTag(StringPiece ciphertext) override {
- return tag_;
- }
+ uint8 GetTag(StringPiece ciphertext) override { return tag_; }
private:
const uint8 tag_;
@@ -238,8 +228,8 @@
: QuicAlarm(delegate) {
}
- virtual void SetImpl() override {}
- virtual void CancelImpl() override {}
+ void SetImpl() override {}
+ void CancelImpl() override {}
using QuicAlarm::Fire;
};
@@ -250,15 +240,11 @@
}
// QuicConnectionHelperInterface
- virtual const QuicClock* GetClock() const override {
- return clock_;
- }
+ const QuicClock* GetClock() const override { return clock_; }
- virtual QuicRandom* GetRandomGenerator() override {
- return random_generator_;
- }
+ QuicRandom* GetRandomGenerator() override { return random_generator_; }
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override {
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override {
return new TestAlarm(delegate);
}
@@ -285,10 +271,10 @@
}
// QuicPacketWriter interface
- virtual WriteResult WritePacket(
- const char* buffer, size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override {
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override {
QuicEncryptedPacket packet(buffer, buf_len);
++packets_write_attempts_;
@@ -313,13 +299,13 @@
return WriteResult(WRITE_STATUS_OK, last_packet_size_);
}
- virtual bool IsWriteBlockedDataBuffered() const override {
+ bool IsWriteBlockedDataBuffered() const override {
return is_write_blocked_data_buffered_;
}
- virtual bool IsWriteBlocked() const override { return write_blocked_; }
+ bool IsWriteBlocked() const override { return write_blocked_; }
- virtual void SetWritable() override { write_blocked_ = false; }
+ void SetWritable() override { write_blocked_ = false; }
void BlockOnNextWrite() { block_on_next_write_ = true; }
@@ -590,8 +576,8 @@
class FecQuicConnectionDebugVisitor
: public QuicConnectionDebugVisitor {
public:
- virtual void OnRevivedPacket(const QuicPacketHeader& header,
- StringPiece data) override {
+ void OnRevivedPacket(const QuicPacketHeader& header,
+ StringPiece data) override {
revived_header_ = header;
}
@@ -2813,13 +2799,7 @@
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(15));
connection_.GetPingAlarm()->Fire();
EXPECT_EQ(1u, writer_->frame_count());
- if (version() >= QUIC_VERSION_18) {
- ASSERT_EQ(1u, writer_->ping_frames().size());
- } else {
- ASSERT_EQ(1u, writer_->stream_frames().size());
- EXPECT_EQ(kCryptoStreamId, writer_->stream_frames()[0].stream_id);
- EXPECT_EQ(0u, writer_->stream_frames()[0].offset);
- }
+ ASSERT_EQ(1u, writer_->ping_frames().size());
writer_->Reset();
EXPECT_CALL(visitor_, HasOpenDataStreams()).WillRepeatedly(Return(false));
@@ -3021,16 +3001,6 @@
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
}
-TEST_P(QuicConnectionTest, SendDelayedAckForPing) {
- if (version() < QUIC_VERSION_18) {
- return;
- }
- EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
- ProcessPingPacket(1);
- EXPECT_TRUE(connection_.GetAckAlarm()->IsSet());
-}
-
TEST_P(QuicConnectionTest, NoAckOnOldNacks) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
// Drop one packet, triggering a sequence of acks.
@@ -3229,15 +3199,11 @@
ProcessFramePacket(QuicFrame(&blocked));
}
-TEST_P(QuicConnectionTest, InvalidPacket) {
- EXPECT_CALL(visitor_,
- OnConnectionClosed(QUIC_INVALID_PACKET_HEADER, false));
+TEST_P(QuicConnectionTest, ZeroBytePacket) {
+ // Don't close the connection for zero byte packets.
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _)).Times(0);
QuicEncryptedPacket encrypted(nullptr, 0);
connection_.ProcessUdpPacket(IPEndPoint(), IPEndPoint(), encrypted);
- // The connection close packet should have error details.
- ASSERT_FALSE(writer_->connection_close_frames().empty());
- EXPECT_EQ("Unable to read public flags.",
- writer_->connection_close_frames()[0].error_details);
}
TEST_P(QuicConnectionTest, MissingPacketsBeforeLeastUnacked) {
diff --git a/net/quic/quic_crypto_client_stream.h b/net/quic/quic_crypto_client_stream.h
index 801c3da..f2a4244 100644
--- a/net/quic/quic_crypto_client_stream.h
+++ b/net/quic/quic_crypto_client_stream.h
@@ -29,11 +29,10 @@
QuicClientSessionBase* session,
ProofVerifyContext* verify_context,
QuicCryptoClientConfig* crypto_config);
- virtual ~QuicCryptoClientStream();
+ ~QuicCryptoClientStream() override;
// CryptoFramerVisitorInterface implementation
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override;
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
// Performs a crypto handshake with the server. Returns true if the crypto
// handshake is started successfully.
@@ -59,10 +58,10 @@
class ChannelIDSourceCallbackImpl : public ChannelIDSourceCallback {
public:
explicit ChannelIDSourceCallbackImpl(QuicCryptoClientStream* stream);
- virtual ~ChannelIDSourceCallbackImpl();
+ ~ChannelIDSourceCallbackImpl() override;
// ChannelIDSourceCallback interface.
- virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) override;
+ void Run(scoped_ptr<ChannelIDKey>* channel_id_key) override;
// Cancel causes any future callbacks to be ignored. It must be called on
// the same thread as the callback will be made on.
@@ -78,12 +77,12 @@
class ProofVerifierCallbackImpl : public ProofVerifierCallback {
public:
explicit ProofVerifierCallbackImpl(QuicCryptoClientStream* stream);
- virtual ~ProofVerifierCallbackImpl();
+ ~ProofVerifierCallbackImpl() override;
// ProofVerifierCallback interface.
- virtual void Run(bool ok,
- const string& error_details,
- scoped_ptr<ProofVerifyDetails>* details) override;
+ void Run(bool ok,
+ const string& error_details,
+ scoped_ptr<ProofVerifyDetails>* details) override;
// Cancel causes any future callbacks to be ignored. It must be called on
// the same thread as the callback will be made on.
diff --git a/net/quic/quic_crypto_server_stream.cc b/net/quic/quic_crypto_server_stream.cc
index e912c32..1c110da 100644
--- a/net/quic/quic_crypto_server_stream.cc
+++ b/net/quic/quic_crypto_server_stream.cc
@@ -189,6 +189,12 @@
session()->connection()->OnHandshakeComplete();
}
+void QuicCryptoServerStream::set_previous_cached_network_params(
+ CachedNetworkParameters cached_network_params) {
+ previous_cached_network_params_.reset(
+ new CachedNetworkParameters(cached_network_params));
+}
+
bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID(
string* output) const {
if (!encryption_established_ ||
@@ -245,6 +251,11 @@
void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {
}
+CachedNetworkParameters*
+QuicCryptoServerStream::get_previous_cached_network_params() {
+ return previous_cached_network_params_.get();
+}
+
QuicCryptoServerStream::ValidateCallback::ValidateCallback(
QuicCryptoServerStream* parent) : parent_(parent) {
}
diff --git a/net/quic/quic_crypto_server_stream.h b/net/quic/quic_crypto_server_stream.h
index 5d55564..692a713 100644
--- a/net/quic/quic_crypto_server_stream.h
+++ b/net/quic/quic_crypto_server_stream.h
@@ -33,15 +33,14 @@
: server_stream_(stream) {}
// QuicAckNotifier::DelegateInterface implementation
- virtual void OnAckNotification(
- int num_original_packets,
- int num_original_bytes,
- int num_retransmitted_packets,
- int num_retransmitted_bytes,
- QuicTime::Delta delta_largest_observed) override;
+ void OnAckNotification(int num_original_packets,
+ int num_original_bytes,
+ int num_retransmitted_packets,
+ int num_retransmitted_bytes,
+ QuicTime::Delta delta_largest_observed) override;
private:
- virtual ~ServerHelloNotifier() {}
+ ~ServerHelloNotifier() override {}
QuicCryptoServerStream* server_stream_;
@@ -52,15 +51,14 @@
public:
QuicCryptoServerStream(const QuicCryptoServerConfig& crypto_config,
QuicSession* session);
- virtual ~QuicCryptoServerStream();
+ ~QuicCryptoServerStream() override;
// Cancel any outstanding callbacks, such as asynchronous validation of client
// hello.
void CancelOutstandingCallbacks();
// CryptoFramerVisitorInterface implementation
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override;
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
// GetBase64SHA256ClientChannelID sets |*output| to the base64 encoded,
// SHA-256 hash of the client's ChannelID key and returns true, if the client
@@ -84,6 +82,9 @@
// client.
void OnServerHelloAcked();
+ void set_previous_cached_network_params(
+ CachedNetworkParameters cached_network_params);
+
protected:
virtual QuicErrorCode ProcessClientHello(
const CryptoHandshakeMessage& message,
@@ -95,6 +96,8 @@
// before going through the parameter negotiation step.
virtual void OverrideQuicConfigDefaults(QuicConfig* config);
+ CachedNetworkParameters* get_previous_cached_network_params();
+
private:
friend class test::CryptoTestUtils;
@@ -105,8 +108,8 @@
void Cancel();
// From ValidateClientHelloResultCallback
- virtual void RunImpl(const CryptoHandshakeMessage& client_hello,
- const Result& result) override;
+ void RunImpl(const CryptoHandshakeMessage& client_hello,
+ const Result& result) override;
private:
QuicCryptoServerStream* parent_;
diff --git a/net/quic/quic_crypto_stream.h b/net/quic/quic_crypto_stream.h
index 6698e3e..37a2a91 100644
--- a/net/quic/quic_crypto_stream.h
+++ b/net/quic/quic_crypto_stream.h
@@ -34,13 +34,12 @@
explicit QuicCryptoStream(QuicSession* session);
// CryptoFramerVisitorInterface implementation
- virtual void OnError(CryptoFramer* framer) override;
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override;
+ void OnError(CryptoFramer* framer) override;
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
// ReliableQuicStream implementation
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) override;
- virtual QuicPriority EffectivePriority() const override;
+ uint32 ProcessRawData(const char* data, uint32 data_len) override;
+ QuicPriority EffectivePriority() const override;
// Sends |message| to the peer.
// TODO(wtc): return a success/failure status.
diff --git a/net/quic/quic_crypto_stream_test.cc b/net/quic/quic_crypto_stream_test.cc
index e79a1f3..a491235 100644
--- a/net/quic/quic_crypto_stream_test.cc
+++ b/net/quic/quic_crypto_stream_test.cc
@@ -29,8 +29,7 @@
: QuicCryptoStream(session) {
}
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override {
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override {
messages_.push_back(message);
}
diff --git a/net/quic/quic_data_stream.h b/net/quic/quic_data_stream.h
index 7cb9816..0337b30 100644
--- a/net/quic/quic_data_stream.h
+++ b/net/quic/quic_data_stream.h
@@ -54,16 +54,16 @@
QuicDataStream(QuicStreamId id, QuicSession* session);
- virtual ~QuicDataStream();
+ ~QuicDataStream() override;
// ReliableQuicStream implementation
- virtual void OnClose() override;
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) override;
+ void OnClose() override;
+ uint32 ProcessRawData(const char* data, uint32 data_len) override;
// By default, this is the same as priority(), however it allows streams
// to temporarily alter effective priority. For example if a SPDY stream has
// compressed but not written headers it can write the headers with a higher
// priority.
- virtual QuicPriority EffectivePriority() const override;
+ QuicPriority EffectivePriority() const override;
// Overridden by subclasses to process data. The headers will be delivered
// via OnStreamHeaders, so only data will be delivered through this method.
diff --git a/net/quic/quic_data_stream_test.cc b/net/quic/quic_data_stream_test.cc
index 2f6d84e..16e6341 100644
--- a/net/quic/quic_data_stream_test.cc
+++ b/net/quic/quic_data_stream_test.cc
@@ -40,7 +40,7 @@
: QuicDataStream(id, session),
should_process_data_(should_process_data) {}
- virtual uint32 ProcessData(const char* data, uint32 data_len) override {
+ uint32 ProcessData(const char* data, uint32 data_len) override {
EXPECT_NE(0u, data_len);
DVLOG(1) << "ProcessData data_len: " << data_len;
data_ += string(data, data_len);
@@ -403,9 +403,6 @@
// Tests that on receipt of data, the connection updates its receive window
// offset appropriately, and sends WINDOW_UPDATE frames when its receive
// window drops too low.
- if (GetParam() < QUIC_VERSION_19) {
- return;
- }
Initialize(kShouldProcessData);
// Set a small flow control limit for streams and connection.
@@ -484,9 +481,6 @@
// Tests that on if the peer sends too much data (i.e. violates the flow
// control protocol), at the connection level (rather than the stream level)
// then we terminate the connection.
- if (GetParam() < QUIC_VERSION_19) {
- return;
- }
// Stream should not process data, so that data gets buffered in the
// sequencer, triggering flow control limits.
diff --git a/net/quic/quic_default_packet_writer.h b/net/quic/quic_default_packet_writer.h
index 329f7cc..e282d88 100644
--- a/net/quic/quic_default_packet_writer.h
+++ b/net/quic/quic_default_packet_writer.h
@@ -23,16 +23,16 @@
public:
QuicDefaultPacketWriter();
explicit QuicDefaultPacketWriter(DatagramClientSocket* socket);
- virtual ~QuicDefaultPacketWriter();
+ ~QuicDefaultPacketWriter() override;
// QuicPacketWriter
- virtual WriteResult WritePacket(const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlockedDataBuffered() const override;
- virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+ bool IsWriteBlockedDataBuffered() const override;
+ bool IsWriteBlocked() const override;
+ void SetWritable() override;
void OnWriteComplete(int rv);
void SetConnection(QuicConnection* connection) {
diff --git a/net/quic/quic_dispatcher.cc b/net/quic/quic_dispatcher.cc
index 121e32f..cbdd540 100644
--- a/net/quic/quic_dispatcher.cc
+++ b/net/quic/quic_dispatcher.cc
@@ -28,7 +28,7 @@
: dispatcher_(dispatcher) {
}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
dispatcher_->DeleteSessions();
return QuicTime::Zero();
}
@@ -44,23 +44,21 @@
connection_id_(0) {}
// QuicFramerVisitorInterface implementation
- virtual void OnPacket() override {}
- virtual bool OnUnauthenticatedPublicHeader(
+ void OnPacket() override {}
+ bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) override {
connection_id_ = header.connection_id;
return dispatcher_->OnUnauthenticatedPublicHeader(header);
}
- virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) override {
+ bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override {
dispatcher_->OnUnauthenticatedHeader(header);
return false;
}
- virtual void OnError(QuicFramer* framer) override {
+ void OnError(QuicFramer* framer) override {
DVLOG(1) << QuicUtils::ErrorToString(framer->error());
}
- virtual bool OnProtocolVersionMismatch(
- QuicVersion /*received_version*/) override {
+ bool OnProtocolVersionMismatch(QuicVersion /*received_version*/) override {
if (dispatcher_->time_wait_list_manager()->IsConnectionIdInTimeWait(
connection_id_)) {
// Keep processing after protocol mismatch - this will be dealt with by
@@ -76,77 +74,66 @@
// The following methods should never get called because we always return
// false from OnUnauthenticatedHeader(). As a result, we never process the
// payload of the packet.
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& /*packet*/) override {
+ void OnPublicResetPacket(const QuicPublicResetPacket& /*packet*/) override {
DCHECK(false);
}
- virtual void OnVersionNegotiationPacket(
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& /*packet*/) override {
DCHECK(false);
}
- virtual void OnDecryptedPacket(EncryptionLevel level) override {
- DCHECK(false);
- }
- virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
+ void OnDecryptedPacket(EncryptionLevel level) override { DCHECK(false); }
+ bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
DCHECK(false);
return false;
}
- virtual void OnRevivedPacket() override {
+ void OnRevivedPacket() override { DCHECK(false); }
+ void OnFecProtectedPayload(StringPiece /*payload*/) override {
DCHECK(false);
}
- virtual void OnFecProtectedPayload(StringPiece /*payload*/) override {
- DCHECK(false);
- }
- virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
+ bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
+ bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnCongestionFeedbackFrame(
+ bool OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnStopWaitingFrame(
- const QuicStopWaitingFrame& /*frame*/) override {
+ bool OnStopWaitingFrame(const QuicStopWaitingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
+ bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
+ bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame & /*frame*/) override {
+ bool OnConnectionCloseFrame(
+ const QuicConnectionCloseFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
+ bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/)
- override {
+ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/) override {
DCHECK(false);
return false;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
+ bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
DCHECK(false);
return false;
}
- virtual void OnFecData(const QuicFecData& /*fec*/) override {
- DCHECK(false);
- }
- virtual void OnPacketComplete() override {
- DCHECK(false);
- }
+ void OnFecData(const QuicFecData& /*fec*/) override { DCHECK(false); }
+ void OnPacketComplete() override { DCHECK(false); }
private:
QuicDispatcher* dispatcher_;
diff --git a/net/quic/quic_dispatcher.h b/net/quic/quic_dispatcher.h
index b4be0ee..640cec8 100644
--- a/net/quic/quic_dispatcher.h
+++ b/net/quic/quic_dispatcher.h
@@ -60,11 +60,10 @@
// Creates ordinary QuicPerConnectionPacketWriter instances.
class DefaultPacketWriterFactory : public PacketWriterFactory {
public:
- virtual ~DefaultPacketWriterFactory() {}
+ ~DefaultPacketWriterFactory() override {}
- virtual QuicPacketWriter* Create(
- QuicServerPacketWriter* writer,
- QuicConnection* connection) override;
+ QuicPacketWriter* Create(QuicServerPacketWriter* writer,
+ QuicConnection* connection) override;
};
// Ideally we'd have a linked_hash_set: the boolean is unused.
@@ -80,16 +79,16 @@
PacketWriterFactory* packet_writer_factory,
QuicConnectionHelperInterface* helper);
- virtual ~QuicDispatcher();
+ ~QuicDispatcher() override;
// Takes ownership of the packet writer.
virtual void Initialize(QuicServerPacketWriter* writer);
// Process the incoming packet by creating a new session, passing it to
// an existing session, or passing it to the TimeWaitListManager.
- virtual void ProcessPacket(const IPEndPoint& server_address,
- const IPEndPoint& client_address,
- const QuicEncryptedPacket& packet) override;
+ void ProcessPacket(const IPEndPoint& server_address,
+ const IPEndPoint& client_address,
+ const QuicEncryptedPacket& packet) override;
// Returns true if there's anything in the blocked writer list.
virtual bool HasPendingWrites() const;
@@ -99,16 +98,15 @@
// QuicBlockedWriterInterface implementation:
// Called when the socket becomes writable to allow queued writes to happen.
- virtual void OnCanWrite() override;
+ void OnCanWrite() override;
// QuicServerSessionVisitor interface implementation:
// Ensure that the closed connection is cleaned up asynchronously.
- virtual void OnConnectionClosed(QuicConnectionId connection_id,
- QuicErrorCode error) override;
+ void OnConnectionClosed(QuicConnectionId connection_id,
+ QuicErrorCode error) override;
// Queues the blocked writer for later resumption.
- virtual void OnWriteBlocked(
- QuicBlockedWriterInterface* blocked_writer) override;
+ void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) override;
typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap;
@@ -183,9 +181,9 @@
public QuicConnection::PacketWriterFactory {
public:
PacketWriterFactoryAdapter(QuicDispatcher* dispatcher);
- virtual ~PacketWriterFactoryAdapter ();
+ ~PacketWriterFactoryAdapter() override;
- virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
+ QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
QuicDispatcher* dispatcher_;
diff --git a/net/quic/quic_fec_group.cc b/net/quic/quic_fec_group.cc
index 344f216..5d55aed 100644
--- a/net/quic/quic_fec_group.cc
+++ b/net/quic/quic_fec_group.cc
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/stl_util.h"
using base::StringPiece;
using std::numeric_limits;
@@ -31,7 +32,7 @@
bool QuicFecGroup::Update(EncryptionLevel encryption_level,
const QuicPacketHeader& header,
StringPiece decrypted_payload) {
- if (received_packets_.count(header.packet_sequence_number) != 0) {
+ if (ContainsKey(received_packets_, header.packet_sequence_number)) {
return false;
}
if (min_protected_packet_ != kNoSequenceNumber &&
diff --git a/net/quic/quic_flags.cc b/net/quic/quic_flags.cc
index 9a49a34..28ae889 100644
--- a/net/quic/quic_flags.cc
+++ b/net/quic/quic_flags.cc
@@ -50,3 +50,7 @@
// If true, store any CachedNetworkParams that are provided in the STK from the
// CHLO.
bool FLAGS_quic_store_cached_network_params_from_chlo = false;
+
+// If true, QUIC will be more resilliant to junk packets with valid connection
+// IDs.
+bool FLAGS_quic_drop_junk_packets = true;
diff --git a/net/quic/quic_flags.h b/net/quic/quic_flags.h
index 7693260..fcda2cb 100644
--- a/net/quic/quic_flags.h
+++ b/net/quic/quic_flags.h
@@ -19,5 +19,6 @@
NET_EXPORT_PRIVATE extern bool FLAGS_quic_timeouts_only_from_alarms;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_unified_timeouts;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_store_cached_network_params_from_chlo;
+NET_EXPORT_PRIVATE extern bool FLAGS_quic_drop_junk_packets;
#endif // NET_QUIC_QUIC_FLAGS_H_
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 9ba0fd6..b2dc6eb 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -103,46 +103,34 @@
class TestEncrypter : public QuicEncrypter {
public:
- virtual ~TestEncrypter() {}
- virtual bool SetKey(StringPiece key) override {
- return true;
- }
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
- return true;
- }
- virtual bool Encrypt(StringPiece nonce,
- StringPiece associated_data,
- StringPiece plaintext,
- unsigned char* output) override {
+ ~TestEncrypter() override {}
+ bool SetKey(StringPiece key) override { return true; }
+ bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; }
+ bool Encrypt(StringPiece nonce,
+ StringPiece associated_data,
+ StringPiece plaintext,
+ unsigned char* output) override {
CHECK(false) << "Not implemented";
return false;
}
- virtual QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
- StringPiece associated_data,
- StringPiece plaintext) override {
+ QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
+ StringPiece associated_data,
+ StringPiece plaintext) override {
sequence_number_ = sequence_number;
associated_data_ = associated_data.as_string();
plaintext_ = plaintext.as_string();
return new QuicData(plaintext.data(), plaintext.length());
}
- virtual size_t GetKeySize() const override {
- return 0;
- }
- virtual size_t GetNoncePrefixSize() const override {
- return 0;
- }
- virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) const override {
+ size_t GetKeySize() const override { return 0; }
+ size_t GetNoncePrefixSize() const override { return 0; }
+ size_t GetMaxPlaintextSize(size_t ciphertext_size) const override {
return ciphertext_size;
}
- virtual size_t GetCiphertextSize(size_t plaintext_size) const override {
+ size_t GetCiphertextSize(size_t plaintext_size) const override {
return plaintext_size;
}
- virtual StringPiece GetKey() const override {
- return StringPiece();
- }
- virtual StringPiece GetNoncePrefix() const override {
- return StringPiece();
- }
+ StringPiece GetKey() const override { return StringPiece(); }
+ StringPiece GetNoncePrefix() const override { return StringPiece(); }
QuicPacketSequenceNumber sequence_number_;
string associated_data_;
string plaintext_;
@@ -150,35 +138,27 @@
class TestDecrypter : public QuicDecrypter {
public:
- virtual ~TestDecrypter() {}
- virtual bool SetKey(StringPiece key) override {
- return true;
- }
- virtual bool SetNoncePrefix(StringPiece nonce_prefix) override {
- return true;
- }
- virtual bool Decrypt(StringPiece nonce,
- StringPiece associated_data,
- StringPiece ciphertext,
- unsigned char* output,
- size_t* output_length) override {
+ ~TestDecrypter() override {}
+ bool SetKey(StringPiece key) override { return true; }
+ bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; }
+ bool Decrypt(StringPiece nonce,
+ StringPiece associated_data,
+ StringPiece ciphertext,
+ unsigned char* output,
+ size_t* output_length) override {
CHECK(false) << "Not implemented";
return false;
}
- virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
- StringPiece associated_data,
- StringPiece ciphertext) override {
+ QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
+ StringPiece associated_data,
+ StringPiece ciphertext) override {
sequence_number_ = sequence_number;
associated_data_ = associated_data.as_string();
ciphertext_ = ciphertext.as_string();
return new QuicData(ciphertext.data(), ciphertext.length());
}
- virtual StringPiece GetKey() const override {
- return StringPiece();
- }
- virtual StringPiece GetNoncePrefix() const override {
- return StringPiece();
- }
+ StringPiece GetKey() const override { return StringPiece(); }
+ StringPiece GetNoncePrefix() const override { return StringPiece(); }
QuicPacketSequenceNumber sequence_number_;
string associated_data_;
string ciphertext_;
@@ -198,7 +178,7 @@
accept_public_header_(true) {
}
- virtual ~TestQuicVisitor() {
+ ~TestQuicVisitor() override {
STLDeleteElements(&stream_frames_);
STLDeleteElements(&ack_frames_);
STLDeleteElements(&congestion_feedback_frames_);
@@ -207,70 +187,66 @@
STLDeleteElements(&fec_data_);
}
- virtual void OnError(QuicFramer* f) override {
+ void OnError(QuicFramer* f) override {
DVLOG(1) << "QuicFramer Error: " << QuicUtils::ErrorToString(f->error())
<< " (" << f->error() << ")";
++error_count_;
}
- virtual void OnPacket() override {}
+ void OnPacket() override {}
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) override {
+ void OnPublicResetPacket(const QuicPublicResetPacket& packet) override {
public_reset_packet_.reset(new QuicPublicResetPacket(packet));
}
- virtual void OnVersionNegotiationPacket(
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& packet) override {
version_negotiation_packet_.reset(new QuicVersionNegotiationPacket(packet));
}
- virtual void OnRevivedPacket() override {
- ++revived_packets_;
- }
+ void OnRevivedPacket() override { ++revived_packets_; }
- virtual bool OnProtocolVersionMismatch(QuicVersion version) override {
+ bool OnProtocolVersionMismatch(QuicVersion version) override {
DVLOG(1) << "QuicFramer Version Mismatch, version: " << version;
++version_mismatch_;
return true;
}
- virtual bool OnUnauthenticatedPublicHeader(
+ bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) override {
public_header_.reset(new QuicPacketPublicHeader(header));
return accept_public_header_;
}
- virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) override {
+ bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override {
return true;
}
- virtual void OnDecryptedPacket(EncryptionLevel level) override {}
+ void OnDecryptedPacket(EncryptionLevel level) override {}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) override {
+ bool OnPacketHeader(const QuicPacketHeader& header) override {
++packet_count_;
header_.reset(new QuicPacketHeader(header));
return accept_packet_;
}
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) override {
+ bool OnStreamFrame(const QuicStreamFrame& frame) override {
++frame_count_;
stream_frames_.push_back(new QuicStreamFrame(frame));
return true;
}
- virtual void OnFecProtectedPayload(StringPiece payload) override {
+ void OnFecProtectedPayload(StringPiece payload) override {
fec_protected_payload_ = payload.as_string();
}
- virtual bool OnAckFrame(const QuicAckFrame& frame) override {
+ bool OnAckFrame(const QuicAckFrame& frame) override {
++frame_count_;
ack_frames_.push_back(new QuicAckFrame(frame));
return true;
}
- virtual bool OnCongestionFeedbackFrame(
+ bool OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& frame) override {
++frame_count_;
congestion_feedback_frames_.push_back(
@@ -278,50 +254,46 @@
return true;
}
- virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override {
+ bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override {
++frame_count_;
stop_waiting_frames_.push_back(new QuicStopWaitingFrame(frame));
return true;
}
- virtual bool OnPingFrame(const QuicPingFrame& frame) override {
+ bool OnPingFrame(const QuicPingFrame& frame) override {
++frame_count_;
ping_frames_.push_back(new QuicPingFrame(frame));
return true;
}
- virtual void OnFecData(const QuicFecData& fec) override {
+ void OnFecData(const QuicFecData& fec) override {
++fec_count_;
fec_data_.push_back(new QuicFecData(fec));
}
- virtual void OnPacketComplete() override {
- ++complete_packets_;
- }
+ void OnPacketComplete() override { ++complete_packets_; }
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override {
+ bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override {
rst_stream_frame_ = frame;
return true;
}
- virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) override {
+ bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override {
connection_close_frame_ = frame;
return true;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override {
+ bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override {
goaway_frame_ = frame;
return true;
}
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame)
- override {
+ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override {
window_update_frame_ = frame;
return true;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
+ bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
blocked_frame_ = frame;
return true;
}
@@ -4538,20 +4510,12 @@
0x07,
};
- if (version_ >= QUIC_VERSION_18) {
- scoped_ptr<QuicPacket> data(BuildDataPacket(header, frames));
- ASSERT_TRUE(data != nullptr);
+ scoped_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
- test::CompareCharArraysWithHexError("constructed packet", data->data(),
- data->length(), AsChars(packet),
- arraysize(packet));
- } else {
- string expected_error =
- "Attempt to add a PingFrame in " + QuicVersionToString(version_);
- EXPECT_DFATAL(BuildDataPacket(header, frames),
- expected_error);
- return;
- }
+ test::CompareCharArraysWithHexError("constructed packet", data->data(),
+ data->length(), AsChars(packet),
+ arraysize(packet));
}
TEST_P(QuicFramerTest, BuildPublicResetPacket) {
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index 56b700e..b99e9d2 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -26,11 +26,11 @@
explicit SpdyFramerVisitor(QuicHeadersStream* stream) : stream_(stream) {}
// SpdyFramerVisitorInterface implementation
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional) override {
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional) override {
if (!stream_->IsConnected()) {
return;
}
@@ -48,7 +48,7 @@
stream_->OnSynStream(stream_id, priority, fin);
}
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override {
+ void OnSynReply(SpdyStreamId stream_id, bool fin) override {
if (!stream_->IsConnected()) {
return;
}
@@ -56,9 +56,9 @@
stream_->OnSynReply(stream_id, fin);
}
- virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
- const char* header_data,
- size_t len) override {
+ bool OnControlFrameHeaderData(SpdyStreamId stream_id,
+ const char* header_data,
+ size_t len) override {
if (!stream_->IsConnected()) {
return false;
}
@@ -66,10 +66,10 @@
return true;
}
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override {
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override {
if (fin && len == 0) {
// The framer invokes OnStreamFrameData with zero-length data and
// fin = true after processing a SYN_STREAM or SYN_REPLY frame
@@ -79,78 +79,76 @@
CloseConnection("SPDY DATA frame received.");
}
- virtual void OnError(SpdyFramer* framer) override {
+ void OnError(SpdyFramer* framer) override {
CloseConnection("SPDY framing error.");
}
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override {
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override {
CloseConnection("SPDY DATA frame received.");
}
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override {
+ void OnRstStream(SpdyStreamId stream_id,
+ SpdyRstStreamStatus status) override {
CloseConnection("SPDY RST_STREAM frame received.");
}
- virtual void OnSetting(SpdySettingsIds id,
- uint8 flags,
- uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
CloseConnection("SPDY SETTINGS frame received.");
}
- virtual void OnSettingsAck() override {
+ void OnSettingsAck() override {
CloseConnection("SPDY SETTINGS frame received.");
}
- virtual void OnSettingsEnd() override {
+ void OnSettingsEnd() override {
CloseConnection("SPDY SETTINGS frame received.");
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {
+ void OnPing(SpdyPingId unique_id, bool is_ack) override {
CloseConnection("SPDY PING frame received.");
}
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override {
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override {
CloseConnection("SPDY GOAWAY frame received.");
}
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
+ void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
CloseConnection("SPDY HEADERS frame received.");
}
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override {
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override {
CloseConnection("SPDY WINDOW_UPDATE frame received.");
}
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- bool end) override {
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ bool end) override {
LOG(DFATAL) << "PUSH_PROMISE frame received from a SPDY/3 framer";
CloseConnection("SPDY PUSH_PROMISE frame received.");
}
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) override {
+ void OnContinuation(SpdyStreamId stream_id, bool end) override {
CloseConnection("SPDY CONTINUATION frame received.");
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
CloseConnection("SPDY unknown frame received.");
return false;
}
// SpdyFramerDebugVisitorInterface implementation
- virtual void OnSendCompressedFrame(SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t payload_len,
- size_t frame_len) override {}
+ void OnSendCompressedFrame(SpdyStreamId stream_id,
+ SpdyFrameType type,
+ size_t payload_len,
+ size_t frame_len) override {}
- virtual void OnReceiveCompressedFrame(SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t frame_len) override {
+ void OnReceiveCompressedFrame(SpdyStreamId stream_id,
+ SpdyFrameType type,
+ size_t frame_len) override {
if (stream_->IsConnected()) {
stream_->OnCompressedFrameSize(frame_len);
}
diff --git a/net/quic/quic_headers_stream.h b/net/quic/quic_headers_stream.h
index fb96ec7..95066b6 100644
--- a/net/quic/quic_headers_stream.h
+++ b/net/quic/quic_headers_stream.h
@@ -21,7 +21,7 @@
class NET_EXPORT_PRIVATE QuicHeadersStream : public ReliableQuicStream {
public:
explicit QuicHeadersStream(QuicSession* session);
- virtual ~QuicHeadersStream();
+ ~QuicHeadersStream() override;
// Writes |headers| for |stream_id| in a SYN_STREAM or SYN_REPLY
// frame to the peer. If |fin| is true, the fin flag will be set on
@@ -34,8 +34,8 @@
QuicAckNotifier::DelegateInterface* ack_notifier_delegate);
// ReliableQuicStream implementation
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) override;
- virtual QuicPriority EffectivePriority() const override;
+ uint32 ProcessRawData(const char* data, uint32 data_len) override;
+ QuicPriority EffectivePriority() const override;
private:
class SpdyFramerVisitor;
diff --git a/net/quic/quic_http_stream.h b/net/quic/quic_http_stream.h
index 44e98e8..81d4be9 100644
--- a/net/quic/quic_http_stream.h
+++ b/net/quic/quic_http_stream.h
@@ -29,47 +29,45 @@
public:
explicit QuicHttpStream(const base::WeakPtr<QuicClientSession>& session);
- virtual ~QuicHttpStream();
+ ~QuicHttpStream() override;
// HttpStream implementation.
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override;
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override;
- virtual UploadProgress GetUploadProgress() const override;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual void Close(bool not_reusable) override;
- virtual HttpStream* RenewStreamForAuth() override;
- virtual bool IsResponseBodyComplete() const override;
- virtual bool CanFindEndOfResponse() const override;
- virtual bool IsConnectionReused() const override;
- virtual void SetConnectionReused() override;
- virtual bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) override;
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override;
- virtual bool IsSpdyHttpStream() const override;
- virtual void Drain(HttpNetworkSession* session) override;
- virtual void SetPriority(RequestPriority priority) override;
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override;
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override;
+ UploadProgress GetUploadProgress() const override;
+ int ReadResponseHeaders(const CompletionCallback& callback) override;
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void Close(bool not_reusable) override;
+ HttpStream* RenewStreamForAuth() override;
+ bool IsResponseBodyComplete() const override;
+ bool CanFindEndOfResponse() const override;
+ bool IsConnectionReused() const override;
+ void SetConnectionReused() override;
+ bool IsConnectionReusable() const override;
+ int64 GetTotalReceivedBytes() const override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void GetSSLInfo(SSLInfo* ssl_info) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ bool IsSpdyHttpStream() const override;
+ void Drain(HttpNetworkSession* session) override;
+ void SetPriority(RequestPriority priority) override;
// QuicReliableClientStream::Delegate implementation
- virtual int OnDataReceived(const char* data, int length) override;
- virtual void OnClose(QuicErrorCode error) override;
- virtual void OnError(int error) override;
- virtual bool HasSendHeadersComplete() override;
+ int OnDataReceived(const char* data, int length) override;
+ void OnClose(QuicErrorCode error) override;
+ void OnError(int error) override;
+ bool HasSendHeadersComplete() override;
// QuicClientSession::Observer implementation
- virtual void OnCryptoHandshakeConfirmed() override;
- virtual void OnSessionClosed(int error) override;
+ void OnCryptoHandshakeConfirmed() override;
+ void OnSessionClosed(int error) override;
private:
friend class test::QuicHttpStreamPeer;
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index b6ecc77..53be4dd 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -98,7 +98,7 @@
: QuicHttpStream(session) {
}
- virtual int OnDataReceived(const char* data, int length) override {
+ int OnDataReceived(const char* data, int length) override {
Close(false);
return OK;
}
@@ -108,9 +108,9 @@
public:
explicit TestPacketWriterFactory(DatagramClientSocket* socket)
: socket_(socket) {}
- virtual ~TestPacketWriterFactory() {}
+ ~TestPacketWriterFactory() override {}
- virtual QuicPacketWriter* Create(QuicConnection* connection) const override {
+ QuicPacketWriter* Create(QuicConnection* connection) const override {
return new QuicDefaultPacketWriter(socket_);
}
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index cb4cb05..55de997 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -34,11 +34,11 @@
QuicFramer* framer,
QuicRandom* random_generator);
- virtual ~QuicPacketCreator();
+ ~QuicPacketCreator() override;
// QuicFecBuilderInterface
- virtual void OnBuiltFecProtectedPayload(const QuicPacketHeader& header,
- base::StringPiece payload) override;
+ void OnBuiltFecProtectedPayload(const QuicPacketHeader& header,
+ base::StringPiece payload) override;
// Turn on FEC protection for subsequently created packets. FEC should be
// enabled first (max_packets_per_fec_group should be non-zero) for FEC
diff --git a/net/quic/quic_per_connection_packet_writer.h b/net/quic/quic_per_connection_packet_writer.h
index 4e5e8c8..6d91312 100644
--- a/net/quic/quic_per_connection_packet_writer.h
+++ b/net/quic/quic_per_connection_packet_writer.h
@@ -22,20 +22,20 @@
// Does not take ownership of |shared_writer| or |connection|.
QuicPerConnectionPacketWriter(QuicServerPacketWriter* shared_writer,
QuicConnection* connection);
- virtual ~QuicPerConnectionPacketWriter();
+ ~QuicPerConnectionPacketWriter() override;
QuicPacketWriter* shared_writer() const;
QuicConnection* connection() const { return connection_; }
// Default implementation of the QuicPacketWriter interface: Passes everything
// to |shared_writer_|.
- virtual WriteResult WritePacket(const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
- virtual bool IsWriteBlockedDataBuffered() const override;
- virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+ bool IsWriteBlockedDataBuffered() const override;
+ bool IsWriteBlocked() const override;
+ void SetWritable() override;
private:
void OnWriteComplete(WriteResult result);
diff --git a/net/quic/quic_protocol.cc b/net/quic/quic_protocol.cc
index 96a4557..d040167 100644
--- a/net/quic/quic_protocol.cc
+++ b/net/quic/quic_protocol.cc
@@ -158,8 +158,6 @@
QuicTag QuicVersionToQuicTag(const QuicVersion version) {
switch (version) {
- case QUIC_VERSION_18:
- return MakeQuicTag('Q', '0', '1', '8');
case QUIC_VERSION_19:
return MakeQuicTag('Q', '0', '1', '9');
case QUIC_VERSION_21:
@@ -194,7 +192,6 @@
string QuicVersionToString(const QuicVersion version) {
switch (version) {
- RETURN_STRING_LITERAL(QUIC_VERSION_18);
RETURN_STRING_LITERAL(QUIC_VERSION_19);
RETURN_STRING_LITERAL(QUIC_VERSION_21);
RETURN_STRING_LITERAL(QUIC_VERSION_22);
@@ -277,15 +274,6 @@
QuicRstStreamErrorCode AdjustErrorForVersion(
QuicRstStreamErrorCode error_code,
QuicVersion version) {
- switch (error_code) {
- case QUIC_RST_FLOW_CONTROL_ACCOUNTING:
- if (version < QUIC_VERSION_18) {
- return QUIC_STREAM_NO_ERROR;
- }
- break;
- default:
- return error_code;
- }
return error_code;
}
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 47be63c..7d46719 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -298,7 +298,6 @@
// Special case to indicate unknown/unsupported QUIC version.
QUIC_VERSION_UNSUPPORTED = 0,
- QUIC_VERSION_18 = 18, // PING frame.
QUIC_VERSION_19 = 19, // Connection level flow control.
QUIC_VERSION_21 = 21, // Headers/crypto streams are flow controlled.
QUIC_VERSION_22 = 22, // Send Server Config Update messages on crypto stream.
@@ -315,8 +314,7 @@
static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_23,
QUIC_VERSION_22,
QUIC_VERSION_21,
- QUIC_VERSION_19,
- QUIC_VERSION_18};
+ QUIC_VERSION_19};
typedef std::vector<QuicVersion> QuicVersionVector;
diff --git a/net/quic/quic_protocol_test.cc b/net/quic/quic_protocol_test.cc
index 4f23490..43a009a 100644
--- a/net/quic/quic_protocol_test.cc
+++ b/net/quic/quic_protocol_test.cc
@@ -16,9 +16,11 @@
<< "Any additions to QuicRstStreamErrorCode require an addition to "
<< "AdjustErrorForVersion and this associated test.";
- EXPECT_EQ(QUIC_RST_FLOW_CONTROL_ACCOUNTING, AdjustErrorForVersion(
- QUIC_RST_FLOW_CONTROL_ACCOUNTING,
- QUIC_VERSION_18));
+ // If we ever add different RST codes, we should have a test akin to the
+ // following.
+ // EXPECT_EQ(QUIC_RST_FLOW_CONTROL_ACCOUNTING, AdjustErrorForVersion(
+ // QUIC_RST_FLOW_CONTROL_ACCOUNTING,
+ // QUIC_VERSION_18));
}
TEST(QuicProtocolTest, MakeQuicTag) {
diff --git a/net/quic/quic_received_packet_manager.h b/net/quic/quic_received_packet_manager.h
index 9eccfe0..a15d570 100644
--- a/net/quic/quic_received_packet_manager.h
+++ b/net/quic/quic_received_packet_manager.h
@@ -96,7 +96,7 @@
};
explicit QuicReceivedPacketManager(QuicConnectionStats* stats);
- virtual ~QuicReceivedPacketManager();
+ ~QuicReceivedPacketManager() override;
// Updates the internal state concerning which packets have been received.
// bytes: the packet size in bytes including Quic Headers.
@@ -128,7 +128,7 @@
// QuicReceivedEntropyHashCalculatorInterface
// Called by QuicFramer, when the outgoing ack gets truncated, to recalculate
// the received entropy hash for the truncated ack frame.
- virtual QuicPacketEntropyHash EntropyHash(
+ QuicPacketEntropyHash EntropyHash(
QuicPacketSequenceNumber sequence_number) const override;
// Updates internal state based on |stop_waiting|.
diff --git a/net/quic/quic_reliable_client_stream.h b/net/quic/quic_reliable_client_stream.h
index 065db9e..9ed6601 100644
--- a/net/quic/quic_reliable_client_stream.h
+++ b/net/quic/quic_reliable_client_stream.h
@@ -51,13 +51,13 @@
QuicSession* session,
const BoundNetLog& net_log);
- virtual ~QuicReliableClientStream();
+ ~QuicReliableClientStream() override;
// QuicDataStream
- virtual uint32 ProcessData(const char* data, uint32 data_len) override;
- virtual void OnFinRead() override;
- virtual void OnCanWrite() override;
- virtual QuicPriority EffectivePriority() const override;
+ uint32 ProcessData(const char* data, uint32 data_len) override;
+ void OnFinRead() override;
+ void OnCanWrite() override;
+ QuicPriority EffectivePriority() const override;
// While the server's set_priority shouldn't be called externally, the creator
// of client-side streams should be able to set the priority.
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 3e81e74..c004197 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -148,31 +148,6 @@
return false;
}
-void QuicSentPacketManager::OnRetransmittedPacket(
- QuicPacketSequenceNumber old_sequence_number,
- QuicPacketSequenceNumber new_sequence_number) {
- TransmissionType transmission_type;
- PendingRetransmissionMap::iterator it =
- pending_retransmissions_.find(old_sequence_number);
- if (it != pending_retransmissions_.end()) {
- transmission_type = it->second;
- pending_retransmissions_.erase(it);
- } else {
- DLOG(DFATAL) << "Expected sequence number to be in "
- "pending_retransmissions_. sequence_number: " << old_sequence_number;
- transmission_type = NOT_RETRANSMISSION;
- }
-
- // A notifier may be waiting to hear about ACKs for the original sequence
- // number. Inform them that the sequence number has changed.
- ack_notifier_manager_.UpdateSequenceNumber(old_sequence_number,
- new_sequence_number);
-
- unacked_packets_.OnRetransmittedPacket(old_sequence_number,
- new_sequence_number,
- transmission_type);
-}
-
void QuicSentPacketManager::OnIncomingAck(const QuicAckFrame& ack_frame,
QuicTime ack_receive_time) {
QuicByteCount bytes_in_flight = unacked_packets_.bytes_in_flight();
@@ -451,8 +426,8 @@
const TransmissionInfo& info,
QuicTime::Delta delta_largest_observed) {
QuicPacketSequenceNumber newest_transmission =
- info.all_transmissions == nullptr ? sequence_number
- : *info.all_transmissions->rbegin();
+ info.all_transmissions == nullptr ?
+ sequence_number : *info.all_transmissions->rbegin();
// Remove the most recent packet, if it is pending retransmission.
pending_retransmissions_.erase(newest_transmission);
@@ -508,10 +483,20 @@
if (serialized_packet->retransmittable_frames) {
ack_notifier_manager_.OnSerializedPacket(*serialized_packet);
}
- unacked_packets_.AddPacket(*serialized_packet);
- serialized_packet->retransmittable_frames = nullptr;
} else {
- OnRetransmittedPacket(original_sequence_number, sequence_number);
+ PendingRetransmissionMap::iterator it =
+ pending_retransmissions_.find(original_sequence_number);
+ if (it != pending_retransmissions_.end()) {
+ pending_retransmissions_.erase(it);
+ } else {
+ DLOG(DFATAL) << "Expected sequence number to be in "
+ << "pending_retransmissions_. sequence_number: "
+ << original_sequence_number;
+ }
+ // A notifier may be waiting to hear about ACKs for the original sequence
+ // number. Inform them that the sequence number has changed.
+ ack_notifier_manager_.UpdateSequenceNumber(original_sequence_number,
+ sequence_number);
}
if (pending_timer_transmission_count_ > 0) {
@@ -533,8 +518,15 @@
sequence_number,
bytes,
has_retransmittable_data);
- unacked_packets_.SetSent(sequence_number, sent_time, bytes, in_flight);
+ unacked_packets_.AddSentPacket(*serialized_packet,
+ original_sequence_number,
+ transmission_type,
+ sent_time,
+ bytes,
+ in_flight);
+ // Take ownership of the retransmittable frames before exiting.
+ serialized_packet->retransmittable_frames = nullptr;
// Reset the retransmission timer anytime a pending packet is sent.
return in_flight;
}
@@ -873,11 +865,12 @@
return;
}
- // Set up a pacing sender with a 5 millisecond alarm granularity.
+ // Set up a pacing sender with a 1 millisecond alarm granularity, the same as
+ // the default granularity of the Linux kernel's FQ qdisc.
using_pacing_ = true;
send_algorithm_.reset(
new PacingSender(send_algorithm_.release(),
- QuicTime::Delta::FromMilliseconds(5),
+ QuicTime::Delta::FromMilliseconds(1),
kInitialUnpacedBurst));
}
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
index 3260ab1..d3f0312 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -168,7 +168,7 @@
old_sequence_number,
clock_.Now(),
kDefaultLength,
- LOSS_RETRANSMISSION,
+ TLP_RETRANSMISSION,
HAS_RETRANSMITTABLE_DATA);
EXPECT_TRUE(QuicSentPacketManagerPeer::IsRetransmission(
&manager_, new_sequence_number));
@@ -1036,7 +1036,7 @@
QuicSentPacketManagerPeer::GetRttStats(&manager_)->UpdateRtt(
min_rtt, QuicTime::Delta::Zero(), QuicTime::Zero());
EXPECT_EQ(min_rtt,
- QuicSentPacketManagerPeer::GetRttStats(&manager_)->min_rtt());
+ QuicSentPacketManagerPeer::GetRttStats(&manager_)->MinRtt());
EXPECT_EQ(min_rtt,
QuicSentPacketManagerPeer::GetRttStats(
&manager_)->recent_min_rtt());
@@ -1063,7 +1063,7 @@
manager_.OnIncomingAck(ack_frame, clock_.Now());
EXPECT_EQ(min_rtt,
- QuicSentPacketManagerPeer::GetRttStats(&manager_)->min_rtt());
+ QuicSentPacketManagerPeer::GetRttStats(&manager_)->MinRtt());
EXPECT_EQ(QuicTime::Delta::FromMilliseconds(100),
QuicSentPacketManagerPeer::GetRttStats(
&manager_)->recent_min_rtt());
diff --git a/net/quic/quic_server_packet_writer.h b/net/quic/quic_server_packet_writer.h
index 15c946b..2e4646d 100644
--- a/net/quic/quic_server_packet_writer.h
+++ b/net/quic/quic_server_packet_writer.h
@@ -26,7 +26,7 @@
QuicServerPacketWriter(UDPServerSocket* socket,
QuicBlockedWriterInterface* blocked_writer);
- virtual ~QuicServerPacketWriter();
+ ~QuicServerPacketWriter() override;
// Use this method to write packets rather than WritePacket:
// QuicServerPacketWriter requires a callback to exist for every write, which
@@ -41,16 +41,17 @@
void OnWriteComplete(int rv);
// QuicPacketWriter implementation:
- virtual bool IsWriteBlockedDataBuffered() const override;
- virtual bool IsWriteBlocked() const override;
- virtual void SetWritable() override;
+ bool IsWriteBlockedDataBuffered() const override;
+ bool IsWriteBlocked() const override;
+ void SetWritable() override;
protected:
// Do not call WritePacket on its own -- use WritePacketWithCallback
- virtual WriteResult WritePacket(const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
+
private:
UDPServerSocket* socket_;
diff --git a/net/quic/quic_server_session.cc b/net/quic/quic_server_session.cc
index f2967a5..c55496e 100644
--- a/net/quic/quic_server_session.cc
+++ b/net/quic/quic_server_session.cc
@@ -122,7 +122,7 @@
cached_network_params.set_max_bandwidth_timestamp_seconds(
max_bandwidth_timestamp);
cached_network_params.set_min_rtt_ms(
- sent_packet_manager.GetRttStats()->min_rtt().ToMilliseconds());
+ sent_packet_manager.GetRttStats()->MinRtt().ToMilliseconds());
cached_network_params.set_previous_connection_state(
bandwidth_recorder.EstimateRecordedDuringSlowStart()
? CachedNetworkParameters::SLOW_START
diff --git a/net/quic/quic_server_session.h b/net/quic/quic_server_session.h
index 80b6443..2f0bdea 100644
--- a/net/quic/quic_server_session.h
+++ b/net/quic/quic_server_session.h
@@ -49,14 +49,14 @@
QuicServerSessionVisitor* visitor);
// Override the base class to notify the owner of the connection close.
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
- virtual void OnWriteBlocked() override;
+ void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ void OnWriteBlocked() override;
// Sends a server config update to the client, containing new bandwidth
// estimate.
- virtual void OnCongestionWindowChange(QuicTime now) override;
+ void OnCongestionWindowChange(QuicTime now) override;
- virtual ~QuicServerSession();
+ ~QuicServerSession() override;
virtual void InitializeSession(const QuicCryptoServerConfig& crypto_config);
@@ -65,7 +65,7 @@
}
// Override base class to process FEC config received from client.
- virtual void OnConfigNegotiated() override;
+ void OnConfigNegotiated() override;
void set_serving_region(string serving_region) {
serving_region_ = serving_region;
@@ -73,9 +73,9 @@
protected:
// QuicSession methods:
- virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
- virtual QuicDataStream* CreateOutgoingDataStream() override;
- virtual QuicCryptoServerStream* GetCryptoStream() override;
+ QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
+ QuicDataStream* CreateOutgoingDataStream() override;
+ QuicCryptoServerStream* GetCryptoStream() override;
// If we should create an incoming stream, returns true. Otherwise
// does error handling, including communicating the error to the client and
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index 3299e71..596be40 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -34,65 +34,60 @@
public:
explicit VisitorShim(QuicSession* session) : session_(session) {}
- virtual void OnStreamFrames(const vector<QuicStreamFrame>& frames) override {
+ void OnStreamFrames(const vector<QuicStreamFrame>& frames) override {
session_->OnStreamFrames(frames);
session_->PostProcessAfterData();
}
- virtual void OnRstStream(const QuicRstStreamFrame& frame) override {
+ void OnRstStream(const QuicRstStreamFrame& frame) override {
session_->OnRstStream(frame);
session_->PostProcessAfterData();
}
- virtual void OnGoAway(const QuicGoAwayFrame& frame) override {
+ void OnGoAway(const QuicGoAwayFrame& frame) override {
session_->OnGoAway(frame);
session_->PostProcessAfterData();
}
- virtual void OnWindowUpdateFrames(const vector<QuicWindowUpdateFrame>& frames)
- override {
+ void OnWindowUpdateFrames(
+ const vector<QuicWindowUpdateFrame>& frames) override {
session_->OnWindowUpdateFrames(frames);
session_->PostProcessAfterData();
}
- virtual void OnBlockedFrames(const vector<QuicBlockedFrame>& frames)
- override {
+ void OnBlockedFrames(const vector<QuicBlockedFrame>& frames) override {
session_->OnBlockedFrames(frames);
session_->PostProcessAfterData();
}
- virtual void OnCanWrite() override {
+ void OnCanWrite() override {
session_->OnCanWrite();
session_->PostProcessAfterData();
}
- virtual void OnCongestionWindowChange(QuicTime now) override {
+ void OnCongestionWindowChange(QuicTime now) override {
session_->OnCongestionWindowChange(now);
}
- virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) override {
+ void OnSuccessfulVersionNegotiation(const QuicVersion& version) override {
session_->OnSuccessfulVersionNegotiation(version);
}
- virtual void OnConnectionClosed(
- QuicErrorCode error, bool from_peer) override {
+ void OnConnectionClosed(QuicErrorCode error, bool from_peer) override {
session_->OnConnectionClosed(error, from_peer);
// The session will go away, so don't bother with cleanup.
}
- virtual void OnWriteBlocked() override {
- session_->OnWriteBlocked();
- }
+ void OnWriteBlocked() override { session_->OnWriteBlocked(); }
- virtual bool WillingAndAbleToWrite() const override {
+ bool WillingAndAbleToWrite() const override {
return session_->WillingAndAbleToWrite();
}
- virtual bool HasPendingHandshake() const override {
+ bool HasPendingHandshake() const override {
return session_->HasPendingHandshake();
}
- virtual bool HasOpenDataStreams() const override {
+ bool HasOpenDataStreams() const override {
return session_->HasOpenDataStreams();
}
@@ -111,7 +106,7 @@
goaway_received_(false),
goaway_sent_(false),
has_pending_handshake_(false) {
- if (connection_->version() <= QUIC_VERSION_19) {
+ if (connection_->version() == QUIC_VERSION_19) {
flow_controller_.reset(new QuicFlowController(
connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow,
config_.GetInitialFlowControlWindowToSend(),
@@ -487,8 +482,8 @@
set_max_open_streams(max_streams);
}
- if (version <= QUIC_VERSION_19) {
- // QUIC_VERSION_17,18,19 don't support independent stream/session flow
+ if (version == QUIC_VERSION_19) {
+ // QUIC_VERSION_19 doesn't support independent stream/session flow
// control windows.
if (config_.HasReceivedInitialFlowControlWindowBytes()) {
// Streams which were created before the SHLO was received (0-RTT
@@ -715,7 +710,7 @@
// For peer created streams, we also need to consider implicitly created
// streams.
return id <= largest_peer_created_stream_id_ &&
- implicitly_created_streams_.count(id) == 0;
+ !ContainsKey(implicitly_created_streams_, id);
}
size_t QuicSession::GetNumOpenStreams() const {
@@ -770,10 +765,6 @@
}
void QuicSession::OnSuccessfulVersionNegotiation(const QuicVersion& version) {
- if (version < QUIC_VERSION_19) {
- flow_controller_->Disable();
- }
-
// Disable stream level flow control based on negotiated version. Streams may
// have been created with a different version.
if (version < QUIC_VERSION_21) {
diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h
index 6414b6d..1bca3aa 100644
--- a/net/quic/quic_session.h
+++ b/net/quic/quic_session.h
@@ -55,26 +55,23 @@
QuicSession(QuicConnection* connection, const QuicConfig& config);
void InitializeSession();
- virtual ~QuicSession();
+ ~QuicSession() override;
// QuicConnectionVisitorInterface methods:
- virtual void OnStreamFrames(
- const std::vector<QuicStreamFrame>& frames) override;
- virtual void OnRstStream(const QuicRstStreamFrame& frame) override;
- virtual void OnGoAway(const QuicGoAwayFrame& frame) override;
- virtual void OnWindowUpdateFrames(
+ void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override;
+ void OnRstStream(const QuicRstStreamFrame& frame) override;
+ void OnGoAway(const QuicGoAwayFrame& frame) override;
+ void OnWindowUpdateFrames(
const std::vector<QuicWindowUpdateFrame>& frames) override;
- virtual void OnBlockedFrames(
- const std::vector<QuicBlockedFrame>& frames) override;
- virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
- virtual void OnWriteBlocked() override {}
- virtual void OnSuccessfulVersionNegotiation(
- const QuicVersion& version) override;
- virtual void OnCanWrite() override;
- virtual void OnCongestionWindowChange(QuicTime now) override {}
- virtual bool WillingAndAbleToWrite() const override;
- virtual bool HasPendingHandshake() const override;
- virtual bool HasOpenDataStreams() const override;
+ void OnBlockedFrames(const std::vector<QuicBlockedFrame>& frames) override;
+ void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
+ void OnWriteBlocked() override {}
+ void OnSuccessfulVersionNegotiation(const QuicVersion& version) override;
+ void OnCanWrite() override;
+ void OnCongestionWindowChange(QuicTime now) override {}
+ bool WillingAndAbleToWrite() const override;
+ bool HasPendingHandshake() const override;
+ bool HasOpenDataStreams() const override;
// Called by the headers stream when headers have been received for a stream.
virtual void OnStreamHeaders(QuicStreamId stream_id,
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index 770a564..0a5032e 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/rand_util.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "net/quic/crypto/crypto_protocol.h"
#include "net/quic/quic_crypto_stream.h"
@@ -227,7 +228,7 @@
void CheckClosedStreams() {
for (int i = kCryptoStreamId; i < 100; i++) {
- if (closed_streams_.count(i) == 0) {
+ if (!ContainsKey(closed_streams_, i)) {
EXPECT_FALSE(session_.IsClosedStream(i)) << " stream id: " << i;
} else {
EXPECT_TRUE(session_.IsClosedStream(i)) << " stream id: " << i;
@@ -529,10 +530,6 @@
}
TEST_P(QuicSessionTest, OnCanWriteLimitsNumWritesIfFlowControlBlocked) {
- if (version() < QUIC_VERSION_19) {
- return;
- }
-
// Ensure connection level flow control blockage.
QuicFlowControllerPeer::SetSendWindowOffset(session_.flow_controller(), 0);
EXPECT_TRUE(session_.flow_controller()->IsBlocked());
@@ -732,7 +729,7 @@
EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
QuicStreamId stream_id = 5;
// Write until the header stream is flow control blocked.
- while (!headers_stream->flow_controller()->IsBlocked() && stream_id < 2000) {
+ while (!headers_stream->flow_controller()->IsBlocked() && stream_id < 2010) {
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
SpdyHeaderBlock headers;
@@ -747,7 +744,8 @@
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
EXPECT_TRUE(session_.IsStreamFlowControlBlocked());
EXPECT_FALSE(session_.HasDataToWrite());
- EXPECT_TRUE(headers_stream->HasBufferedData());
+ // TODO(rtenneti): crbug.com/423586 headers_stream->HasBufferedData is flaky.
+ // EXPECT_TRUE(headers_stream->HasBufferedData());
// Now complete the crypto handshake, resulting in an increased flow control
// send window.
@@ -778,43 +776,7 @@
session_.OnConfigNegotiated();
}
-TEST_P(QuicSessionTest, InvalidStreamFlowControlWindowInHandshake) {
- // Test that receipt of an invalid (< default) stream flow control window from
- // the peer results in the connection being torn down.
- if (version() <= QUIC_VERSION_19) {
- return;
- }
-
- uint32 kInvalidWindow = kDefaultFlowControlSendWindow - 1;
- QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(session_.config(),
- kInvalidWindow);
-
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW));
- session_.OnConfigNegotiated();
-}
-
-TEST_P(QuicSessionTest, InvalidSessionFlowControlWindowInHandshake) {
- // Test that receipt of an invalid (< default) session flow control window
- // from the peer results in the connection being torn down.
- if (version() <= QUIC_VERSION_19) {
- return;
- }
-
- uint32 kInvalidWindow = kDefaultFlowControlSendWindow - 1;
- QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(),
- kInvalidWindow);
-
- EXPECT_CALL(*connection_,
- SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW));
- session_.OnConfigNegotiated();
-}
-
TEST_P(QuicSessionTest, ConnectionFlowControlAccountingRstOutOfOrder) {
- if (version() < QUIC_VERSION_19) {
- return;
- }
-
// Test that when we receive an out of order stream RST we correctly adjust
// our connection level flow control receive window.
// On close, the stream should mark as consumed all bytes between the highest
@@ -839,10 +801,6 @@
}
TEST_P(QuicSessionTest, ConnectionFlowControlAccountingFinAndLocalReset) {
- if (version() < QUIC_VERSION_19) {
- return;
- }
-
// Test the situation where we receive a FIN on a stream, and before we fully
// consume all the data from the sequencer buffer we locally RST the stream.
// The bytes between highest consumed byte, and the final byte offset that we
@@ -885,9 +843,6 @@
// Test that when we RST the stream (and tear down stream state), and then
// receive a FIN from the peer, we correctly adjust our connection level flow
// control receive window.
- if (version() < QUIC_VERSION_19) {
- return;
- }
// Connection starts with some non-zero highest received byte offset,
// due to other active streams.
@@ -927,9 +882,6 @@
// Test that when we RST the stream (and tear down stream state), and then
// receive a RST from the peer, we correctly adjust our connection level flow
// control receive window.
- if (version() < QUIC_VERSION_19) {
- return;
- }
// Connection starts with some non-zero highest received byte offset,
// due to other active streams.
@@ -959,6 +911,38 @@
session_.flow_controller()->highest_received_byte_offset());
}
+TEST_P(QuicSessionTest, InvalidStreamFlowControlWindowInHandshake) {
+ // Test that receipt of an invalid (< default) stream flow control window from
+ // the peer results in the connection being torn down.
+ if (version() <= QUIC_VERSION_19) {
+ return;
+ }
+
+ uint32 kInvalidWindow = kDefaultFlowControlSendWindow - 1;
+ QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(session_.config(),
+ kInvalidWindow);
+
+ EXPECT_CALL(*connection_,
+ SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW));
+ session_.OnConfigNegotiated();
+}
+
+TEST_P(QuicSessionTest, InvalidSessionFlowControlWindowInHandshake) {
+ // Test that receipt of an invalid (< default) session flow control window
+ // from the peer results in the connection being torn down.
+ if (version() == QUIC_VERSION_19) {
+ return;
+ }
+
+ uint32 kInvalidWindow = kDefaultFlowControlSendWindow - 1;
+ QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(),
+ kInvalidWindow);
+
+ EXPECT_CALL(*connection_,
+ SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW));
+ session_.OnConfigNegotiated();
+}
+
TEST_P(QuicSessionTest, FlowControlWithInvalidFinalOffset) {
// Test that if we receive a stream RST with a highest byte offset that
// violates flow control, that we close the connection.
@@ -981,26 +965,6 @@
session_.OnRstStream(rst_frame);
}
-TEST_P(QuicSessionTest, VersionNegotiationDisablesFlowControl) {
- if (version() < QUIC_VERSION_19) {
- return;
- }
-
- // Test that after successful version negotiation, flow control is disabled
- // appropriately at both the connection and stream level.
-
- // Initially both stream and connection flow control are enabled.
- TestStream* stream = session_.CreateOutgoingDataStream();
- EXPECT_TRUE(stream->flow_controller()->IsEnabled());
- EXPECT_TRUE(session_.flow_controller()->IsEnabled());
-
- // Version 18 implies that stream flow control is enabled, but connection
- // level is disabled.
- session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_18);
- EXPECT_FALSE(session_.flow_controller()->IsEnabled());
- EXPECT_TRUE(stream->flow_controller()->IsEnabled());
-}
-
TEST_P(QuicSessionTest, WindowUpdateUnblocksHeadersStream) {
// Test that a flow control blocked headers stream gets unblocked on recipt of
// a WINDOW_UPDATE frame. Regression test for b/17413860.
@@ -1029,9 +993,6 @@
}
TEST_P(QuicSessionTest, TooManyUnfinishedStreamsCauseConnectionClose) {
- if (version() < QUIC_VERSION_18) {
- return;
- }
// If a buggy/malicious peer creates too many streams that are not ended with
// a FIN or RST then we send a connection close.
ValueRestore<bool> old_flag(&FLAGS_close_quic_connection_unfinished_streams_2,
diff --git a/net/quic/quic_spdy_server_stream.h b/net/quic/quic_spdy_server_stream.h
index afd1291..54506d1 100644
--- a/net/quic/quic_spdy_server_stream.h
+++ b/net/quic/quic_spdy_server_stream.h
@@ -27,12 +27,12 @@
class QuicSpdyServerStream : public QuicDataStream {
public:
QuicSpdyServerStream(QuicStreamId id, QuicSession* session);
- virtual ~QuicSpdyServerStream();
+ ~QuicSpdyServerStream() override;
// ReliableQuicStream implementation called by the session when there's
// data for us.
- virtual uint32 ProcessData(const char* data, uint32 data_len) override;
- virtual void OnFinRead() override;
+ uint32 ProcessData(const char* data, uint32 data_len) override;
+ void OnFinRead() override;
void ParseRequestHeaders();
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 687ea4c..dac3096 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -103,9 +103,9 @@
public:
explicit DefaultPacketWriterFactory(DatagramClientSocket* socket)
: socket_(socket) {}
- virtual ~DefaultPacketWriterFactory() {}
+ ~DefaultPacketWriterFactory() override {}
- virtual QuicPacketWriter* Create(QuicConnection* connection) const override;
+ QuicPacketWriter* Create(QuicConnection* connection) const override;
private:
DatagramClientSocket* socket_;
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index f962699..7ee3681 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -105,7 +105,7 @@
bool always_require_handshake_confirmation,
bool disable_connection_pooling,
const QuicTagVector& connection_options);
- virtual ~QuicStreamFactory();
+ ~QuicStreamFactory() override;
// Creates a new QuicHttpStream to |host_port_pair| which will be
// owned by |request|. |is_https| specifies if the protocol is https or not.
@@ -147,13 +147,13 @@
// Until the servers support roaming, close all connections when the local
// IP address changes.
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
// CertDatabase::Observer methods:
// We close all sessions when certificate database is changed.
- virtual void OnCertAdded(const X509Certificate* cert) override;
- virtual void OnCACertChanged(const X509Certificate* cert) override;
+ void OnCertAdded(const X509Certificate* cert) override;
+ void OnCACertChanged(const X509Certificate* cert) override;
bool require_confirmation() const {
return require_confirmation_;
diff --git a/net/quic/quic_time_wait_list_manager.cc b/net/quic/quic_time_wait_list_manager.cc
index 4e069d5..42dae00 100644
--- a/net/quic/quic_time_wait_list_manager.cc
+++ b/net/quic/quic_time_wait_list_manager.cc
@@ -41,7 +41,7 @@
QuicTimeWaitListManager* time_wait_list_manager)
: time_wait_list_manager_(time_wait_list_manager) {}
- virtual QuicTime OnAlarm() override {
+ QuicTime OnAlarm() override {
time_wait_list_manager_->CleanUpOldConnectionIds();
// Let the time wait manager register the alarm at appropriate time.
return QuicTime::Zero();
diff --git a/net/quic/quic_time_wait_list_manager.h b/net/quic/quic_time_wait_list_manager.h
index 13544b7..a01ad2e 100644
--- a/net/quic/quic_time_wait_list_manager.h
+++ b/net/quic/quic_time_wait_list_manager.h
@@ -48,7 +48,7 @@
QuicServerSessionVisitor* visitor,
QuicConnectionHelperInterface* helper,
const QuicVersionVector& supported_versions);
- virtual ~QuicTimeWaitListManager();
+ ~QuicTimeWaitListManager() override;
// Adds the given connection_id to time wait state for kTimeWaitPeriod.
// Henceforth, any packet bearing this connection_id should not be processed
@@ -79,7 +79,7 @@
// Called by the dispatcher when the underlying socket becomes writable again,
// since we might need to send pending public reset packets which we didn't
// send because the underlying socket was write blocked.
- virtual void OnCanWrite() override;
+ void OnCanWrite() override;
// Used to delete connection_id entries that have outlived their time wait
// period.
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index ab46dfb..b289c61 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -34,25 +34,42 @@
}
}
-// TODO(ianswett): Combine this method with OnPacketSent once packets are always
-// sent in order and the connection tracks RetransmittableFrames for longer.
-void QuicUnackedPacketMap::AddPacket(
- const SerializedPacket& serialized_packet) {
- DCHECK_GE(serialized_packet.sequence_number,
- least_unacked_ + unacked_packets_.size());
- while (least_unacked_ + unacked_packets_.size() <
- serialized_packet.sequence_number) {
+void QuicUnackedPacketMap::AddSentPacket(
+ const SerializedPacket& packet,
+ QuicPacketSequenceNumber old_sequence_number,
+ TransmissionType transmission_type,
+ QuicTime sent_time,
+ QuicByteCount bytes_sent,
+ bool set_in_flight) {
+ QuicPacketSequenceNumber sequence_number = packet.sequence_number;
+ DCHECK_LT(largest_sent_packet_, sequence_number);
+ DCHECK_GE(sequence_number, least_unacked_ + unacked_packets_.size());
+ while (least_unacked_ + unacked_packets_.size() < sequence_number) {
unacked_packets_.push_back(TransmissionInfo());
unacked_packets_.back().is_unackable = true;
}
- unacked_packets_.push_back(
- TransmissionInfo(serialized_packet.retransmittable_frames,
- serialized_packet.sequence_number_length));
- if (serialized_packet.retransmittable_frames != nullptr &&
- serialized_packet.retransmittable_frames->HasCryptoHandshake() ==
- IS_HANDSHAKE) {
- ++pending_crypto_packet_count_;
+
+ TransmissionInfo info;
+ if (old_sequence_number == 0) {
+ if (packet.retransmittable_frames != nullptr &&
+ packet.retransmittable_frames->HasCryptoHandshake() == IS_HANDSHAKE) {
+ ++pending_crypto_packet_count_;
+ }
+ info = TransmissionInfo(packet.retransmittable_frames,
+ packet.sequence_number_length);
+ } else {
+ info = OnRetransmittedPacket(
+ old_sequence_number, sequence_number, transmission_type);
}
+ info.sent_time = sent_time;
+
+ largest_sent_packet_ = max(sequence_number, largest_sent_packet_);
+ if (set_in_flight) {
+ bytes_in_flight_ += bytes_sent;
+ info.bytes_sent = bytes_sent;
+ info.in_flight = true;
+ }
+ unacked_packets_.push_back(info);
}
void QuicUnackedPacketMap::RemoveObsoletePackets() {
@@ -65,29 +82,24 @@
}
}
-void QuicUnackedPacketMap::OnRetransmittedPacket(
+TransmissionInfo QuicUnackedPacketMap::OnRetransmittedPacket(
QuicPacketSequenceNumber old_sequence_number,
QuicPacketSequenceNumber new_sequence_number,
TransmissionType transmission_type) {
DCHECK_GE(old_sequence_number, least_unacked_);
DCHECK_LT(old_sequence_number, least_unacked_ + unacked_packets_.size());
DCHECK_GE(new_sequence_number, least_unacked_ + unacked_packets_.size());
- while (least_unacked_ + unacked_packets_.size() < new_sequence_number) {
- unacked_packets_.push_back(TransmissionInfo());
- unacked_packets_.back().is_unackable = true;
- }
+ DCHECK_NE(NOT_RETRANSMISSION, transmission_type);
// TODO(ianswett): Discard and lose the packet lazily instead of immediately.
TransmissionInfo* transmission_info =
&unacked_packets_.at(old_sequence_number - least_unacked_);
RetransmittableFrames* frames = transmission_info->retransmittable_frames;
+ transmission_info->retransmittable_frames = nullptr;
LOG_IF(DFATAL, frames == nullptr)
<< "Attempt to retransmit packet with no "
<< "retransmittable frames: " << old_sequence_number;
- // We keep the old packet in the unacked packet list until it, or one of
- // the retransmissions of it are acked.
- transmission_info->retransmittable_frames = nullptr;
// Only keep one transmission older than largest observed, because only the
// most recent is expected to possibly be a spurious retransmission.
while (transmission_info->all_transmissions != nullptr &&
@@ -118,12 +130,14 @@
}
transmission_info->all_transmissions->push_back(new_sequence_number);
}
- unacked_packets_.push_back(
+ TransmissionInfo info =
TransmissionInfo(frames,
transmission_info->sequence_number_length,
transmission_type,
- transmission_info->all_transmissions));
+ transmission_info->all_transmissions);
+ // Proactively remove obsolete packets so the least unacked can be raised.
RemoveObsoletePackets();
+ return info;
}
void QuicUnackedPacketMap::ClearAllPreviousRetransmissions() {
@@ -356,25 +370,6 @@
return least_unacked_;
}
-void QuicUnackedPacketMap::SetSent(QuicPacketSequenceNumber sequence_number,
- QuicTime sent_time,
- QuicByteCount bytes_sent,
- bool set_in_flight) {
- DCHECK_GE(sequence_number, least_unacked_);
- DCHECK_LT(sequence_number, least_unacked_ + unacked_packets_.size());
- TransmissionInfo* info = &unacked_packets_[sequence_number - least_unacked_];
- DCHECK(!info->in_flight);
-
- DCHECK_LT(largest_sent_packet_, sequence_number);
- largest_sent_packet_ = max(sequence_number, largest_sent_packet_);
- info->sent_time = sent_time;
- if (set_in_flight) {
- bytes_in_flight_ += bytes_sent;
- info->bytes_sent = bytes_sent;
- info->in_flight = true;
- }
-}
-
void QuicUnackedPacketMap::RestoreInFlight(
QuicPacketSequenceNumber sequence_number) {
DCHECK_GE(sequence_number, least_unacked_);
diff --git a/net/quic/quic_unacked_packet_map.h b/net/quic/quic_unacked_packet_map.h
index 9806ffc..6e437fb 100644
--- a/net/quic/quic_unacked_packet_map.h
+++ b/net/quic/quic_unacked_packet_map.h
@@ -20,16 +20,18 @@
QuicUnackedPacketMap();
~QuicUnackedPacketMap();
- // Adds |serialized_packet| to the map. Does not mark it in flight.
- void AddPacket(const SerializedPacket& serialized_packet);
-
- // Called when a packet is retransmitted with a new sequence number.
- // |old_sequence_number| will remain unacked, but will have no
- // retransmittable data associated with it. |new_sequence_number| will
- // be both unacked and associated with retransmittable data.
- void OnRetransmittedPacket(QuicPacketSequenceNumber old_sequence_number,
- QuicPacketSequenceNumber new_sequence_number,
- TransmissionType transmission_type);
+ // Adds |serialized_packet| to the map and marks it as sent at |sent_time|.
+ // Marks the packet as in flight if |set_in_flight| is true.
+ // Packets marked as in flight are expected to be marked as missing when they
+ // don't arrive, indicating the need for retransmission.
+ // |old_sequence_number| is the sequence number of the previous transmission,
+ // or 0 if there was none.
+ void AddSentPacket(const SerializedPacket& serialized_packet,
+ QuicPacketSequenceNumber old_sequence_number,
+ TransmissionType transmission_type,
+ QuicTime sent_time,
+ QuicByteCount bytes_sent,
+ bool set_in_flight);
// Returns true if the packet |sequence_number| is unacked.
bool IsUnacked(QuicPacketSequenceNumber sequence_number) const;
@@ -74,15 +76,6 @@
// been acked by the peer. If there are no unacked packets, returns 0.
QuicPacketSequenceNumber GetLeastUnacked() const;
- // Sets a packet as sent with the sent time |sent_time|. Marks the packet
- // as in flight if |set_in_flight| is true.
- // Packets marked as in flight are expected to be marked as missing when they
- // don't arrive, indicating the need for retransmission.
- void SetSent(QuicPacketSequenceNumber sequence_number,
- QuicTime sent_time,
- QuicByteCount bytes_sent,
- bool set_in_flight);
-
// Restores the in flight status for a packet that was previously sent.
void RestoreInFlight(QuicPacketSequenceNumber sequence_number);
@@ -137,6 +130,15 @@
void RemoveObsoletePackets();
private:
+ // Called when a packet is retransmitted with a new sequence number.
+ // |old_sequence_number| will remain unacked, but will have no
+ // retransmittable data associated with it. A transmission info will be
+ // created for |new_sequence_number| and returned.
+ TransmissionInfo OnRetransmittedPacket(
+ QuicPacketSequenceNumber old_sequence_number,
+ QuicPacketSequenceNumber new_sequence_number,
+ TransmissionType transmission_type);
+
void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info);
// Returns true if the packet no longer has a purpose in the map.
diff --git a/net/quic/quic_unacked_packet_map_test.cc b/net/quic/quic_unacked_packet_map_test.cc
index 4f5d6a5..d31ce44 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -101,8 +101,9 @@
TEST_F(QuicUnackedPacketMapTest, RttOnly) {
// Acks are only tracked for RTT measurement purposes.
- unacked_packets_.AddPacket(CreateNonRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultAckLength, false);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultAckLength,
+ false);
QuicPacketSequenceNumber unacked[] = { 1 };
VerifyUnackedPackets(unacked, arraysize(unacked));
@@ -120,8 +121,9 @@
// when more than 200 accumulate.
const size_t kNumUnackedPackets = 200;
for (size_t i = 1; i < 400; ++i) {
- unacked_packets_.AddPacket(CreateNonRetransmittablePacket(i));
- unacked_packets_.SetSent(i, now_, kDefaultAckLength, false);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(i), 0,
+ NOT_RETRANSMISSION, now_, kDefaultAckLength,
+ false);
unacked_packets_.RemoveObsoletePackets();
EXPECT_EQ(min(i, kNumUnackedPackets),
unacked_packets_.GetNumUnackedPacketsDebugOnly());
@@ -130,8 +132,9 @@
TEST_F(QuicUnackedPacketMapTest, RetransmittableInflightAndRtt) {
// Simulate a retransmittable packet being sent and acked.
- unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked[] = { 1 };
VerifyUnackedPackets(unacked, arraysize(unacked));
@@ -157,10 +160,12 @@
TEST_F(QuicUnackedPacketMapTest, RetransmittedPacket) {
// Simulate a retransmittable packet being sent, retransmitted, and the first
// transmission being acked.
- unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultLength, true);
- unacked_packets_.OnRetransmittedPacket(1, 2, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(2, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(2), 1,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked[] = { 1, 2 };
VerifyUnackedPackets(unacked, arraysize(unacked));
@@ -192,10 +197,12 @@
TEST_F(QuicUnackedPacketMapTest, RetransmitThreeTimes) {
// Simulate a retransmittable packet being sent and retransmitted twice.
- unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultLength, true);
- unacked_packets_.AddPacket(CreateRetransmittablePacket(2));
- unacked_packets_.SetSent(2, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(2), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked[] = { 1, 2 };
VerifyUnackedPackets(unacked, arraysize(unacked));
@@ -208,10 +215,12 @@
unacked_packets_.RemoveFromInFlight(2);
unacked_packets_.RemoveRetransmittability(2);
unacked_packets_.RemoveFromInFlight(1);
- unacked_packets_.OnRetransmittedPacket(1, 3, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(3, now_, kDefaultLength, true);
- unacked_packets_.AddPacket(CreateRetransmittablePacket(4));
- unacked_packets_.SetSent(4, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(3), 1,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(4), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked2[] = { 1, 3, 4 };
VerifyUnackedPackets(unacked2, arraysize(unacked2));
@@ -224,10 +233,12 @@
unacked_packets_.IncreaseLargestObserved(4);
unacked_packets_.RemoveFromInFlight(4);
unacked_packets_.RemoveRetransmittability(4);
- unacked_packets_.OnRetransmittedPacket(3, 5, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(5, now_, kDefaultLength, true);
- unacked_packets_.AddPacket(CreateRetransmittablePacket(6));
- unacked_packets_.SetSent(6, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(5), 3,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(6), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked3[] = { 3, 5, 6 };
VerifyUnackedPackets(unacked3, arraysize(unacked3));
@@ -240,8 +251,9 @@
unacked_packets_.IncreaseLargestObserved(6);
unacked_packets_.RemoveFromInFlight(6);
unacked_packets_.RemoveRetransmittability(6);
- unacked_packets_.OnRetransmittedPacket(5, 7, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(7, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(7), 5,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked4[] = { 3, 5, 7 };
VerifyUnackedPackets(unacked4, arraysize(unacked4));
@@ -266,10 +278,12 @@
TEST_F(QuicUnackedPacketMapTest, RetransmitFourTimes) {
// Simulate a retransmittable packet being sent and retransmitted twice.
- unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultLength, true);
- unacked_packets_.AddPacket(CreateRetransmittablePacket(2));
- unacked_packets_.SetSent(2, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(2), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked[] = { 1, 2 };
VerifyUnackedPackets(unacked, arraysize(unacked));
@@ -282,8 +296,9 @@
unacked_packets_.RemoveFromInFlight(2);
unacked_packets_.RemoveRetransmittability(2);
unacked_packets_.RemoveFromInFlight(1);
- unacked_packets_.OnRetransmittedPacket(1, 3, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(3, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(3), 1,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked2[] = { 1, 3 };
VerifyUnackedPackets(unacked2, arraysize(unacked2));
@@ -293,10 +308,12 @@
VerifyRetransmittablePackets(retransmittable2, arraysize(retransmittable2));
// TLP 3 (formerly 1) as 4, and don't remove 1 from unacked.
- unacked_packets_.OnRetransmittedPacket(3, 4, TLP_RETRANSMISSION);
- unacked_packets_.SetSent(4, now_, kDefaultLength, true);
- unacked_packets_.AddPacket(CreateRetransmittablePacket(5));
- unacked_packets_.SetSent(5, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(4), 3,
+ TLP_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(5), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked3[] = { 1, 3, 4, 5 };
VerifyUnackedPackets(unacked3, arraysize(unacked3));
@@ -311,8 +328,9 @@
unacked_packets_.RemoveRetransmittability(5);
unacked_packets_.RemoveFromInFlight(3);
unacked_packets_.RemoveFromInFlight(4);
- unacked_packets_.OnRetransmittedPacket(4, 6, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(6, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(6), 4,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked4[] = { 4, 6 };
VerifyUnackedPackets(unacked4, arraysize(unacked4));
@@ -325,11 +343,13 @@
TEST_F(QuicUnackedPacketMapTest, RestoreInflight) {
// Simulate a retransmittable packet being sent, retransmitted, and the first
// transmission being acked.
- unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultLength, true);
- unacked_packets_.OnRetransmittedPacket(1, 2, RTO_RETRANSMISSION);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
unacked_packets_.RemoveFromInFlight(1);
- unacked_packets_.SetSent(2, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(2), 1,
+ RTO_RETRANSMISSION, now_, kDefaultLength,
+ true);
QuicPacketSequenceNumber unacked[] = { 1, 2 };
VerifyUnackedPackets(unacked, arraysize(unacked));
@@ -349,12 +369,15 @@
TEST_F(QuicUnackedPacketMapTest, SendWithGap) {
// Simulate a retransmittable packet being sent, retransmitted, and the first
// transmission being acked.
- unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
- unacked_packets_.SetSent(1, now_, kDefaultLength, true);
- unacked_packets_.AddPacket(CreateRetransmittablePacket(3));
- unacked_packets_.SetSent(3, now_, kDefaultLength, true);
- unacked_packets_.OnRetransmittedPacket(1, 5, LOSS_RETRANSMISSION);
- unacked_packets_.SetSent(5, now_, kDefaultLength, true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(1), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateRetransmittablePacket(3), 0,
+ NOT_RETRANSMISSION, now_, kDefaultLength,
+ true);
+ unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(5), 3,
+ LOSS_RETRANSMISSION, now_, kDefaultLength,
+ true);
EXPECT_EQ(1u, unacked_packets_.GetLeastUnacked());
EXPECT_TRUE(unacked_packets_.IsUnacked(1));
diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc
index a65203b..7db9a57 100644
--- a/net/quic/reliable_quic_stream.cc
+++ b/net/quic/reliable_quic_stream.cc
@@ -76,12 +76,11 @@
num_retransmitted_bytes_(0) {
}
- virtual void OnAckNotification(int num_original_packets,
- int num_original_bytes,
- int num_retransmitted_packets,
- int num_retransmitted_bytes,
- QuicTime::Delta delta_largest_observed)
- override {
+ void OnAckNotification(int num_original_packets,
+ int num_original_bytes,
+ int num_retransmitted_packets,
+ int num_retransmitted_bytes,
+ QuicTime::Delta delta_largest_observed) override {
DCHECK_LT(0, pending_acks_);
--pending_acks_;
num_original_packets_ += num_original_packets;
@@ -106,8 +105,7 @@
protected:
// Delegates are ref counted.
- virtual ~ProxyAckNotifierDelegate() override {
- }
+ ~ProxyAckNotifierDelegate() override {}
private:
// Original delegate. delegate_->OnAckNotification will be called when:
diff --git a/net/quic/reliable_quic_stream_test.cc b/net/quic/reliable_quic_stream_test.cc
index 713d0e3..d63a5d8 100644
--- a/net/quic/reliable_quic_stream_test.cc
+++ b/net/quic/reliable_quic_stream_test.cc
@@ -48,14 +48,14 @@
: ReliableQuicStream(id, session),
should_process_data_(should_process_data) {}
- virtual uint32 ProcessRawData(const char* data, uint32 data_len) override {
+ uint32 ProcessRawData(const char* data, uint32 data_len) override {
EXPECT_NE(0u, data_len);
DVLOG(1) << "ProcessData data_len: " << data_len;
data_ += string(data, data_len);
return should_process_data_ ? data_len : 0;
}
- virtual QuicPriority EffectivePriority() const override {
+ QuicPriority EffectivePriority() const override {
return QuicUtils::HighestPriority();
}
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index 9f4dc8b..814be7b 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -41,10 +41,9 @@
: error_(false) {
}
- virtual void OnError(CryptoFramer* framer) override { error_ = true; }
+ void OnError(CryptoFramer* framer) override { error_ = true; }
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override {
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override {
messages_.push_back(message);
}
@@ -137,13 +136,12 @@
// Takes ownership of |sync_source|, a synchronous ChannelIDSource.
explicit AsyncTestChannelIDSource(ChannelIDSource* sync_source)
: sync_source_(sync_source) {}
- virtual ~AsyncTestChannelIDSource() {}
+ ~AsyncTestChannelIDSource() override {}
// ChannelIDSource implementation.
- virtual QuicAsyncStatus GetChannelIDKey(
- const string& hostname,
- scoped_ptr<ChannelIDKey>* channel_id_key,
- ChannelIDSourceCallback* callback) override {
+ QuicAsyncStatus GetChannelIDKey(const string& hostname,
+ scoped_ptr<ChannelIDKey>* channel_id_key,
+ ChannelIDSourceCallback* callback) override {
// Synchronous mode.
if (!callback) {
return sync_source_->GetChannelIDKey(hostname, channel_id_key, nullptr);
@@ -160,7 +158,7 @@
}
// CallbackSource implementation.
- virtual void RunPendingCallbacks() override {
+ void RunPendingCallbacks() override {
if (callback_.get()) {
callback_->Run(&channel_id_key_);
callback_.reset();
@@ -353,22 +351,22 @@
index_(index) {
}
- virtual StringPiece GetCommonHashes() const override {
+ StringPiece GetCommonHashes() const override {
CHECK(false) << "not implemented";
return StringPiece();
}
- virtual StringPiece GetCert(uint64 hash, uint32 index) const override {
+ StringPiece GetCert(uint64 hash, uint32 index) const override {
if (hash == hash_ && index == index_) {
return cert_;
}
return StringPiece();
}
- virtual bool MatchCert(StringPiece cert,
- StringPiece common_set_hashes,
- uint64* out_hash,
- uint32* out_index) const override {
+ bool MatchCert(StringPiece cert,
+ StringPiece common_set_hashes,
+ uint64* out_hash,
+ uint32* out_index) const override {
if (cert != cert_) {
return false;
}
diff --git a/net/quic/test_tools/crypto_test_utils_chromium.cc b/net/quic/test_tools/crypto_test_utils_chromium.cc
index d5edc6c..0f0f83f 100644
--- a/net/quic/test_tools/crypto_test_utils_chromium.cc
+++ b/net/quic/test_tools/crypto_test_utils_chromium.cc
@@ -34,7 +34,7 @@
ImportCertFromFile(GetTestCertsDirectory(), cert_file);
scoped_root_.Reset(root_cert.get());
}
- virtual ~TestProofVerifierChromium() {}
+ ~TestProofVerifierChromium() override {}
private:
ScopedTestRoot scoped_root_;
@@ -52,14 +52,14 @@
certs_[0] = kLeafCert;
certs_[1] = kIntermediateCert;
}
- virtual ~FakeProofSource() {}
+ ~FakeProofSource() override {}
// ProofSource interface
- virtual bool GetProof(const std::string& hostname,
- const std::string& server_config,
- bool ecdsa_ok,
- const std::vector<std::string>** out_certs,
- std::string* out_signature) override {
+ bool GetProof(const std::string& hostname,
+ const std::string& server_config,
+ bool ecdsa_ok,
+ const std::vector<std::string>** out_certs,
+ std::string* out_signature) override {
*out_certs = &certs_;
*out_signature = kSignature;
return true;
@@ -73,18 +73,17 @@
class FakeProofVerifier : public ProofVerifier {
public:
FakeProofVerifier() {}
- virtual ~FakeProofVerifier() {}
+ ~FakeProofVerifier() override {}
// ProofVerifier interface
- virtual QuicAsyncStatus VerifyProof(
- const std::string& hostname,
- const std::string& server_config,
- const std::vector<std::string>& certs,
- const std::string& signature,
- const ProofVerifyContext* verify_context,
- std::string* error_details,
- scoped_ptr<ProofVerifyDetails>* verify_details,
- ProofVerifierCallback* callback) override {
+ QuicAsyncStatus VerifyProof(const std::string& hostname,
+ const std::string& server_config,
+ const std::vector<std::string>& certs,
+ const std::string& signature,
+ const ProofVerifyContext* verify_context,
+ std::string* error_details,
+ scoped_ptr<ProofVerifyDetails>* verify_details,
+ ProofVerifierCallback* callback) override {
error_details->clear();
scoped_ptr<ProofVerifyDetailsChromium> verify_details_chromium(
new ProofVerifyDetailsChromium);
diff --git a/net/quic/test_tools/crypto_test_utils_openssl.cc b/net/quic/test_tools/crypto_test_utils_openssl.cc
index 4db57b5..39b48a5 100644
--- a/net/quic/test_tools/crypto_test_utils_openssl.cc
+++ b/net/quic/test_tools/crypto_test_utils_openssl.cc
@@ -26,12 +26,11 @@
class TestChannelIDKey : public ChannelIDKey {
public:
explicit TestChannelIDKey(EVP_PKEY* ecdsa_key) : ecdsa_key_(ecdsa_key) {}
- virtual ~TestChannelIDKey() override {}
+ ~TestChannelIDKey() override {}
// ChannelIDKey implementation.
- virtual bool Sign(StringPiece signed_data,
- string* out_signature) const override {
+ bool Sign(StringPiece signed_data, string* out_signature) const override {
crypto::ScopedEVP_MD_CTX md_ctx(EVP_MD_CTX_create());
if (!md_ctx ||
EVP_DigestSignInit(md_ctx.get(), nullptr, EVP_sha256(), nullptr,
@@ -75,7 +74,7 @@
return true;
}
- virtual string SerializeKey() const override {
+ string SerializeKey() const override {
// i2d_PublicKey will produce an ANSI X9.62 public key which, for a P-256
// key, is 0x04 (meaning uncompressed) followed by the x and y field
// elements as 32-byte, big-endian numbers.
@@ -99,11 +98,11 @@
class TestChannelIDSource : public ChannelIDSource {
public:
- virtual ~TestChannelIDSource() {}
+ ~TestChannelIDSource() override {}
// ChannelIDSource implementation.
- virtual QuicAsyncStatus GetChannelIDKey(
+ QuicAsyncStatus GetChannelIDKey(
const string& hostname,
scoped_ptr<ChannelIDKey>* channel_id_key,
ChannelIDSourceCallback* /*callback*/) override {
diff --git a/net/quic/test_tools/delayed_verify_strike_register_client.h b/net/quic/test_tools/delayed_verify_strike_register_client.h
index 479647b..6d5002b 100644
--- a/net/quic/test_tools/delayed_verify_strike_register_client.h
+++ b/net/quic/test_tools/delayed_verify_strike_register_client.h
@@ -23,11 +23,11 @@
uint32 window_secs,
const uint8 orbit[8],
StrikeRegister::StartupType startup);
- virtual ~DelayedVerifyStrikeRegisterClient();
+ ~DelayedVerifyStrikeRegisterClient() override;
- virtual void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
- QuicWallTime now,
- ResultCallback* cb) override;
+ void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
+ QuicWallTime now,
+ ResultCallback* cb) override;
// Start queueing verifications instead of executing them immediately.
void StartDelayingVerification() {
diff --git a/net/quic/test_tools/mock_clock.h b/net/quic/test_tools/mock_clock.h
index 4a2a28c..30c76dd 100644
--- a/net/quic/test_tools/mock_clock.h
+++ b/net/quic/test_tools/mock_clock.h
@@ -16,15 +16,15 @@
class MockClock : public QuicClock {
public:
MockClock();
- virtual ~MockClock();
+ ~MockClock() override;
void AdvanceTime(QuicTime::Delta delta);
- virtual QuicTime Now() const override;
+ QuicTime Now() const override;
- virtual QuicTime ApproximateNow() const override;
+ QuicTime ApproximateNow() const override;
- virtual QuicWallTime WallNow() const override;
+ QuicWallTime WallNow() const override;
base::TimeTicks NowInTicks() const;
diff --git a/net/quic/test_tools/mock_crypto_client_stream.h b/net/quic/test_tools/mock_crypto_client_stream.h
index 10803e8..636314a 100644
--- a/net/quic/test_tools/mock_crypto_client_stream.h
+++ b/net/quic/test_tools/mock_crypto_client_stream.h
@@ -42,14 +42,13 @@
QuicCryptoClientConfig* crypto_config,
HandshakeMode handshake_mode,
const ProofVerifyDetails* proof_verify_details_);
- virtual ~MockCryptoClientStream();
+ ~MockCryptoClientStream() override;
// CryptoFramerVisitorInterface implementation.
- virtual void OnHandshakeMessage(
- const CryptoHandshakeMessage& message) override;
+ void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
// QuicCryptoClientStream implementation.
- virtual bool CryptoConnect() override;
+ bool CryptoConnect() override;
// Invokes the sessions's CryptoHandshakeEvent method with the specified
// event.
diff --git a/net/quic/test_tools/mock_crypto_client_stream_factory.h b/net/quic/test_tools/mock_crypto_client_stream_factory.h
index 5add188..b138c70 100644
--- a/net/quic/test_tools/mock_crypto_client_stream_factory.h
+++ b/net/quic/test_tools/mock_crypto_client_stream_factory.h
@@ -18,9 +18,9 @@
class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory {
public:
MockCryptoClientStreamFactory();
- virtual ~MockCryptoClientStreamFactory() {}
+ ~MockCryptoClientStreamFactory() override {}
- virtual QuicCryptoClientStream* CreateQuicCryptoClientStream(
+ QuicCryptoClientStream* CreateQuicCryptoClientStream(
const QuicServerId& server_id,
QuicClientSession* session,
QuicCryptoClientConfig* crypto_config) override;
diff --git a/net/quic/test_tools/mock_random.h b/net/quic/test_tools/mock_random.h
index b04f170..44f9426 100644
--- a/net/quic/test_tools/mock_random.h
+++ b/net/quic/test_tools/mock_random.h
@@ -18,12 +18,11 @@
// QuicRandom:
// Fills the |data| buffer with a repeating byte, initially 'r'.
- virtual void RandBytes(void* data, size_t len) override;
+ void RandBytes(void* data, size_t len) override;
// Returns base + the current increment.
- virtual uint64 RandUint64() override;
+ uint64 RandUint64() override;
// Does nothing.
- virtual void Reseed(const void* additional_entropy,
- size_t entropy_len) override;
+ void Reseed(const void* additional_entropy, size_t entropy_len) override;
// ChangeValue increments |increment_|. This causes the value returned by
// |RandUint64| and the byte that |RandBytes| fills with, to change.
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 6cdd02a..7835e40 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -37,8 +37,8 @@
: QuicAlarm(delegate) {
}
- virtual void SetImpl() override {}
- virtual void CancelImpl() override {}
+ void SetImpl() override {}
+ void CancelImpl() override {}
};
} // namespace
@@ -226,10 +226,9 @@
: public QuicConnection::PacketWriterFactory {
public:
NiceMockPacketWriterFactory() {}
- virtual ~NiceMockPacketWriterFactory() {}
+ ~NiceMockPacketWriterFactory() override {}
- virtual QuicPacketWriter* Create(
- QuicConnection* /*connection*/) const override {
+ QuicPacketWriter* Create(QuicConnection* /*connection*/) const override {
return new testing::NiceMock<MockPacketWriter>();
}
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h
index f009641..99a5ae5 100644
--- a/net/quic/test_tools/quic_test_utils.h
+++ b/net/quic/test_tools/quic_test_utils.h
@@ -190,35 +190,32 @@
public:
NoOpFramerVisitor() {}
- virtual void OnError(QuicFramer* framer) override {}
- virtual void OnPacket() override {}
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) override {}
- virtual void OnVersionNegotiationPacket(
+ void OnError(QuicFramer* framer) override {}
+ void OnPacket() override {}
+ void OnPublicResetPacket(const QuicPublicResetPacket& packet) override {}
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& packet) override {}
- virtual void OnRevivedPacket() override {}
- virtual bool OnProtocolVersionMismatch(QuicVersion version) override;
- virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
- virtual bool OnUnauthenticatedPublicHeader(
+ void OnRevivedPacket() override {}
+ bool OnProtocolVersionMismatch(QuicVersion version) override;
+ bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
+ bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) override;
- virtual void OnDecryptedPacket(EncryptionLevel level) override {}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) override;
- virtual void OnFecProtectedPayload(base::StringPiece payload) override {}
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) override;
- virtual bool OnAckFrame(const QuicAckFrame& frame) override;
- virtual bool OnCongestionFeedbackFrame(
+ void OnDecryptedPacket(EncryptionLevel level) override {}
+ bool OnPacketHeader(const QuicPacketHeader& header) override;
+ void OnFecProtectedPayload(base::StringPiece payload) override {}
+ bool OnStreamFrame(const QuicStreamFrame& frame) override;
+ bool OnAckFrame(const QuicAckFrame& frame) override;
+ bool OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& frame) override;
- virtual bool OnStopWaitingFrame(
- const QuicStopWaitingFrame& frame) override;
- virtual bool OnPingFrame(const QuicPingFrame& frame) override;
- virtual void OnFecData(const QuicFecData& fec) override {}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
- virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) override;
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
- virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override;
- virtual void OnPacketComplete() override {}
+ bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override;
+ bool OnPingFrame(const QuicPingFrame& frame) override;
+ void OnFecData(const QuicFecData& fec) override {}
+ bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override;
+ bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override;
+ bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
+ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
+ bool OnBlockedFrame(const QuicBlockedFrame& frame) override;
+ void OnPacketComplete() override {}
private:
DISALLOW_COPY_AND_ASSIGN(NoOpFramerVisitor);
@@ -254,10 +251,10 @@
class MockHelper : public QuicConnectionHelperInterface {
public:
MockHelper();
- virtual ~MockHelper();
- virtual const QuicClock* GetClock() const override;
- virtual QuicRandom* GetRandomGenerator() override;
- virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
+ ~MockHelper() override;
+ const QuicClock* GetClock() const override;
+ QuicRandom* GetRandomGenerator() override;
+ QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override;
void AdvanceTime(QuicTime::Delta delta);
private:
@@ -329,9 +326,9 @@
PacketSavingConnection(bool is_server,
const QuicVersionVector& supported_versions);
- virtual ~PacketSavingConnection();
+ ~PacketSavingConnection() override;
- virtual void SendOrQueuePacket(QueuedPacket packet) override;
+ void SendOrQueuePacket(QueuedPacket packet) override;
std::vector<QuicPacket*> packets_;
std::vector<QuicEncryptedPacket*> encrypted_packets_;
@@ -458,6 +455,7 @@
QuicTime::Delta(QuicTime now,
QuicByteCount bytes_in_flight,
HasRetransmittableData));
+ MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void));
MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void));
MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool());
MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber));
@@ -493,9 +491,9 @@
public QuicReceivedEntropyHashCalculatorInterface {
public:
TestEntropyCalculator();
- virtual ~TestEntropyCalculator();
+ ~TestEntropyCalculator() override;
- virtual QuicPacketEntropyHash EntropyHash(
+ QuicPacketEntropyHash EntropyHash(
QuicPacketSequenceNumber sequence_number) const override;
private:
@@ -551,10 +549,10 @@
class TestWriterFactory : public QuicDispatcher::PacketWriterFactory {
public:
TestWriterFactory();
- virtual ~TestWriterFactory();
+ ~TestWriterFactory() override;
- virtual QuicPacketWriter* Create(QuicServerPacketWriter* writer,
- QuicConnection* connection) override;
+ QuicPacketWriter* Create(QuicServerPacketWriter* writer,
+ QuicConnection* connection) override;
// Calls OnPacketSent on the last QuicConnection to write through one of the
// packet writers created by this factory.
@@ -566,13 +564,12 @@
PerConnectionPacketWriter(TestWriterFactory* factory,
QuicServerPacketWriter* writer,
QuicConnection* connection);
- virtual ~PerConnectionPacketWriter();
+ ~PerConnectionPacketWriter() override;
- virtual WriteResult WritePacket(
- const char* buffer,
- size_t buf_len,
- const IPAddressNumber& self_address,
- const IPEndPoint& peer_address) override;
+ WriteResult WritePacket(const char* buffer,
+ size_t buf_len,
+ const IPAddressNumber& self_address,
+ const IPEndPoint& peer_address) override;
private:
TestWriterFactory* factory_;
diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc
index 6999cf5..0f413d7 100644
--- a/net/quic/test_tools/simple_quic_framer.cc
+++ b/net/quic/test_tools/simple_quic_framer.cc
@@ -22,48 +22,40 @@
: error_(QUIC_NO_ERROR) {
}
- virtual ~SimpleFramerVisitor() override {
- STLDeleteElements(&stream_data_);
- }
+ ~SimpleFramerVisitor() override { STLDeleteElements(&stream_data_); }
- virtual void OnError(QuicFramer* framer) override {
- error_ = framer->error();
- }
+ void OnError(QuicFramer* framer) override { error_ = framer->error(); }
- virtual bool OnProtocolVersionMismatch(QuicVersion version) override {
- return false;
- }
+ bool OnProtocolVersionMismatch(QuicVersion version) override { return false; }
- virtual void OnPacket() override {}
- virtual void OnPublicResetPacket(
- const QuicPublicResetPacket& packet) override {
+ void OnPacket() override {}
+ void OnPublicResetPacket(const QuicPublicResetPacket& packet) override {
public_reset_packet_.reset(new QuicPublicResetPacket(packet));
}
- virtual void OnVersionNegotiationPacket(
+ void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& packet) override {
version_negotiation_packet_.reset(
new QuicVersionNegotiationPacket(packet));
}
- virtual void OnRevivedPacket() override {}
+ void OnRevivedPacket() override {}
- virtual bool OnUnauthenticatedPublicHeader(
+ bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) override {
return true;
}
- virtual bool OnUnauthenticatedHeader(
- const QuicPacketHeader& header) override {
+ bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override {
return true;
}
- virtual void OnDecryptedPacket(EncryptionLevel level) override {}
- virtual bool OnPacketHeader(const QuicPacketHeader& header) override {
+ void OnDecryptedPacket(EncryptionLevel level) override {}
+ bool OnPacketHeader(const QuicPacketHeader& header) override {
has_header_ = true;
header_ = header;
return true;
}
- virtual void OnFecProtectedPayload(StringPiece payload) override {}
+ void OnFecProtectedPayload(StringPiece payload) override {}
- virtual bool OnStreamFrame(const QuicStreamFrame& frame) override {
+ bool OnStreamFrame(const QuicStreamFrame& frame) override {
// Save a copy of the data so it is valid after the packet is processed.
stream_data_.push_back(frame.GetDataAsString());
QuicStreamFrame stream_frame(frame);
@@ -75,61 +67,59 @@
return true;
}
- virtual bool OnAckFrame(const QuicAckFrame& frame) override {
+ bool OnAckFrame(const QuicAckFrame& frame) override {
ack_frames_.push_back(frame);
return true;
}
- virtual bool OnCongestionFeedbackFrame(
+ bool OnCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& frame) override {
feedback_frames_.push_back(frame);
return true;
}
- virtual bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override {
+ bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override {
stop_waiting_frames_.push_back(frame);
return true;
}
- virtual bool OnPingFrame(const QuicPingFrame& frame) override {
+ bool OnPingFrame(const QuicPingFrame& frame) override {
ping_frames_.push_back(frame);
return true;
}
- virtual void OnFecData(const QuicFecData& fec) override {
+ void OnFecData(const QuicFecData& fec) override {
fec_data_ = fec;
fec_redundancy_ = fec_data_.redundancy.as_string();
fec_data_.redundancy = fec_redundancy_;
}
- virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override {
+ bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override {
rst_stream_frames_.push_back(frame);
return true;
}
- virtual bool OnConnectionCloseFrame(
- const QuicConnectionCloseFrame& frame) override {
+ bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override {
connection_close_frames_.push_back(frame);
return true;
}
- virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override {
+ bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override {
goaway_frames_.push_back(frame);
return true;
}
- virtual bool OnWindowUpdateFrame(
- const QuicWindowUpdateFrame& frame) override {
+ bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override {
window_update_frames_.push_back(frame);
return true;
}
- virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
+ bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
blocked_frames_.push_back(frame);
return true;
}
- virtual void OnPacketComplete() override {}
+ void OnPacketComplete() override {}
const QuicPacketHeader& header() const { return header_; }
const vector<QuicAckFrame>& ack_frames() const { return ack_frames_; }
diff --git a/net/quic/test_tools/test_task_runner.h b/net/quic/test_tools/test_task_runner.h
index ea6793f..69a1bcb 100644
--- a/net/quic/test_tools/test_task_runner.h
+++ b/net/quic/test_tools/test_task_runner.h
@@ -26,17 +26,17 @@
explicit TestTaskRunner(MockClock* clock);
// base::TaskRunner implementation.
- virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) override;
- virtual bool RunsTasksOnCurrentThread() const override;
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
+ bool RunsTasksOnCurrentThread() const override;
const std::vector<PostedTask>& GetPostedTasks() const;
void RunNextTask();
protected:
- virtual ~TestTaskRunner();
+ ~TestTaskRunner() override;
private:
std::vector<PostedTask>::iterator FindNextTask();
diff --git a/net/server/http_connection.h b/net/server/http_connection.h
index c7225e1..8163ced 100644
--- a/net/server/http_connection.h
+++ b/net/server/http_connection.h
@@ -59,7 +59,7 @@
}
private:
- virtual ~ReadIOBuffer();
+ ~ReadIOBuffer() override;
scoped_refptr<GrowableIOBuffer> base_;
int max_buffer_size_;
@@ -101,7 +101,7 @@
}
private:
- virtual ~QueuedWriteIOBuffer();
+ ~QueuedWriteIOBuffer() override;
std::queue<std::string> pending_data_;
int total_size_;
diff --git a/net/server/http_server_unittest.cc b/net/server/http_server_unittest.cc
index be0e271..5da2c0f 100644
--- a/net/server/http_server_unittest.cc
+++ b/net/server/http_server_unittest.cc
@@ -189,26 +189,25 @@
ASSERT_EQ(OK, server_->GetLocalAddress(&server_address_));
}
- virtual void OnConnect(int connection_id) override {}
+ void OnConnect(int connection_id) override {}
- virtual void OnHttpRequest(int connection_id,
- const HttpServerRequestInfo& info) override {
+ void OnHttpRequest(int connection_id,
+ const HttpServerRequestInfo& info) override {
requests_.push_back(std::make_pair(info, connection_id));
if (requests_.size() == quit_after_request_count_)
run_loop_quit_func_.Run();
}
- virtual void OnWebSocketRequest(int connection_id,
- const HttpServerRequestInfo& info) override {
+ void OnWebSocketRequest(int connection_id,
+ const HttpServerRequestInfo& info) override {
NOTREACHED();
}
- virtual void OnWebSocketMessage(int connection_id,
- const std::string& data) override {
+ void OnWebSocketMessage(int connection_id, const std::string& data) override {
NOTREACHED();
}
- virtual void OnClose(int connection_id) override {}
+ void OnClose(int connection_id) override {}
bool RunUntilRequestsReceived(size_t count) {
quit_after_request_count_ = count;
@@ -248,18 +247,17 @@
namespace {
class WebSocketTest : public HttpServerTest {
- virtual void OnHttpRequest(int connection_id,
- const HttpServerRequestInfo& info) override {
+ void OnHttpRequest(int connection_id,
+ const HttpServerRequestInfo& info) override {
NOTREACHED();
}
- virtual void OnWebSocketRequest(int connection_id,
- const HttpServerRequestInfo& info) override {
+ void OnWebSocketRequest(int connection_id,
+ const HttpServerRequestInfo& info) override {
HttpServerTest::OnHttpRequest(connection_id, info);
}
- virtual void OnWebSocketMessage(int connection_id,
- const std::string& data) override {
+ void OnWebSocketMessage(int connection_id, const std::string& data) override {
}
};
@@ -407,9 +405,9 @@
public:
TestURLFetcherDelegate(const base::Closure& quit_loop_func)
: quit_loop_func_(quit_loop_func) {}
- virtual ~TestURLFetcherDelegate() {}
+ ~TestURLFetcherDelegate() override {}
- virtual void OnURLFetchComplete(const URLFetcher* source) override {
+ void OnURLFetchComplete(const URLFetcher* source) override {
EXPECT_EQ(HTTP_INTERNAL_SERVER_ERROR, source->GetResponseCode());
quit_loop_func_.Run();
}
@@ -473,10 +471,10 @@
read_buf_len_(0) {}
// StreamSocket
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual void Disconnect() override {
+ void Disconnect() override {
connected_ = false;
if (!read_callback_.is_null()) {
read_buf_ = NULL;
@@ -484,28 +482,27 @@
base::ResetAndReturn(&read_callback_).Run(ERR_CONNECTION_CLOSED);
}
}
- virtual bool IsConnected() const override { return connected_; }
- virtual bool IsConnectedAndIdle() const override { return IsConnected(); }
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ bool IsConnected() const override { return connected_; }
+ bool IsConnectedAndIdle() const override { return IsConnected(); }
+ int GetPeerAddress(IPEndPoint* address) const override {
return ERR_NOT_IMPLEMENTED;
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
return ERR_NOT_IMPLEMENTED;
}
- virtual const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const override { return true; }
- virtual bool UsingTCPFastOpen() const override { return false; }
- virtual bool WasNpnNegotiated() const override { return false; }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
+ const BoundNetLog& NetLog() const override { return net_log_; }
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
+ bool WasEverUsed() const override { return true; }
+ bool UsingTCPFastOpen() const override { return false; }
+ bool WasNpnNegotiated() const override { return false; }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
if (!connected_) {
return ERR_SOCKET_NOT_CONNECTED;
}
@@ -522,16 +519,13 @@
pending_read_data_.erase(0, read_len);
return read_len;
}
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_NOT_IMPLEMENTED;
}
- virtual int SetReceiveBufferSize(int32 size) override {
- return ERR_NOT_IMPLEMENTED;
- }
- virtual int SetSendBufferSize(int32 size) override {
- return ERR_NOT_IMPLEMENTED;
- }
+ int SetReceiveBufferSize(int32 size) override { return ERR_NOT_IMPLEMENTED; }
+ int SetSendBufferSize(int32 size) override { return ERR_NOT_IMPLEMENTED; }
void DidRead(const char* data, int data_len) {
if (!read_buf_.get()) {
@@ -547,7 +541,7 @@
}
private:
- virtual ~MockStreamSocket() {}
+ ~MockStreamSocket() override {}
bool connected_;
scoped_refptr<IOBuffer> read_buf_;
@@ -621,7 +615,7 @@
class CloseOnConnectHttpServerTest : public HttpServerTest {
public:
- virtual void OnConnect(int connection_id) override {
+ void OnConnect(int connection_id) override {
connection_ids_.push_back(connection_id);
server_->Close(connection_id);
}
diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc
index 118cdf8..d67ecb6 100644
--- a/net/server/web_socket.cc
+++ b/net/server/web_socket.cc
@@ -54,7 +54,7 @@
return new WebSocketHixie76(server, connection, request, pos);
}
- virtual void Accept(const HttpServerRequestInfo& request) override {
+ void Accept(const HttpServerRequestInfo& request) override {
std::string key1 = request.GetHeaderValue("sec-websocket-key1");
std::string key2 = request.GetHeaderValue("sec-websocket-key2");
@@ -86,7 +86,7 @@
std::string(reinterpret_cast<char*>(digest.a), 16));
}
- virtual ParseResult Read(std::string* message) override {
+ ParseResult Read(std::string* message) override {
DCHECK(message);
HttpConnection::ReadIOBuffer* read_buf = connection_->read_buf();
if (read_buf->StartOfBuffer()[0])
@@ -103,7 +103,7 @@
return FRAME_OK;
}
- virtual void Send(const std::string& message) override {
+ void Send(const std::string& message) override {
char message_start = 0;
char message_end = -1;
server_->SendRaw(connection_->id(), std::string(1, message_start));
@@ -199,7 +199,7 @@
return new WebSocketHybi17(server, connection, request, pos);
}
- virtual void Accept(const HttpServerRequestInfo& request) override {
+ void Accept(const HttpServerRequestInfo& request) override {
static const char* const kWebSocketGuid =
"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
std::string key = request.GetHeaderValue("sec-websocket-key");
@@ -217,7 +217,7 @@
encoded_hash.c_str()));
}
- virtual ParseResult Read(std::string* message) override {
+ ParseResult Read(std::string* message) override {
HttpConnection::ReadIOBuffer* read_buf = connection_->read_buf();
base::StringPiece frame(read_buf->StartOfBuffer(), read_buf->GetSize());
int bytes_consumed = 0;
@@ -230,7 +230,7 @@
return result;
}
- virtual void Send(const std::string& message) override {
+ void Send(const std::string& message) override {
if (closed_)
return;
server_->SendRaw(connection_->id(),
diff --git a/net/socket/client_socket_factory.cc b/net/socket/client_socket_factory.cc
index f372aff..51aea71 100644
--- a/net/socket/client_socket_factory.cc
+++ b/net/socket/client_socket_factory.cc
@@ -50,24 +50,24 @@
CertDatabase::GetInstance()->AddObserver(this);
}
- virtual ~DefaultClientSocketFactory() {
+ ~DefaultClientSocketFactory() override {
// Note: This code never runs, as the factory is defined as a Leaky
// singleton.
CertDatabase::GetInstance()->RemoveObserver(this);
}
- virtual void OnCertAdded(const X509Certificate* cert) override {
+ void OnCertAdded(const X509Certificate* cert) override {
ClearSSLSessionCache();
}
- virtual void OnCACertChanged(const X509Certificate* cert) override {
+ void OnCACertChanged(const X509Certificate* cert) override {
// Per wtc, we actually only need to flush when trust is reduced.
// Always flush now because OnCACertChanged does not tell us this.
// See comments in ClientSocketPoolManager::OnCACertChanged.
ClearSSLSessionCache();
}
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
@@ -76,7 +76,7 @@
new UDPClientSocket(bind_type, rand_int_cb, net_log, source));
}
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
const NetLog::Source& source) override {
@@ -84,7 +84,7 @@
new TCPClientSocket(addresses, net_log, source));
}
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
@@ -120,9 +120,7 @@
#endif
}
- virtual void ClearSSLSessionCache() override {
- SSLClientSocket::ClearSessionCache();
- }
+ void ClearSSLSessionCache() override { SSLClientSocket::ClearSessionCache(); }
private:
scoped_refptr<base::SequencedWorkerPool> worker_pool_;
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h
index 715cddb..2a2be36 100644
--- a/net/socket/client_socket_pool.h
+++ b/net/socket/client_socket_pool.h
@@ -182,7 +182,7 @@
protected:
ClientSocketPool();
- virtual ~ClientSocketPool();
+ ~ClientSocketPool() override;
// Return the connection timeout for this pool.
virtual base::TimeDelta ConnectionTimeout() const = 0;
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 0378c99..ec4e33c 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -219,7 +219,7 @@
base::TimeDelta used_idle_socket_timeout,
ConnectJobFactory* connect_job_factory);
- virtual ~ClientSocketPoolBaseHelper();
+ ~ClientSocketPoolBaseHelper() override;
// Adds a lower layered pool to |this|, and adds |this| as a higher layered
// pool on top of |lower_pool|.
@@ -327,10 +327,10 @@
void EnableConnectBackupJobs();
// ConnectJob::Delegate methods:
- virtual void OnConnectJobComplete(int result, ConnectJob* job) override;
+ void OnConnectJobComplete(int result, ConnectJob* job) override;
// NetworkChangeNotifier::IPAddressObserver methods:
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
private:
friend class base::RefCounted<ClientSocketPoolBaseHelper>;
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index 3cafc89..e2666fb 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -128,9 +128,9 @@
}
// Socket implementation.
- virtual int Read(
- IOBuffer* /* buf */, int len,
- const CompletionCallback& /* callback */) override {
+ int Read(IOBuffer* /* buf */,
+ int len,
+ const CompletionCallback& /* callback */) override {
if (has_unread_data_ && len > 0) {
has_unread_data_ = false;
was_used_to_convey_data_ = true;
@@ -139,54 +139,44 @@
return ERR_UNEXPECTED;
}
- virtual int Write(
- IOBuffer* /* buf */, int len,
- const CompletionCallback& /* callback */) override {
+ int Write(IOBuffer* /* buf */,
+ int len,
+ const CompletionCallback& /* callback */) override {
was_used_to_convey_data_ = true;
return len;
}
- virtual int SetReceiveBufferSize(int32 size) override { return OK; }
- virtual int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32 size) override { return OK; }
+ int SetSendBufferSize(int32 size) override { return OK; }
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
connected_ = true;
return OK;
}
- virtual void Disconnect() override { connected_ = false; }
- virtual bool IsConnected() const override { return connected_; }
- virtual bool IsConnectedAndIdle() const override {
+ void Disconnect() override { connected_ = false; }
+ bool IsConnected() const override { return connected_; }
+ bool IsConnectedAndIdle() const override {
return connected_ && !has_unread_data_;
}
- virtual int GetPeerAddress(IPEndPoint* /* address */) const override {
+ int GetPeerAddress(IPEndPoint* /* address */) const override {
return ERR_UNEXPECTED;
}
- virtual int GetLocalAddress(IPEndPoint* /* address */) const override {
+ int GetLocalAddress(IPEndPoint* /* address */) const override {
return ERR_UNEXPECTED;
}
- virtual const BoundNetLog& NetLog() const override {
- return net_log_;
- }
+ const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const override {
- return was_used_to_convey_data_;
- }
- virtual bool UsingTCPFastOpen() const override { return false; }
- virtual bool WasNpnNegotiated() const override {
- return false;
- }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
- return false;
- }
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
+ bool WasEverUsed() const override { return was_used_to_convey_data_; }
+ bool UsingTCPFastOpen() const override { return false; }
+ bool WasNpnNegotiated() const override { return false; }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
private:
bool connected_;
@@ -203,7 +193,7 @@
public:
MockClientSocketFactory() : allocation_count_(0) {}
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
@@ -212,7 +202,7 @@
return scoped_ptr<DatagramClientSocket>();
}
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* /* net_log */,
const NetLog::Source& /*source*/) override {
@@ -220,7 +210,7 @@
return scoped_ptr<StreamSocket>();
}
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
@@ -229,9 +219,7 @@
return scoped_ptr<SSLClientSocket>();
}
- virtual void ClearSSLSessionCache() override {
- NOTIMPLEMENTED();
- }
+ void ClearSSLSessionCache() override { NOTIMPLEMENTED(); }
void WaitForSignal(TestConnectJob* job) { waiting_jobs_.push_back(job); }
@@ -291,9 +279,9 @@
// From ConnectJob:
- virtual LoadState GetLoadState() const override { return load_state_; }
+ LoadState GetLoadState() const override { return load_state_; }
- virtual void GetAdditionalErrorState(ClientSocketHandle* handle) override {
+ void GetAdditionalErrorState(ClientSocketHandle* handle) override {
if (store_additional_error_state_) {
// Set all of the additional error state fields in some way.
handle->set_is_ssl_error(true);
@@ -306,7 +294,7 @@
private:
// From ConnectJob:
- virtual int ConnectInternal() override {
+ int ConnectInternal() override {
AddressList ignored;
client_socket_factory_->CreateTransportClientSocket(
ignored, NULL, net::NetLog::Source());
@@ -439,7 +427,7 @@
net_log_(net_log) {
}
- virtual ~TestConnectJobFactory() {}
+ ~TestConnectJobFactory() override {}
void set_job_type(TestConnectJob::JobType job_type) { job_type_ = job_type; }
@@ -454,7 +442,7 @@
// ConnectJobFactory implementation.
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const TestClientSocketPoolBase::Request& request,
ConnectJob::Delegate* delegate) const override {
@@ -473,7 +461,7 @@
net_log_));
}
- virtual base::TimeDelta ConnectionTimeout() const override {
+ base::TimeDelta ConnectionTimeout() const override {
return timeout_duration_;
}
@@ -502,92 +490,78 @@
unused_idle_socket_timeout, used_idle_socket_timeout,
connect_job_factory) {}
- virtual ~TestClientSocketPool() {}
+ ~TestClientSocketPool() override {}
- virtual int RequestSocket(
- const std::string& group_name,
- const void* params,
- net::RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override {
+ int RequestSocket(const std::string& group_name,
+ const void* params,
+ net::RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override {
const scoped_refptr<TestSocketParams>* casted_socket_params =
static_cast<const scoped_refptr<TestSocketParams>*>(params);
return base_.RequestSocket(group_name, *casted_socket_params, priority,
handle, callback, net_log);
}
- virtual void RequestSockets(const std::string& group_name,
- const void* params,
- int num_sockets,
- const BoundNetLog& net_log) override {
+ void RequestSockets(const std::string& group_name,
+ const void* params,
+ int num_sockets,
+ const BoundNetLog& net_log) override {
const scoped_refptr<TestSocketParams>* casted_params =
static_cast<const scoped_refptr<TestSocketParams>*>(params);
base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
}
- virtual void CancelRequest(
- const std::string& group_name,
- ClientSocketHandle* handle) override {
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override {
base_.CancelRequest(group_name, handle);
}
- virtual void ReleaseSocket(
- const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override {
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override {
base_.ReleaseSocket(group_name, socket.Pass(), id);
}
- virtual void FlushWithError(int error) override {
- base_.FlushWithError(error);
- }
+ void FlushWithError(int error) override { base_.FlushWithError(error); }
- virtual bool IsStalled() const override {
- return base_.IsStalled();
- }
+ bool IsStalled() const override { return base_.IsStalled(); }
- virtual void CloseIdleSockets() override {
- base_.CloseIdleSockets();
- }
+ void CloseIdleSockets() override { base_.CloseIdleSockets(); }
- virtual int IdleSocketCount() const override {
- return base_.idle_socket_count();
- }
+ int IdleSocketCount() const override { return base_.idle_socket_count(); }
- virtual int IdleSocketCountInGroup(
- const std::string& group_name) const override {
+ int IdleSocketCountInGroup(const std::string& group_name) const override {
return base_.IdleSocketCountInGroup(group_name);
}
- virtual LoadState GetLoadState(
- const std::string& group_name,
- const ClientSocketHandle* handle) const override {
+ LoadState GetLoadState(const std::string& group_name,
+ const ClientSocketHandle* handle) const override {
return base_.GetLoadState(group_name, handle);
}
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override {
+ void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override {
base_.AddHigherLayeredPool(higher_pool);
}
- virtual void RemoveHigherLayeredPool(
- HigherLayeredPool* higher_pool) override {
+ void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override {
base_.RemoveHigherLayeredPool(higher_pool);
}
- virtual base::DictionaryValue* GetInfoAsValue(
+ base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override {
return base_.GetInfoAsValue(name, type);
}
- virtual base::TimeDelta ConnectionTimeout() const override {
+ base::TimeDelta ConnectionTimeout() const override {
return base_.ConnectionTimeout();
}
- virtual ClientSocketPoolHistograms* histograms() const override {
+ ClientSocketPoolHistograms* histograms() const override {
return base_.histograms();
}
@@ -651,9 +625,9 @@
public:
TestConnectJobDelegate()
: have_result_(false), waiting_for_result_(false), result_(OK) {}
- virtual ~TestConnectJobDelegate() {}
+ ~TestConnectJobDelegate() override {}
- virtual void OnConnectJobComplete(int result, ConnectJob* job) override {
+ void OnConnectJobComplete(int result, ConnectJob* job) override {
result_ = result;
scoped_ptr<ConnectJob> owned_job(job);
scoped_ptr<StreamSocket> socket = owned_job->PassSocket();
@@ -1473,7 +1447,7 @@
base::Unretained(this))) {
}
- virtual ~RequestSocketCallback() {}
+ ~RequestSocketCallback() override {}
const CompletionCallback& callback() const { return callback_; }
@@ -2591,7 +2565,7 @@
base::Unretained(this))) {
}
- virtual ~TestReleasingSocketRequest() {}
+ ~TestReleasingSocketRequest() override {}
ClientSocketHandle* handle() { return &handle_; }
@@ -2716,7 +2690,7 @@
base::Unretained(this))) {
}
- virtual ~ConnectWithinCallback() {}
+ ~ConnectWithinCallback() override {}
int WaitForNestedResult() {
return nested_callback_.WaitForResult();
diff --git a/net/socket/client_socket_pool_manager_impl.h b/net/socket/client_socket_pool_manager_impl.h
index 94fd55d..f9f8d3b 100644
--- a/net/socket/client_socket_pool_manager_impl.h
+++ b/net/socket/client_socket_pool_manager_impl.h
@@ -71,31 +71,31 @@
bool enable_ssl_connect_job_waiting,
ProxyDelegate* proxy_delegate,
HttpNetworkSession::SocketPoolType pool_type);
- virtual ~ClientSocketPoolManagerImpl();
+ ~ClientSocketPoolManagerImpl() override;
- virtual void FlushSocketPoolsWithError(int error) override;
- virtual void CloseIdleSockets() override;
+ void FlushSocketPoolsWithError(int error) override;
+ void CloseIdleSockets() override;
- virtual TransportClientSocketPool* GetTransportSocketPool() override;
+ TransportClientSocketPool* GetTransportSocketPool() override;
- virtual SSLClientSocketPool* GetSSLSocketPool() override;
+ SSLClientSocketPool* GetSSLSocketPool() override;
- virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
+ SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
const HostPortPair& socks_proxy) override;
- virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
+ HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
const HostPortPair& http_proxy) override;
- virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
+ SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
const HostPortPair& proxy_server) override;
// Creates a Value summary of the state of the socket pools. The caller is
// responsible for deleting the returned value.
- virtual base::Value* SocketPoolInfoToValue() const override;
+ base::Value* SocketPoolInfoToValue() const override;
// CertDatabase::Observer methods:
- virtual void OnCertAdded(const X509Certificate* cert) override;
- virtual void OnCACertChanged(const X509Certificate* cert) override;
+ void OnCertAdded(const X509Certificate* cert) override;
+ void OnCACertChanged(const X509Certificate* cert) override;
private:
typedef internal::OwnedPoolMap<HostPortPair, TransportClientSocketPool*>
diff --git a/net/socket/mock_client_socket_pool_manager.h b/net/socket/mock_client_socket_pool_manager.h
index 03930e3..76d7704 100644
--- a/net/socket/mock_client_socket_pool_manager.h
+++ b/net/socket/mock_client_socket_pool_manager.h
@@ -14,7 +14,7 @@
class MockClientSocketPoolManager : public ClientSocketPoolManager {
public:
MockClientSocketPoolManager();
- virtual ~MockClientSocketPoolManager();
+ ~MockClientSocketPoolManager() override;
// Sets "override" socket pools that get used instead.
void SetTransportSocketPool(TransportClientSocketPool* pool);
@@ -27,17 +27,17 @@
SSLClientSocketPool* pool);
// ClientSocketPoolManager methods:
- virtual void FlushSocketPoolsWithError(int error) override;
- virtual void CloseIdleSockets() override;
- virtual TransportClientSocketPool* GetTransportSocketPool() override;
- virtual SSLClientSocketPool* GetSSLSocketPool() override;
- virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
+ void FlushSocketPoolsWithError(int error) override;
+ void CloseIdleSockets() override;
+ TransportClientSocketPool* GetTransportSocketPool() override;
+ SSLClientSocketPool* GetSSLSocketPool() override;
+ SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
const HostPortPair& socks_proxy) override;
- virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
+ HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
const HostPortPair& http_proxy) override;
- virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
+ SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
const HostPortPair& proxy_server) override;
- virtual base::Value* SocketPoolInfoToValue() const override;
+ base::Value* SocketPoolInfoToValue() const override;
private:
typedef internal::OwnedPoolMap<HostPortPair, TransportClientSocketPool*>
diff --git a/net/socket/socket_libevent.h b/net/socket/socket_libevent.h
index a072738..00a0ca6 100644
--- a/net/socket/socket_libevent.h
+++ b/net/socket/socket_libevent.h
@@ -27,7 +27,7 @@
: public base::MessageLoopForIO::Watcher {
public:
SocketLibevent();
- virtual ~SocketLibevent();
+ ~SocketLibevent() override;
// Opens a socket and returns net::OK if |address_family| is AF_INET, AF_INET6
// or AF_UNIX. Otherwise, it does DCHECK() and returns a net error.
@@ -81,8 +81,8 @@
private:
// base::MessageLoopForIO::Watcher methods.
- virtual void OnFileCanReadWithoutBlocking(int fd) override;
- virtual void OnFileCanWriteWithoutBlocking(int fd) override;
+ void OnFileCanReadWithoutBlocking(int fd) override;
+ void OnFileCanWriteWithoutBlocking(int fd) override;
int DoAccept(scoped_ptr<SocketLibevent>* socket);
void AcceptCompleted();
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index 1496aec..7bccdae 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -243,7 +243,7 @@
size_t reads_count,
MockWrite* writes,
size_t writes_count);
- virtual ~StaticSocketDataProvider();
+ ~StaticSocketDataProvider() override;
// These functions get access to the next available read and write data.
const MockRead& PeekRead() const;
@@ -262,9 +262,9 @@
virtual void CompleteRead() {}
// SocketDataProvider implementation.
- virtual MockRead GetNextRead() override;
- virtual MockWriteResult OnWrite(const std::string& data) override;
- virtual void Reset() override;
+ MockRead GetNextRead() override;
+ MockWriteResult OnWrite(const std::string& data) override;
+ void Reset() override;
private:
MockRead* reads_;
@@ -284,7 +284,7 @@
class DynamicSocketDataProvider : public SocketDataProvider {
public:
DynamicSocketDataProvider();
- virtual ~DynamicSocketDataProvider();
+ ~DynamicSocketDataProvider() override;
int short_read_limit() const { return short_read_limit_; }
void set_short_read_limit(int limit) { short_read_limit_ = limit; }
@@ -292,9 +292,9 @@
void allow_unconsumed_reads(bool allow) { allow_unconsumed_reads_ = allow; }
// SocketDataProvider implementation.
- virtual MockRead GetNextRead() override;
+ MockRead GetNextRead() override;
virtual MockWriteResult OnWrite(const std::string& data) = 0;
- virtual void Reset() override;
+ void Reset() override;
protected:
// The next time there is a read from this socket, it will return |data|.
@@ -371,15 +371,15 @@
size_t reads_count,
MockWrite* writes,
size_t writes_count);
- virtual ~DelayedSocketData();
+ ~DelayedSocketData() override;
void ForceNextRead();
// StaticSocketDataProvider:
- virtual MockRead GetNextRead() override;
- virtual MockWriteResult OnWrite(const std::string& data) override;
- virtual void Reset() override;
- virtual void CompleteRead() override;
+ MockRead GetNextRead() override;
+ MockWriteResult OnWrite(const std::string& data) override;
+ void Reset() override;
+ void CompleteRead() override;
private:
int write_delay_;
@@ -412,7 +412,7 @@
size_t reads_count,
MockWrite* writes,
size_t writes_count);
- virtual ~OrderedSocketData();
+ ~OrderedSocketData() override;
// |connect| the result for the connect phase.
// |reads| the list of MockRead completions.
@@ -430,10 +430,10 @@
void EndLoop();
// StaticSocketDataProvider:
- virtual MockRead GetNextRead() override;
- virtual MockWriteResult OnWrite(const std::string& data) override;
- virtual void Reset() override;
- virtual void CompleteRead() override;
+ MockRead GetNextRead() override;
+ MockWriteResult OnWrite(const std::string& data) override;
+ void Reset() override;
+ void CompleteRead() override;
private:
int sequence_number_;
@@ -536,7 +536,7 @@
size_t reads_count,
MockWrite* writes,
size_t writes_count);
- virtual ~DeterministicSocketData();
+ ~DeterministicSocketData() override;
// Consume all the data up to the give stop point (via SetStop()).
void Run();
@@ -560,14 +560,14 @@
// When the socket calls Read(), that calls GetNextRead(), and expects either
// ERR_IO_PENDING or data.
- virtual MockRead GetNextRead() override;
+ MockRead GetNextRead() override;
// When the socket calls Write(), it always completes synchronously. OnWrite()
// checks to make sure the written data matches the expected data. The
// callback will not be invoked until its sequence number is reached.
- virtual MockWriteResult OnWrite(const std::string& data) override;
- virtual void Reset() override;
- virtual void CompleteRead() override {}
+ MockWriteResult OnWrite(const std::string& data) override;
+ void Reset() override;
+ void CompleteRead() override {}
private:
// Invoke the read and write callbacks, if the timing is appropriate.
@@ -633,7 +633,7 @@
class MockClientSocketFactory : public ClientSocketFactory {
public:
MockClientSocketFactory();
- virtual ~MockClientSocketFactory();
+ ~MockClientSocketFactory() override;
void AddSocketDataProvider(SocketDataProvider* socket);
void AddSSLSocketDataProvider(SSLSocketDataProvider* socket);
@@ -650,21 +650,21 @@
}
// ClientSocketFactory
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
const NetLog::Source& source) override;
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
const NetLog::Source& source) override;
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
const SSLClientSocketContext& context) override;
- virtual void ClearSSLSessionCache() override;
+ void ClearSSLSessionCache() override;
private:
SocketDataProviderArray<SocketDataProvider> mock_data_;
@@ -688,42 +688,41 @@
virtual int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) = 0;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
// StreamSocket implementation.
virtual int Connect(const CompletionCallback& callback) = 0;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const override;
- virtual bool InSessionCache() const override;
- virtual void SetHandshakeCompletionCallback(const base::Closure& cb) override;
- virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info)
- override;
- virtual int ExportKeyingMaterial(const base::StringPiece& label,
- bool has_context,
- const base::StringPiece& context,
- unsigned char* out,
- unsigned int outlen) override;
- virtual int GetTLSUniqueChannelBinding(std::string* out) override;
- virtual NextProtoStatus GetNextProto(std::string* proto) override;
- virtual ChannelIDService* GetChannelIDService() const override;
+ std::string GetSessionCacheKey() const override;
+ bool InSessionCache() const override;
+ void SetHandshakeCompletionCallback(const base::Closure& cb) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ int ExportKeyingMaterial(const base::StringPiece& label,
+ bool has_context,
+ const base::StringPiece& context,
+ unsigned char* out,
+ unsigned int outlen) override;
+ int GetTLSUniqueChannelBinding(std::string* out) override;
+ NextProtoStatus GetNextProto(std::string* proto) override;
+ ChannelIDService* GetChannelIDService() const override;
protected:
- virtual ~MockClientSocket();
+ ~MockClientSocket() override;
void RunCallbackAsync(const CompletionCallback& callback, int result);
void RunCallback(const CompletionCallback& callback, int result);
// SSLClientSocket implementation.
- virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
+ scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
const override;
// True if Connect completed successfully and Disconnect hasn't been called.
@@ -745,32 +744,32 @@
MockTCPClientSocket(const AddressList& addresses,
net::NetLog* net_log,
SocketDataProvider* socket);
- virtual ~MockTCPClientSocket();
+ ~MockTCPClientSocket() override;
const AddressList& addresses() const { return addresses_; }
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// AsyncSocket:
- virtual void OnReadComplete(const MockRead& data) override;
- virtual void OnConnectComplete(const MockConnect& data) override;
+ void OnReadComplete(const MockRead& data) override;
+ void OnConnectComplete(const MockConnect& data) override;
private:
int CompleteRead();
@@ -851,36 +850,36 @@
public:
DeterministicMockUDPClientSocket(net::NetLog* net_log,
DeterministicSocketData* data);
- virtual ~DeterministicMockUDPClientSocket();
+ ~DeterministicMockUDPClientSocket() override;
// DeterministicSocketData::Delegate:
- virtual bool WritePending() const override;
- virtual bool ReadPending() const override;
- virtual void CompleteWrite() override;
- virtual int CompleteRead() override;
+ bool WritePending() const override;
+ bool ReadPending() const override;
+ void CompleteWrite() override;
+ int CompleteRead() override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
// DatagramSocket implementation.
- virtual void Close() override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
+ void Close() override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
// DatagramClientSocket implementation.
- virtual int Connect(const IPEndPoint& address) override;
+ int Connect(const IPEndPoint& address) override;
// AsyncSocket implementation.
- virtual void OnReadComplete(const MockRead& data) override;
- virtual void OnConnectComplete(const MockConnect& data) override;
+ void OnReadComplete(const MockRead& data) override;
+ void OnConnectComplete(const MockConnect& data) override;
void set_source_port(int port) { source_port_ = port; }
@@ -902,35 +901,35 @@
public:
DeterministicMockTCPClientSocket(net::NetLog* net_log,
DeterministicSocketData* data);
- virtual ~DeterministicMockTCPClientSocket();
+ ~DeterministicMockTCPClientSocket() override;
// DeterministicSocketData::Delegate:
- virtual bool WritePending() const override;
- virtual bool ReadPending() const override;
- virtual void CompleteWrite() override;
- virtual int CompleteRead() override;
+ bool WritePending() const override;
+ bool ReadPending() const override;
+ void CompleteWrite() override;
+ int CompleteRead() override;
// Socket:
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// StreamSocket:
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// AsyncSocket:
- virtual void OnReadComplete(const MockRead& data) override;
- virtual void OnConnectComplete(const MockConnect& data) override;
+ void OnReadComplete(const MockRead& data) override;
+ void OnConnectComplete(const MockConnect& data) override;
private:
DeterministicSocketHelper helper_;
@@ -944,44 +943,43 @@
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
SSLSocketDataProvider* socket);
- virtual ~MockSSLClientSocket();
+ ~MockSSLClientSocket() override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual bool WasNpnNegotiated() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ bool WasNpnNegotiated() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const override;
- virtual bool InSessionCache() const override;
- virtual void SetHandshakeCompletionCallback(const base::Closure& cb) override;
- virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info)
- override;
- virtual NextProtoStatus GetNextProto(std::string* proto) override;
- virtual bool set_was_npn_negotiated(bool negotiated) override;
- virtual void set_protocol_negotiated(NextProto protocol_negotiated) override;
- virtual NextProto GetNegotiatedProtocol() const override;
+ std::string GetSessionCacheKey() const override;
+ bool InSessionCache() const override;
+ void SetHandshakeCompletionCallback(const base::Closure& cb) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ NextProtoStatus GetNextProto(std::string* proto) override;
+ bool set_was_npn_negotiated(bool negotiated) override;
+ void set_protocol_negotiated(NextProto protocol_negotiated) override;
+ NextProto GetNegotiatedProtocol() const override;
// This MockSocket does not implement the manual async IO feature.
- virtual void OnReadComplete(const MockRead& data) override;
- virtual void OnConnectComplete(const MockConnect& data) override;
+ void OnReadComplete(const MockRead& data) override;
+ void OnConnectComplete(const MockConnect& data) override;
- virtual bool WasChannelIDSent() const override;
- virtual void set_channel_id_sent(bool channel_id_sent) override;
- virtual ChannelIDService* GetChannelIDService() const override;
+ bool WasChannelIDSent() const override;
+ void set_channel_id_sent(bool channel_id_sent) override;
+ ChannelIDService* GetChannelIDService() const override;
bool reached_connect() const { return reached_connect_; }
@@ -1028,30 +1026,30 @@
class MockUDPClientSocket : public DatagramClientSocket, public AsyncSocket {
public:
MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log);
- virtual ~MockUDPClientSocket();
+ ~MockUDPClientSocket() override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
// DatagramSocket implementation.
- virtual void Close() override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
+ void Close() override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
// DatagramClientSocket implementation.
- virtual int Connect(const IPEndPoint& address) override;
+ int Connect(const IPEndPoint& address) override;
// AsyncSocket implementation.
- virtual void OnReadComplete(const MockRead& data) override;
- virtual void OnConnectComplete(const MockConnect& data) override;
+ void OnReadComplete(const MockRead& data) override;
+ void OnConnectComplete(const MockConnect& data) override;
void set_source_port(int port) { source_port_ = port;}
@@ -1087,7 +1085,7 @@
public:
TestSocketRequest(std::vector<TestSocketRequest*>* request_order,
size_t* completion_count);
- virtual ~TestSocketRequest();
+ ~TestSocketRequest() override;
ClientSocketHandle* handle() { return &handle_; }
@@ -1207,7 +1205,7 @@
ClientSocketPoolHistograms* histograms,
ClientSocketFactory* socket_factory);
- virtual ~MockTransportClientSocketPool();
+ ~MockTransportClientSocketPool() override;
RequestPriority last_request_priority() const {
return last_request_priority_;
@@ -1216,18 +1214,18 @@
int cancel_count() const { return cancel_count_; }
// TransportClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* socket_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
+ int RequestSocket(const std::string& group_name,
+ const void* socket_params,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
private:
ClientSocketFactory* client_socket_factory_;
@@ -1242,7 +1240,7 @@
class DeterministicMockClientSocketFactory : public ClientSocketFactory {
public:
DeterministicMockClientSocketFactory();
- virtual ~DeterministicMockClientSocketFactory();
+ ~DeterministicMockClientSocketFactory() override;
void AddSocketDataProvider(DeterministicSocketData* socket);
void AddSSLSocketDataProvider(SSLSocketDataProvider* socket);
@@ -1263,21 +1261,21 @@
}
// ClientSocketFactory
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
const NetLog::Source& source) override;
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* net_log,
const NetLog::Source& source) override;
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
const SSLClientSocketContext& context) override;
- virtual void ClearSSLSessionCache() override;
+ void ClearSSLSessionCache() override;
private:
SocketDataProviderArray<DeterministicSocketData> mock_data_;
@@ -1298,21 +1296,21 @@
ClientSocketPoolHistograms* histograms,
TransportClientSocketPool* transport_pool);
- virtual ~MockSOCKSClientSocketPool();
+ ~MockSOCKSClientSocketPool() override;
// SOCKSClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* socket_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
+ int RequestSocket(const std::string& group_name,
+ const void* socket_params,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/socket/socks5_client_socket.h b/net/socket/socks5_client_socket.h
index 5d4e060..a405212 100644
--- a/net/socket/socks5_client_socket.h
+++ b/net/socket/socks5_client_socket.h
@@ -38,37 +38,37 @@
const HostResolver::RequestInfo& req_info);
// On destruction Disconnect() is called.
- virtual ~SOCKS5ClientSocket();
+ ~SOCKS5ClientSocket() override;
// StreamSocket implementation.
// Does the SOCKS handshake and completes the protocol.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
private:
enum State {
diff --git a/net/socket/socks_client_socket.h b/net/socket/socks_client_socket.h
index d480de4..e792881 100644
--- a/net/socket/socks_client_socket.h
+++ b/net/socket/socks_client_socket.h
@@ -35,37 +35,37 @@
HostResolver* host_resolver);
// On destruction Disconnect() is called.
- virtual ~SOCKSClientSocket();
+ ~SOCKSClientSocket() override;
// StreamSocket implementation.
// Does the SOCKS handshake and completes the protocol.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
private:
FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, CompleteHandshake);
diff --git a/net/socket/socks_client_socket_pool.h b/net/socket/socks_client_socket_pool.h
index d324f0a..35f7146 100644
--- a/net/socket/socks_client_socket_pool.h
+++ b/net/socket/socks_client_socket_pool.h
@@ -63,10 +63,10 @@
HostResolver* host_resolver,
Delegate* delegate,
NetLog* net_log);
- virtual ~SOCKSConnectJob();
+ ~SOCKSConnectJob() override;
// ConnectJob methods.
- virtual LoadState GetLoadState() const override;
+ LoadState GetLoadState() const override;
private:
enum State {
@@ -90,7 +90,7 @@
// Begins the transport connection and the SOCKS handshake. Returns OK on
// success and ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() override;
+ int ConnectInternal() override;
scoped_refptr<SOCKSSocketParams> socks_params_;
TransportClientSocketPool* const transport_pool_;
@@ -117,59 +117,57 @@
TransportClientSocketPool* transport_pool,
NetLog* net_log);
- virtual ~SOCKSClientSocketPool();
+ ~SOCKSClientSocketPool() override;
// ClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* connect_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
+ int RequestSocket(const std::string& group_name,
+ const void* connect_params,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
- virtual void RequestSockets(const std::string& group_name,
- const void* params,
- int num_sockets,
- const BoundNetLog& net_log) override;
+ void RequestSockets(const std::string& group_name,
+ const void* params,
+ int num_sockets,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
- virtual void FlushWithError(int error) override;
+ void FlushWithError(int error) override;
- virtual void CloseIdleSockets() override;
+ void CloseIdleSockets() override;
- virtual int IdleSocketCount() const override;
+ int IdleSocketCount() const override;
- virtual int IdleSocketCountInGroup(
- const std::string& group_name) const override;
+ int IdleSocketCountInGroup(const std::string& group_name) const override;
- virtual LoadState GetLoadState(
- const std::string& group_name,
- const ClientSocketHandle* handle) const override;
+ LoadState GetLoadState(const std::string& group_name,
+ const ClientSocketHandle* handle) const override;
- virtual base::DictionaryValue* GetInfoAsValue(
+ base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const override;
+ ClientSocketPoolHistograms* histograms() const override;
// LowerLayeredPool implementation.
- virtual bool IsStalled() const override;
+ bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
// HigherLayeredPool implementation.
- virtual bool CloseOneIdleConnection() override;
+ bool CloseOneIdleConnection() override;
private:
typedef ClientSocketPoolBase<SOCKSSocketParams> PoolBase;
@@ -183,15 +181,15 @@
host_resolver_(host_resolver),
net_log_(net_log) {}
- virtual ~SOCKSConnectJobFactory() {}
+ ~SOCKSConnectJobFactory() override {}
// ClientSocketPoolBase::ConnectJobFactory methods.
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/socket/socks_client_socket_unittest.cc b/net/socket/socks_client_socket_unittest.cc
index 84aaf6f..ced7d9e 100644
--- a/net/socket/socks_client_socket_unittest.cc
+++ b/net/socket/socks_client_socket_unittest.cc
@@ -96,12 +96,12 @@
public:
HangingHostResolverWithCancel() : outstanding_request_(NULL) {}
- virtual int Resolve(const RequestInfo& info,
- RequestPriority priority,
- AddressList* addresses,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) override {
+ int Resolve(const RequestInfo& info,
+ RequestPriority priority,
+ AddressList* addresses,
+ const CompletionCallback& callback,
+ RequestHandle* out_req,
+ const BoundNetLog& net_log) override {
DCHECK(addresses);
DCHECK_EQ(false, callback.is_null());
EXPECT_FALSE(HasOutstandingRequest());
@@ -110,14 +110,14 @@
return ERR_IO_PENDING;
}
- virtual int ResolveFromCache(const RequestInfo& info,
- AddressList* addresses,
- const BoundNetLog& net_log) override {
+ int ResolveFromCache(const RequestInfo& info,
+ AddressList* addresses,
+ const BoundNetLog& net_log) override {
NOTIMPLEMENTED();
return ERR_UNEXPECTED;
}
- virtual void CancelRequest(RequestHandle req) override {
+ void CancelRequest(RequestHandle req) override {
EXPECT_TRUE(HasOutstandingRequest());
EXPECT_EQ(outstanding_request_, req);
outstanding_request_ = NULL;
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index 8f40f84..c6bd366 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -87,8 +87,8 @@
};
// StreamSocket:
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
// Computes a unique key string for the SSL session cache.
virtual std::string GetSessionCacheKey() const = 0;
diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h
index dff457b..49a2b45 100644
--- a/net/socket/ssl_client_socket_openssl.h
+++ b/net/socket/ssl_client_socket_openssl.h
@@ -51,7 +51,7 @@
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
const SSLClientSocketContext& context);
- virtual ~SSLClientSocketOpenSSL();
+ ~SSLClientSocketOpenSSL() override;
const HostPortPair& host_and_port() const { return host_and_port_; }
const std::string& ssl_session_cache_shard() const {
@@ -59,48 +59,48 @@
}
// SSLClientSocket implementation.
- virtual std::string GetSessionCacheKey() const override;
- virtual bool InSessionCache() const override;
- virtual void SetHandshakeCompletionCallback(
- const base::Closure& callback) override;
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override;
- virtual NextProtoStatus GetNextProto(std::string* proto) override;
- virtual ChannelIDService* GetChannelIDService() const override;
+ std::string GetSessionCacheKey() const override;
+ bool InSessionCache() const override;
+ void SetHandshakeCompletionCallback(const base::Closure& callback) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ NextProtoStatus GetNextProto(std::string* proto) override;
+ ChannelIDService* GetChannelIDService() const override;
// SSLSocket implementation.
- virtual int ExportKeyingMaterial(const base::StringPiece& label,
- bool has_context,
- const base::StringPiece& context,
- unsigned char* out,
- unsigned int outlen) override;
- virtual int GetTLSUniqueChannelBinding(std::string* out) override;
+ int ExportKeyingMaterial(const base::StringPiece& label,
+ bool has_context,
+ const base::StringPiece& context,
+ unsigned char* out,
+ unsigned int outlen) override;
+ int GetTLSUniqueChannelBinding(std::string* out) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
protected:
// SSLClientSocket implementation.
- virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
+ scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain()
const override;
private:
diff --git a/net/socket/ssl_client_socket_pool.h b/net/socket/ssl_client_socket_pool.h
index 5854015..c7f613e 100644
--- a/net/socket/ssl_client_socket_pool.h
+++ b/net/socket/ssl_client_socket_pool.h
@@ -194,12 +194,12 @@
const GetMessengerCallback& get_messenger_callback,
Delegate* delegate,
NetLog* net_log);
- virtual ~SSLConnectJob();
+ ~SSLConnectJob() override;
// ConnectJob methods.
- virtual LoadState GetLoadState() const override;
+ LoadState GetLoadState() const override;
- virtual void GetAdditionalErrorState(ClientSocketHandle * handle) override;
+ void GetAdditionalErrorState(ClientSocketHandle* handle) override;
private:
enum State {
@@ -242,7 +242,7 @@
// Starts the SSL connection process. Returns OK on success and
// ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() override;
+ int ConnectInternal() override;
scoped_refptr<SSLSocketParams> params_;
TransportClientSocketPool* const transport_pool_;
@@ -294,59 +294,57 @@
bool enable_ssl_connect_job_waiting,
NetLog* net_log);
- virtual ~SSLClientSocketPool();
+ ~SSLClientSocketPool() override;
// ClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* connect_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
+ int RequestSocket(const std::string& group_name,
+ const void* connect_params,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
- virtual void RequestSockets(const std::string& group_name,
- const void* params,
- int num_sockets,
- const BoundNetLog& net_log) override;
+ void RequestSockets(const std::string& group_name,
+ const void* params,
+ int num_sockets,
+ const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
- virtual void FlushWithError(int error) override;
+ void FlushWithError(int error) override;
- virtual void CloseIdleSockets() override;
+ void CloseIdleSockets() override;
- virtual int IdleSocketCount() const override;
+ int IdleSocketCount() const override;
- virtual int IdleSocketCountInGroup(
- const std::string& group_name) const override;
+ int IdleSocketCountInGroup(const std::string& group_name) const override;
- virtual LoadState GetLoadState(
- const std::string& group_name,
- const ClientSocketHandle* handle) const override;
+ LoadState GetLoadState(const std::string& group_name,
+ const ClientSocketHandle* handle) const override;
- virtual base::DictionaryValue* GetInfoAsValue(
+ base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const override;
+ ClientSocketPoolHistograms* histograms() const override;
// LowerLayeredPool implementation.
- virtual bool IsStalled() const override;
+ bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
// HigherLayeredPool implementation.
- virtual bool CloseOneIdleConnection() override;
+ bool CloseOneIdleConnection() override;
// Gets the SSLConnectJobMessenger for the given ssl session |cache_key|. If
// none exits, it creates one and stores it in |messenger_map_|.
@@ -363,7 +361,7 @@
// When the user changes the SSL config, we flush all idle sockets so they
// won't get re-used.
- virtual void OnSSLConfigChanged() override;
+ void OnSSLConfigChanged() override;
class SSLConnectJobFactory : public PoolBase::ConnectJobFactory {
public:
@@ -377,15 +375,15 @@
const SSLConnectJob::GetMessengerCallback& get_messenger_callback,
NetLog* net_log);
- virtual ~SSLConnectJobFactory();
+ ~SSLConnectJobFactory() override;
// ClientSocketPoolBase::ConnectJobFactory methods.
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
private:
TransportClientSocketPool* const transport_pool_;
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index 58e43c7..13a3863 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -57,65 +57,57 @@
public:
explicit WrappedStreamSocket(scoped_ptr<StreamSocket> transport)
: transport_(transport.Pass()) {}
- virtual ~WrappedStreamSocket() {}
+ ~WrappedStreamSocket() override {}
// StreamSocket implementation:
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
return transport_->Connect(callback);
}
- virtual void Disconnect() override { transport_->Disconnect(); }
- virtual bool IsConnected() const override {
- return transport_->IsConnected();
- }
- virtual bool IsConnectedAndIdle() const override {
+ void Disconnect() override { transport_->Disconnect(); }
+ bool IsConnected() const override { return transport_->IsConnected(); }
+ bool IsConnectedAndIdle() const override {
return transport_->IsConnectedAndIdle();
}
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ int GetPeerAddress(IPEndPoint* address) const override {
return transport_->GetPeerAddress(address);
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
return transport_->GetLocalAddress(address);
}
- virtual const BoundNetLog& NetLog() const override {
- return transport_->NetLog();
- }
- virtual void SetSubresourceSpeculation() override {
+ const BoundNetLog& NetLog() const override { return transport_->NetLog(); }
+ void SetSubresourceSpeculation() override {
transport_->SetSubresourceSpeculation();
}
- virtual void SetOmniboxSpeculation() override {
- transport_->SetOmniboxSpeculation();
- }
- virtual bool WasEverUsed() const override {
- return transport_->WasEverUsed();
- }
- virtual bool UsingTCPFastOpen() const override {
+ void SetOmniboxSpeculation() override { transport_->SetOmniboxSpeculation(); }
+ bool WasEverUsed() const override { return transport_->WasEverUsed(); }
+ bool UsingTCPFastOpen() const override {
return transport_->UsingTCPFastOpen();
}
- virtual bool WasNpnNegotiated() const override {
+ bool WasNpnNegotiated() const override {
return transport_->WasNpnNegotiated();
}
- virtual NextProto GetNegotiatedProtocol() const override {
+ NextProto GetNegotiatedProtocol() const override {
return transport_->GetNegotiatedProtocol();
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
+ bool GetSSLInfo(SSLInfo* ssl_info) override {
return transport_->GetSSLInfo(ssl_info);
}
// Socket implementation:
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return transport_->Read(buf, buf_len, callback);
}
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return transport_->Write(buf, buf_len, callback);
}
- virtual int SetReceiveBufferSize(int32 size) override {
+ int SetReceiveBufferSize(int32 size) override {
return transport_->SetReceiveBufferSize(size);
}
- virtual int SetSendBufferSize(int32 size) override {
+ int SetSendBufferSize(int32 size) override {
return transport_->SetSendBufferSize(size);
}
@@ -132,12 +124,12 @@
class ReadBufferingStreamSocket : public WrappedStreamSocket {
public:
explicit ReadBufferingStreamSocket(scoped_ptr<StreamSocket> transport);
- virtual ~ReadBufferingStreamSocket() {}
+ ~ReadBufferingStreamSocket() override {}
// Socket implementation:
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// Sets the internal buffer to |size|. This must not be greater than
// the largest value supplied to Read() - that is, it does not handle
@@ -262,15 +254,15 @@
class SynchronousErrorStreamSocket : public WrappedStreamSocket {
public:
explicit SynchronousErrorStreamSocket(scoped_ptr<StreamSocket> transport);
- virtual ~SynchronousErrorStreamSocket() {}
+ ~SynchronousErrorStreamSocket() override {}
// Socket implementation:
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// Sets the next Read() call and all future calls to return |error|.
// If there is already a pending asynchronous read, the configured error
@@ -333,15 +325,15 @@
class FakeBlockingStreamSocket : public WrappedStreamSocket {
public:
explicit FakeBlockingStreamSocket(scoped_ptr<StreamSocket> transport);
- virtual ~FakeBlockingStreamSocket() {}
+ ~FakeBlockingStreamSocket() override {}
// Socket implementation:
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
// Blocks read results on the socket. Reads will not complete until
// UnblockReadResult() has been called and a result is ready from the
@@ -549,18 +541,18 @@
: WrappedStreamSocket(transport.Pass()),
read_count_(0),
write_count_(0) {}
- virtual ~CountingStreamSocket() {}
+ ~CountingStreamSocket() override {}
// Socket implementation:
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
read_count_++;
return transport_->Read(buf, buf_len, callback);
}
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
write_count_++;
return transport_->Write(buf, buf_len, callback);
}
@@ -581,7 +573,7 @@
: socket_(socket),
callback_(base::Bind(&DeleteSocketCallback::OnComplete,
base::Unretained(this))) {}
- virtual ~DeleteSocketCallback() {}
+ ~DeleteSocketCallback() override {}
const CompletionCallback& callback() const { return callback_; }
@@ -605,62 +597,58 @@
// A ChannelIDStore that always returns an error when asked for a
// channel id.
class FailingChannelIDStore : public ChannelIDStore {
- virtual int GetChannelID(const std::string& server_identifier,
- base::Time* expiration_time,
- std::string* private_key_result,
- std::string* cert_result,
- const GetChannelIDCallback& callback) override {
+ int GetChannelID(const std::string& server_identifier,
+ base::Time* expiration_time,
+ std::string* private_key_result,
+ std::string* cert_result,
+ const GetChannelIDCallback& callback) override {
return ERR_UNEXPECTED;
}
- virtual void SetChannelID(const std::string& server_identifier,
- base::Time creation_time,
- base::Time expiration_time,
- const std::string& private_key,
- const std::string& cert) override {}
- virtual void DeleteChannelID(const std::string& server_identifier,
- const base::Closure& completion_callback)
- override {}
- virtual void DeleteAllCreatedBetween(base::Time delete_begin,
- base::Time delete_end,
- const base::Closure& completion_callback)
- override {}
- virtual void DeleteAll(const base::Closure& completion_callback) override {}
- virtual void GetAllChannelIDs(const GetChannelIDListCallback& callback)
- override {}
- virtual int GetChannelIDCount() override { return 0; }
- virtual void SetForceKeepSessionState() override {}
+ void SetChannelID(const std::string& server_identifier,
+ base::Time creation_time,
+ base::Time expiration_time,
+ const std::string& private_key,
+ const std::string& cert) override {}
+ void DeleteChannelID(const std::string& server_identifier,
+ const base::Closure& completion_callback) override {}
+ void DeleteAllCreatedBetween(
+ base::Time delete_begin,
+ base::Time delete_end,
+ const base::Closure& completion_callback) override {}
+ void DeleteAll(const base::Closure& completion_callback) override {}
+ void GetAllChannelIDs(const GetChannelIDListCallback& callback) override {}
+ int GetChannelIDCount() override { return 0; }
+ void SetForceKeepSessionState() override {}
};
// A ChannelIDStore that asynchronously returns an error when asked for a
// channel id.
class AsyncFailingChannelIDStore : public ChannelIDStore {
- virtual int GetChannelID(const std::string& server_identifier,
- base::Time* expiration_time,
- std::string* private_key_result,
- std::string* cert_result,
- const GetChannelIDCallback& callback) override {
+ int GetChannelID(const std::string& server_identifier,
+ base::Time* expiration_time,
+ std::string* private_key_result,
+ std::string* cert_result,
+ const GetChannelIDCallback& callback) override {
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(callback, ERR_UNEXPECTED,
server_identifier, base::Time(), "", ""));
return ERR_IO_PENDING;
}
- virtual void SetChannelID(const std::string& server_identifier,
- base::Time creation_time,
- base::Time expiration_time,
- const std::string& private_key,
- const std::string& cert) override {}
- virtual void DeleteChannelID(const std::string& server_identifier,
- const base::Closure& completion_callback)
- override {}
- virtual void DeleteAllCreatedBetween(base::Time delete_begin,
- base::Time delete_end,
- const base::Closure& completion_callback)
- override {}
- virtual void DeleteAll(const base::Closure& completion_callback) override {}
- virtual void GetAllChannelIDs(const GetChannelIDListCallback& callback)
- override {}
- virtual int GetChannelIDCount() override { return 0; }
- virtual void SetForceKeepSessionState() override {}
+ void SetChannelID(const std::string& server_identifier,
+ base::Time creation_time,
+ base::Time expiration_time,
+ const std::string& private_key,
+ const std::string& cert) override {}
+ void DeleteChannelID(const std::string& server_identifier,
+ const base::Closure& completion_callback) override {}
+ void DeleteAllCreatedBetween(
+ base::Time delete_begin,
+ base::Time delete_end,
+ const base::Closure& completion_callback) override {}
+ void DeleteAll(const base::Closure& completion_callback) override {}
+ void GetAllChannelIDs(const GetChannelIDListCallback& callback) override {}
+ int GetChannelIDCount() override { return 0; }
+ void SetForceKeepSessionState() override {}
};
// A mock CTVerifier that records every call to Verify but doesn't verify
diff --git a/net/socket/ssl_server_socket.h b/net/socket/ssl_server_socket.h
index 8b607bf..88f7f94 100644
--- a/net/socket/ssl_server_socket.h
+++ b/net/socket/ssl_server_socket.h
@@ -23,7 +23,7 @@
class SSLServerSocket : public SSLSocket {
public:
- virtual ~SSLServerSocket() {}
+ ~SSLServerSocket() override {}
// Perform the SSL server handshake, and notify the supplied callback
// if the process completes asynchronously. If Disconnect is called before
diff --git a/net/socket/ssl_server_socket_openssl.h b/net/socket/ssl_server_socket_openssl.h
index 379ca57..c58bd56 100644
--- a/net/socket/ssl_server_socket_openssl.h
+++ b/net/socket/ssl_server_socket_openssl.h
@@ -30,42 +30,44 @@
scoped_refptr<X509Certificate> certificate,
crypto::RSAPrivateKey* key,
const SSLConfig& ssl_config);
- virtual ~SSLServerSocketOpenSSL();
+ ~SSLServerSocketOpenSSL() override;
// SSLServerSocket interface.
- virtual int Handshake(const CompletionCallback& callback) override;
+ int Handshake(const CompletionCallback& callback) override;
// SSLSocket interface.
- virtual int ExportKeyingMaterial(const base::StringPiece& label,
- bool has_context,
- const base::StringPiece& context,
- unsigned char* out,
- unsigned int outlen) override;
- virtual int GetTLSUniqueChannelBinding(std::string* out) override;
+ int ExportKeyingMaterial(const base::StringPiece& label,
+ bool has_context,
+ const base::StringPiece& context,
+ unsigned char* out,
+ unsigned int outlen) override;
+ int GetTLSUniqueChannelBinding(std::string* out) override;
// Socket interface (via StreamSocket).
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
private:
enum State {
diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc
index 1d70258..e9957f5 100644
--- a/net/socket/ssl_server_socket_unittest.cc
+++ b/net/socket/ssl_server_socket_unittest.cc
@@ -167,87 +167,65 @@
outgoing_(outgoing_channel) {
}
- virtual ~FakeSocket() {
- }
+ ~FakeSocket() override {}
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
// Read random number of bytes.
buf_len = rand() % buf_len + 1;
return incoming_->Read(buf, buf_len, callback);
}
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
// Write random number of bytes.
buf_len = rand() % buf_len + 1;
return outgoing_->Write(buf, buf_len, callback);
}
- virtual int SetReceiveBufferSize(int32 size) override {
- return OK;
- }
+ int SetReceiveBufferSize(int32 size) override { return OK; }
- virtual int SetSendBufferSize(int32 size) override {
- return OK;
- }
+ int SetSendBufferSize(int32 size) override { return OK; }
- virtual int Connect(const CompletionCallback& callback) override {
- return OK;
- }
+ int Connect(const CompletionCallback& callback) override { return OK; }
- virtual void Disconnect() override {
+ void Disconnect() override {
incoming_->Close();
outgoing_->Close();
}
- virtual bool IsConnected() const override {
- return true;
- }
+ bool IsConnected() const override { return true; }
- virtual bool IsConnectedAndIdle() const override {
- return true;
- }
+ bool IsConnectedAndIdle() const override { return true; }
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ int GetPeerAddress(IPEndPoint* address) const override {
IPAddressNumber ip_address(kIPv4AddressSize);
*address = IPEndPoint(ip_address, 0 /*port*/);
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
IPAddressNumber ip_address(4);
*address = IPEndPoint(ip_address, 0);
return OK;
}
- virtual const BoundNetLog& NetLog() const override {
- return net_log_;
- }
+ const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const override {
- return true;
- }
+ bool WasEverUsed() const override { return true; }
- virtual bool UsingTCPFastOpen() const override {
- return false;
- }
+ bool UsingTCPFastOpen() const override { return false; }
+ bool WasNpnNegotiated() const override { return false; }
- virtual bool WasNpnNegotiated() const override {
- return false;
- }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
-
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
- return false;
- }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
private:
BoundNetLog net_log_;
diff --git a/net/socket/ssl_socket.h b/net/socket/ssl_socket.h
index 68d1e4a..0dc817b 100644
--- a/net/socket/ssl_socket.h
+++ b/net/socket/ssl_socket.h
@@ -15,7 +15,7 @@
// and server SSL sockets.
class NET_EXPORT SSLSocket : public StreamSocket {
public:
- virtual ~SSLSocket() {}
+ ~SSLSocket() override {}
// Exports data derived from the SSL master-secret (see RFC 5705).
// If |has_context| is false, uses the no-context construction from the
diff --git a/net/socket/stream_listen_socket.h b/net/socket/stream_listen_socket.h
index ead35c4..f8f9419 100644
--- a/net/socket/stream_listen_socket.h
+++ b/net/socket/stream_listen_socket.h
@@ -47,7 +47,7 @@
#endif
public:
- virtual ~StreamListenSocket();
+ ~StreamListenSocket() override;
// TODO(erikkay): this delegate should really be split into two parts
// to split up the listener from the connected socket. Perhaps this class
@@ -116,8 +116,8 @@
HANDLE socket_event_;
#elif defined(OS_POSIX)
// Called by MessagePumpLibevent when the socket is ready to do I/O.
- virtual void OnFileCanReadWithoutBlocking(int fd) override;
- virtual void OnFileCanWriteWithoutBlocking(int fd) override;
+ void OnFileCanReadWithoutBlocking(int fd) override;
+ void OnFileCanWriteWithoutBlocking(int fd) override;
WaitState wait_state_;
// The socket's libevent wrapper.
base::MessageLoopForIO::FileDescriptorWatcher watcher_;
diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h
index 7631e12..b41fed8 100644
--- a/net/socket/stream_socket.h
+++ b/net/socket/stream_socket.h
@@ -17,7 +17,7 @@
class NET_EXPORT_PRIVATE StreamSocket : public Socket {
public:
- virtual ~StreamSocket() {}
+ ~StreamSocket() override {}
// Called to establish a connection. Returns OK if the connection could be
// established synchronously. Otherwise, ERR_IO_PENDING is returned and the
diff --git a/net/socket/tcp_client_socket.h b/net/socket/tcp_client_socket.h
index 1672a95..0deec2a 100644
--- a/net/socket/tcp_client_socket.h
+++ b/net/socket/tcp_client_socket.h
@@ -32,37 +32,39 @@
TCPClientSocket(scoped_ptr<TCPSocket> connected_socket,
const IPEndPoint& peer_address);
- virtual ~TCPClientSocket();
+ ~TCPClientSocket() override;
// Binds the socket to a local IP address and port.
int Bind(const IPEndPoint& address);
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual void EnableTCPFastOpenIfSupported() override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ void EnableTCPFastOpenIfSupported() override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
// Multiple outstanding requests are not supported.
// Full duplex mode (reading and writing at the same time) is supported.
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
virtual bool SetKeepAlive(bool enable, int delay);
virtual bool SetNoDelay(bool no_delay);
diff --git a/net/socket/tcp_listen_socket.h b/net/socket/tcp_listen_socket.h
index d726dcc..1702e50 100644
--- a/net/socket/tcp_listen_socket.h
+++ b/net/socket/tcp_listen_socket.h
@@ -17,7 +17,7 @@
// Implements a TCP socket.
class NET_EXPORT TCPListenSocket : public StreamListenSocket {
public:
- virtual ~TCPListenSocket();
+ ~TCPListenSocket() override;
// Listen on port for the specified IP address. Use 127.0.0.1 to only
// accept local connections.
static scoped_ptr<TCPListenSocket> CreateAndListen(
@@ -34,7 +34,7 @@
TCPListenSocket(SocketDescriptor s, StreamListenSocket::Delegate* del);
// Implements StreamListenSocket::Accept.
- virtual void Accept() override;
+ void Accept() override;
private:
DISALLOW_COPY_AND_ASSIGN(TCPListenSocket);
@@ -44,10 +44,10 @@
class NET_EXPORT TCPListenSocketFactory : public StreamListenSocketFactory {
public:
TCPListenSocketFactory(const std::string& ip, int port);
- virtual ~TCPListenSocketFactory();
+ ~TCPListenSocketFactory() override;
// StreamListenSocketFactory overrides.
- virtual scoped_ptr<StreamListenSocket> CreateAndListen(
+ scoped_ptr<StreamListenSocket> CreateAndListen(
StreamListenSocket::Delegate* delegate) const override;
private:
diff --git a/net/socket/tcp_listen_socket_unittest.h b/net/socket/tcp_listen_socket_unittest.h
index 9393370..984442a 100644
--- a/net/socket/tcp_listen_socket_unittest.h
+++ b/net/socket/tcp_listen_socket_unittest.h
@@ -90,11 +90,12 @@
virtual bool Send(SocketDescriptor sock, const std::string& str);
// StreamListenSocket::Delegate:
- virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) override;
- virtual void DidRead(StreamListenSocket* connection, const char* data,
- int len) override;
- virtual void DidClose(StreamListenSocket* sock) override;
+ void DidAccept(StreamListenSocket* server,
+ scoped_ptr<StreamListenSocket> connection) override;
+ void DidRead(StreamListenSocket* connection,
+ const char* data,
+ int len) override;
+ void DidClose(StreamListenSocket* sock) override;
scoped_ptr<base::Thread> thread_;
base::MessageLoopForIO* loop_;
@@ -111,7 +112,7 @@
private:
friend class base::RefCountedThreadSafe<TCPListenSocketTester>;
- virtual ~TCPListenSocketTester();
+ ~TCPListenSocketTester() override;
virtual scoped_ptr<TCPListenSocket> DoListen();
diff --git a/net/socket/tcp_server_socket.h b/net/socket/tcp_server_socket.h
index 9fc719a..a3919e6 100644
--- a/net/socket/tcp_server_socket.h
+++ b/net/socket/tcp_server_socket.h
@@ -19,13 +19,13 @@
class NET_EXPORT_PRIVATE TCPServerSocket : public ServerSocket {
public:
TCPServerSocket(NetLog* net_log, const NetLog::Source& source);
- virtual ~TCPServerSocket();
+ ~TCPServerSocket() override;
// net::ServerSocket implementation.
- virtual int Listen(const IPEndPoint& address, int backlog) override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual int Accept(scoped_ptr<StreamSocket>* socket,
- const CompletionCallback& callback) override;
+ int Listen(const IPEndPoint& address, int backlog) override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ int Accept(scoped_ptr<StreamSocket>* socket,
+ const CompletionCallback& callback) override;
private:
// Converts |accepted_socket_| and stores the result in
diff --git a/net/socket/transport_client_socket_pool.h b/net/socket/transport_client_socket_pool.h
index 14af726..15cef5c 100644
--- a/net/socket/transport_client_socket_pool.h
+++ b/net/socket/transport_client_socket_pool.h
@@ -164,10 +164,10 @@
HostResolver* host_resolver,
Delegate* delegate,
NetLog* net_log);
- virtual ~TransportConnectJob();
+ ~TransportConnectJob() override;
// ConnectJob methods.
- virtual LoadState GetLoadState() const override;
+ LoadState GetLoadState() const override;
// Rolls |addrlist| forward until the first IPv4 address, if any.
// WARNING: this method should only be used to implement the prefer-IPv4 hack.
@@ -194,7 +194,7 @@
// Begins the host resolution and the TCP connect. Returns OK on success
// and ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() override;
+ int ConnectInternal() override;
TransportConnectJobHelper helper_;
@@ -223,43 +223,41 @@
ClientSocketFactory* client_socket_factory,
NetLog* net_log);
- virtual ~TransportClientSocketPool();
+ ~TransportClientSocketPool() override;
// ClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* resolve_info,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
- virtual void RequestSockets(const std::string& group_name,
- const void* params,
- int num_sockets,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
- virtual void FlushWithError(int error) override;
- virtual void CloseIdleSockets() override;
- virtual int IdleSocketCount() const override;
- virtual int IdleSocketCountInGroup(
- const std::string& group_name) const override;
- virtual LoadState GetLoadState(
- const std::string& group_name,
- const ClientSocketHandle* handle) const override;
- virtual base::DictionaryValue* GetInfoAsValue(
+ int RequestSocket(const std::string& group_name,
+ const void* resolve_info,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
+ void RequestSockets(const std::string& group_name,
+ const void* params,
+ int num_sockets,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
+ void FlushWithError(int error) override;
+ void CloseIdleSockets() override;
+ int IdleSocketCount() const override;
+ int IdleSocketCountInGroup(const std::string& group_name) const override;
+ LoadState GetLoadState(const std::string& group_name,
+ const ClientSocketHandle* handle) const override;
+ base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const override;
+ base::TimeDelta ConnectionTimeout() const override;
+ ClientSocketPoolHistograms* histograms() const override;
// HigherLayeredPool implementation.
- virtual bool IsStalled() const override;
- virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
- virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ bool IsStalled() const override;
+ void AddHigherLayeredPool(HigherLayeredPool* higher_pool) override;
+ void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override;
protected:
// Methods shared with WebSocketTransportClientSocketPool
@@ -280,16 +278,16 @@
host_resolver_(host_resolver),
net_log_(net_log) {}
- virtual ~TransportConnectJobFactory() {}
+ ~TransportConnectJobFactory() override {}
// ClientSocketPoolBase::ConnectJobFactory methods.
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ scoped_ptr<ConnectJob> NewConnectJob(
const std::string& group_name,
const PoolBase::Request& request,
ConnectJob::Delegate* delegate) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
+ base::TimeDelta ConnectionTimeout() const override;
private:
ClientSocketFactory* const client_socket_factory_;
diff --git a/net/socket/transport_client_socket_pool_test_util.cc b/net/socket/transport_client_socket_pool_test_util.cc
index bfe6922..82ed8e6 100644
--- a/net/socket/transport_client_socket_pool_test_util.cc
+++ b/net/socket/transport_client_socket_pool_test_util.cc
@@ -38,19 +38,19 @@
use_tcp_fastopen_(false) {}
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
connected_ = true;
return OK;
}
- virtual void Disconnect() override { connected_ = false; }
- virtual bool IsConnected() const override { return connected_; }
- virtual bool IsConnectedAndIdle() const override { return connected_; }
+ void Disconnect() override { connected_ = false; }
+ bool IsConnected() const override { return connected_; }
+ bool IsConnectedAndIdle() const override { return connected_; }
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ int GetPeerAddress(IPEndPoint* address) const override {
*address = addrlist_.front();
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
if (!connected_)
return ERR_SOCKET_NOT_CONNECTED;
if (addrlist_.front().GetFamily() == ADDRESS_FAMILY_IPV4)
@@ -59,34 +59,30 @@
SetIPv6Address(address);
return OK;
}
- virtual const BoundNetLog& NetLog() const override { return net_log_; }
+ const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const override { return false; }
- virtual void EnableTCPFastOpenIfSupported() override {
- use_tcp_fastopen_ = true;
- }
- virtual bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
- virtual bool WasNpnNegotiated() const override { return false; }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
+ bool WasEverUsed() const override { return false; }
+ void EnableTCPFastOpenIfSupported() override { use_tcp_fastopen_ = true; }
+ bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
+ bool WasNpnNegotiated() const override { return false; }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) override { return OK; }
- virtual int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32 size) override { return OK; }
+ int SetSendBufferSize(int32 size) override { return OK; }
private:
bool connected_;
@@ -105,49 +101,45 @@
use_tcp_fastopen_(false) {}
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
return ERR_CONNECTION_FAILED;
}
- virtual void Disconnect() override {}
+ void Disconnect() override {}
- virtual bool IsConnected() const override { return false; }
- virtual bool IsConnectedAndIdle() const override { return false; }
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ bool IsConnected() const override { return false; }
+ bool IsConnectedAndIdle() const override { return false; }
+ int GetPeerAddress(IPEndPoint* address) const override {
return ERR_UNEXPECTED;
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
return ERR_UNEXPECTED;
}
- virtual const BoundNetLog& NetLog() const override { return net_log_; }
+ const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const override { return false; }
- virtual void EnableTCPFastOpenIfSupported() override {
- use_tcp_fastopen_ = true;
- }
- virtual bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
- virtual bool WasNpnNegotiated() const override { return false; }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
+ bool WasEverUsed() const override { return false; }
+ void EnableTCPFastOpenIfSupported() override { use_tcp_fastopen_ = true; }
+ bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
+ bool WasNpnNegotiated() const override { return false; }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) override { return OK; }
- virtual int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32 size) override { return OK; }
+ int SetSendBufferSize(int32 size) override { return OK; }
private:
const AddressList addrlist_;
@@ -211,21 +203,21 @@
}
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
DCHECK(callback_.is_null());
callback_ = callback;
return ERR_IO_PENDING;
}
- virtual void Disconnect() override {}
+ void Disconnect() override {}
- virtual bool IsConnected() const override { return is_connected_; }
- virtual bool IsConnectedAndIdle() const override { return is_connected_; }
- virtual int GetPeerAddress(IPEndPoint* address) const override {
+ bool IsConnected() const override { return is_connected_; }
+ bool IsConnectedAndIdle() const override { return is_connected_; }
+ int GetPeerAddress(IPEndPoint* address) const override {
*address = addrlist_.front();
return OK;
}
- virtual int GetLocalAddress(IPEndPoint* address) const override {
+ int GetLocalAddress(IPEndPoint* address) const override {
if (!is_connected_)
return ERR_SOCKET_NOT_CONNECTED;
if (addrlist_.front().GetFamily() == ADDRESS_FAMILY_IPV4)
@@ -234,35 +226,31 @@
SetIPv6Address(address);
return OK;
}
- virtual const BoundNetLog& NetLog() const override { return net_log_; }
+ const BoundNetLog& NetLog() const override { return net_log_; }
- virtual void SetSubresourceSpeculation() override {}
- virtual void SetOmniboxSpeculation() override {}
- virtual bool WasEverUsed() const override { return false; }
- virtual void EnableTCPFastOpenIfSupported() override {
- use_tcp_fastopen_ = true;
- }
- virtual bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
- virtual bool WasNpnNegotiated() const override { return false; }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
+ void SetSubresourceSpeculation() override {}
+ void SetOmniboxSpeculation() override {}
+ bool WasEverUsed() const override { return false; }
+ void EnableTCPFastOpenIfSupported() override { use_tcp_fastopen_ = true; }
+ bool UsingTCPFastOpen() const override { return use_tcp_fastopen_; }
+ bool WasNpnNegotiated() const override { return false; }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) override { return OK; }
- virtual int SetSendBufferSize(int32 size) override { return OK; }
+ int SetReceiveBufferSize(int32 size) override { return OK; }
+ int SetSendBufferSize(int32 size) override { return OK; }
private:
void DoCallback() {
diff --git a/net/socket/transport_client_socket_pool_test_util.h b/net/socket/transport_client_socket_pool_test_util.h
index b4adb71..b375353 100644
--- a/net/socket/transport_client_socket_pool_test_util.h
+++ b/net/socket/transport_client_socket_pool_test_util.h
@@ -67,26 +67,26 @@
};
explicit MockTransportClientSocketFactory(NetLog* net_log);
- virtual ~MockTransportClientSocketFactory();
+ ~MockTransportClientSocketFactory() override;
- virtual scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
+ scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket(
DatagramSocket::BindType bind_type,
const RandIntCallback& rand_int_cb,
NetLog* net_log,
const NetLog::Source& source) override;
- virtual scoped_ptr<StreamSocket> CreateTransportClientSocket(
+ scoped_ptr<StreamSocket> CreateTransportClientSocket(
const AddressList& addresses,
NetLog* /* net_log */,
const NetLog::Source& /* source */) override;
- virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
+ scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
scoped_ptr<ClientSocketHandle> transport_socket,
const HostPortPair& host_and_port,
const SSLConfig& ssl_config,
const SSLClientSocketContext& context) override;
- virtual void ClearSSLSessionCache() override;
+ void ClearSSLSessionCache() override;
int allocation_count() const { return allocation_count_; }
diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc
index 2a05b44..e3e9873 100644
--- a/net/socket/transport_client_socket_pool_unittest.cc
+++ b/net/socket/transport_client_socket_pool_unittest.cc
@@ -465,7 +465,7 @@
base::Unretained(this))) {
}
- virtual ~RequestSocketCallback() {}
+ ~RequestSocketCallback() override {}
const CompletionCallback& callback() const { return callback_; }
diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc
index 8bfb674..ed68bf1 100644
--- a/net/socket/transport_client_socket_unittest.cc
+++ b/net/socket/transport_client_socket_unittest.cc
@@ -47,19 +47,19 @@
}
// Implement StreamListenSocket::Delegate methods
- virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) override {
+ void DidAccept(StreamListenSocket* server,
+ scoped_ptr<StreamListenSocket> connection) override {
connected_sock_.reset(
static_cast<TCPListenSocket*>(connection.release()));
}
- virtual void DidRead(StreamListenSocket*, const char* str, int len) override {
+ void DidRead(StreamListenSocket*, const char* str, int len) override {
// TODO(dkegel): this might not be long enough to tickle some bugs.
connected_sock_->Send(kServerReply, arraysize(kServerReply) - 1,
false /* Don't append line feed */);
if (close_server_socket_on_next_send_)
CloseServerSocket();
}
- virtual void DidClose(StreamListenSocket* sock) override {}
+ void DidClose(StreamListenSocket* sock) override {}
// Testcase hooks
virtual void SetUp();
diff --git a/net/socket/unix_domain_client_socket_posix.h b/net/socket/unix_domain_client_socket_posix.h
index e70694a..2a8bdb6 100644
--- a/net/socket/unix_domain_client_socket_posix.h
+++ b/net/socket/unix_domain_client_socket_posix.h
@@ -32,7 +32,7 @@
// UnixDomainServerSocket uses this after it accepts a connection.
explicit UnixDomainClientSocket(scoped_ptr<SocketLibevent> socket);
- virtual ~UnixDomainClientSocket();
+ ~UnixDomainClientSocket() override;
// Fills |address| with |socket_path| and its length. For Android or Linux
// platform, this supports abstract namespaces.
@@ -41,28 +41,30 @@
SockaddrStorage* address);
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
// Releases ownership of underlying SocketDescriptor to caller.
// Internal state is reset so that this object can be used again.
diff --git a/net/socket/unix_domain_listen_socket_posix.h b/net/socket/unix_domain_listen_socket_posix.h
index 8b9ba8e..b8f428d 100644
--- a/net/socket/unix_domain_listen_socket_posix.h
+++ b/net/socket/unix_domain_listen_socket_posix.h
@@ -30,7 +30,7 @@
public:
typedef UnixDomainServerSocket::AuthCallback AuthCallback;
- virtual ~UnixDomainListenSocket();
+ ~UnixDomainListenSocket() override;
// Note that the returned UnixDomainListenSocket instance does not take
// ownership of |del|.
@@ -64,7 +64,7 @@
bool use_abstract_namespace);
// StreamListenSocket:
- virtual void Accept() override;
+ void Accept() override;
AuthCallback auth_callback_;
@@ -79,10 +79,10 @@
UnixDomainListenSocketFactory(
const std::string& path,
const UnixDomainListenSocket::AuthCallback& auth_callback);
- virtual ~UnixDomainListenSocketFactory();
+ ~UnixDomainListenSocketFactory() override;
// StreamListenSocketFactory:
- virtual scoped_ptr<StreamListenSocket> CreateAndListen(
+ scoped_ptr<StreamListenSocket> CreateAndListen(
StreamListenSocket::Delegate* delegate) const override;
protected:
diff --git a/net/socket/unix_domain_listen_socket_posix_unittest.cc b/net/socket/unix_domain_listen_socket_posix_unittest.cc
index bea60c6..bfa9200 100644
--- a/net/socket/unix_domain_listen_socket_posix_unittest.cc
+++ b/net/socket/unix_domain_listen_socket_posix_unittest.cc
@@ -94,16 +94,16 @@
const scoped_refptr<EventManager>& event_manager)
: event_manager_(event_manager) {}
- virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) override {
+ void DidAccept(StreamListenSocket* server,
+ scoped_ptr<StreamListenSocket> connection) override {
LOG(ERROR) << __PRETTY_FUNCTION__;
connection_ = connection.Pass();
Notify(EVENT_ACCEPT);
}
- virtual void DidRead(StreamListenSocket* connection,
- const char* data,
- int len) override {
+ void DidRead(StreamListenSocket* connection,
+ const char* data,
+ int len) override {
{
base::AutoLock lock(mutex_);
DCHECK(len);
@@ -112,9 +112,7 @@
Notify(EVENT_READ);
}
- virtual void DidClose(StreamListenSocket* sock) override {
- Notify(EVENT_CLOSE);
- }
+ void DidClose(StreamListenSocket* sock) override { Notify(EVENT_CLOSE); }
void OnListenCompleted() {
Notify(EVENT_LISTEN);
diff --git a/net/socket/unix_domain_server_socket_posix.h b/net/socket/unix_domain_server_socket_posix.h
index 8fd8b34..0a26eb3 100644
--- a/net/socket/unix_domain_server_socket_posix.h
+++ b/net/socket/unix_domain_server_socket_posix.h
@@ -44,20 +44,20 @@
UnixDomainServerSocket(const AuthCallback& auth_callack,
bool use_abstract_namespace);
- virtual ~UnixDomainServerSocket();
+ ~UnixDomainServerSocket() override;
// Gets credentials of peer to check permissions.
static bool GetPeerCredentials(SocketDescriptor socket_fd,
Credentials* credentials);
// ServerSocket implementation.
- virtual int Listen(const IPEndPoint& address, int backlog) override;
- virtual int ListenWithAddressAndPort(const std::string& unix_domain_path,
- int port_unused,
- int backlog) override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual int Accept(scoped_ptr<StreamSocket>* socket,
- const CompletionCallback& callback) override;
+ int Listen(const IPEndPoint& address, int backlog) override;
+ int ListenWithAddressAndPort(const std::string& unix_domain_path,
+ int port_unused,
+ int backlog) override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ int Accept(scoped_ptr<StreamSocket>* socket,
+ const CompletionCallback& callback) override;
// Accepts an incoming connection on |listen_socket_|, but passes back
// a raw SocketDescriptor instead of a StreamSocket.
diff --git a/net/socket/websocket_endpoint_lock_manager_unittest.cc b/net/socket/websocket_endpoint_lock_manager_unittest.cc
index cafd1aa..01c9dbc 100644
--- a/net/socket/websocket_endpoint_lock_manager_unittest.cc
+++ b/net/socket/websocket_endpoint_lock_manager_unittest.cc
@@ -22,57 +22,51 @@
FakeStreamSocket() {}
// StreamSocket implementation
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual void Disconnect() override { return; }
+ void Disconnect() override { return; }
- virtual bool IsConnected() const override { return false; }
+ bool IsConnected() const override { return false; }
- virtual bool IsConnectedAndIdle() const override { return false; }
+ bool IsConnectedAndIdle() const override { return false; }
- virtual int GetPeerAddress(IPEndPoint* address) const override {
- return ERR_FAILED;
- }
+ int GetPeerAddress(IPEndPoint* address) const override { return ERR_FAILED; }
- virtual int GetLocalAddress(IPEndPoint* address) const override {
- return ERR_FAILED;
- }
+ int GetLocalAddress(IPEndPoint* address) const override { return ERR_FAILED; }
- virtual const BoundNetLog& NetLog() const override { return bound_net_log_; }
+ const BoundNetLog& NetLog() const override { return bound_net_log_; }
- virtual void SetSubresourceSpeculation() override { return; }
- virtual void SetOmniboxSpeculation() override { return; }
+ void SetSubresourceSpeculation() override { return; }
+ void SetOmniboxSpeculation() override { return; }
- virtual bool WasEverUsed() const override { return false; }
+ bool WasEverUsed() const override { return false; }
- virtual bool UsingTCPFastOpen() const override { return false; }
+ bool UsingTCPFastOpen() const override { return false; }
- virtual bool WasNpnNegotiated() const override { return false; }
+ bool WasNpnNegotiated() const override { return false; }
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
+ bool GetSSLInfo(SSLInfo* ssl_info) override { return false; }
// Socket implementation
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_FAILED;
}
- virtual int SetReceiveBufferSize(int32 size) override { return ERR_FAILED; }
+ int SetReceiveBufferSize(int32 size) override { return ERR_FAILED; }
- virtual int SetSendBufferSize(int32 size) override { return ERR_FAILED; }
+ int SetSendBufferSize(int32 size) override { return ERR_FAILED; }
private:
BoundNetLog bound_net_log_;
@@ -84,7 +78,7 @@
public:
FakeWaiter() : called_(false) {}
- virtual void GotEndpointLock() override {
+ void GotEndpointLock() override {
CHECK(!called_);
called_ = true;
}
diff --git a/net/socket/websocket_transport_client_socket_pool.h b/net/socket/websocket_transport_client_socket_pool.h
index e918354..f0a94be 100644
--- a/net/socket/websocket_transport_client_socket_pool.h
+++ b/net/socket/websocket_transport_client_socket_pool.h
@@ -53,7 +53,7 @@
Delegate* delegate,
NetLog* pool_net_log,
const BoundNetLog& request_net_log);
- virtual ~WebSocketTransportConnectJob();
+ ~WebSocketTransportConnectJob() override;
// Unlike normal socket pools, the WebSocketTransportClientPool uses
// early-binding of sockets.
@@ -65,7 +65,7 @@
const BoundNetLog& request_net_log() const { return request_net_log_; }
// ConnectJob methods.
- virtual LoadState GetLoadState() const override;
+ LoadState GetLoadState() const override;
private:
friend class WebSocketTransportConnectSubJob;
@@ -90,7 +90,7 @@
// Begins the host resolution and the TCP connect. Returns OK on success
// and ERR_IO_PENDING if it cannot immediately service the request.
// Otherwise, it returns a net error code.
- virtual int ConnectInternal() override;
+ int ConnectInternal() override;
TransportConnectJobHelper helper_;
@@ -123,7 +123,7 @@
ClientSocketFactory* client_socket_factory,
NetLog* net_log);
- virtual ~WebSocketTransportClientSocketPool();
+ ~WebSocketTransportClientSocketPool() override;
// Allow another connection to be started to the IPEndPoint that this |handle|
// is connected to. Used when the WebSocket handshake completes successfully.
@@ -133,46 +133,44 @@
static void UnlockEndpoint(ClientSocketHandle* handle);
// ClientSocketPool implementation.
- virtual int RequestSocket(const std::string& group_name,
- const void* resolve_info,
- RequestPriority priority,
- ClientSocketHandle* handle,
- const CompletionCallback& callback,
- const BoundNetLog& net_log) override;
- virtual void RequestSockets(const std::string& group_name,
- const void* params,
- int num_sockets,
- const BoundNetLog& net_log) override;
- virtual void CancelRequest(const std::string& group_name,
- ClientSocketHandle* handle) override;
- virtual void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
- int id) override;
- virtual void FlushWithError(int error) override;
- virtual void CloseIdleSockets() override;
- virtual int IdleSocketCount() const override;
- virtual int IdleSocketCountInGroup(
- const std::string& group_name) const override;
- virtual LoadState GetLoadState(
- const std::string& group_name,
- const ClientSocketHandle* handle) const override;
- virtual base::DictionaryValue* GetInfoAsValue(
+ int RequestSocket(const std::string& group_name,
+ const void* resolve_info,
+ RequestPriority priority,
+ ClientSocketHandle* handle,
+ const CompletionCallback& callback,
+ const BoundNetLog& net_log) override;
+ void RequestSockets(const std::string& group_name,
+ const void* params,
+ int num_sockets,
+ const BoundNetLog& net_log) override;
+ void CancelRequest(const std::string& group_name,
+ ClientSocketHandle* handle) override;
+ void ReleaseSocket(const std::string& group_name,
+ scoped_ptr<StreamSocket> socket,
+ int id) override;
+ void FlushWithError(int error) override;
+ void CloseIdleSockets() override;
+ int IdleSocketCount() const override;
+ int IdleSocketCountInGroup(const std::string& group_name) const override;
+ LoadState GetLoadState(const std::string& group_name,
+ const ClientSocketHandle* handle) const override;
+ base::DictionaryValue* GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;
- virtual base::TimeDelta ConnectionTimeout() const override;
- virtual ClientSocketPoolHistograms* histograms() const override;
+ base::TimeDelta ConnectionTimeout() const override;
+ ClientSocketPoolHistograms* histograms() const override;
// HigherLayeredPool implementation.
- virtual bool IsStalled() const override;
+ bool IsStalled() const override;
private:
class ConnectJobDelegate : public ConnectJob::Delegate {
public:
explicit ConnectJobDelegate(WebSocketTransportClientSocketPool* owner);
- virtual ~ConnectJobDelegate();
+ ~ConnectJobDelegate() override;
- virtual void OnConnectJobComplete(int result, ConnectJob* job) override;
+ void OnConnectJobComplete(int result, ConnectJob* job) override;
private:
WebSocketTransportClientSocketPool* owner_;
diff --git a/net/socket/websocket_transport_client_socket_pool_unittest.cc b/net/socket/websocket_transport_client_socket_pool_unittest.cc
index bfb2090..4d04c10 100644
--- a/net/socket/websocket_transport_client_socket_pool_unittest.cc
+++ b/net/socket/websocket_transport_client_socket_pool_unittest.cc
@@ -382,7 +382,7 @@
callback_(base::Bind(&RequestSocketCallback::OnComplete,
base::Unretained(this))) {}
- virtual ~RequestSocketCallback() {}
+ ~RequestSocketCallback() override {}
const CompletionCallback& callback() const { return callback_; }
diff --git a/net/socket/websocket_transport_connect_sub_job.h b/net/socket/websocket_transport_connect_sub_job.h
index e6f81e8..5709a46 100644
--- a/net/socket/websocket_transport_connect_sub_job.h
+++ b/net/socket/websocket_transport_connect_sub_job.h
@@ -33,7 +33,7 @@
WebSocketTransportConnectJob* parent_job,
SubJobType type);
- virtual ~WebSocketTransportConnectSubJob();
+ ~WebSocketTransportConnectSubJob() override;
// Start connecting.
int Start();
@@ -47,7 +47,7 @@
scoped_ptr<StreamSocket> PassSocket() { return transport_socket_.Pass(); }
// Implementation of WebSocketEndpointLockManager::EndpointWaiter.
- virtual void GotEndpointLock() override;
+ void GotEndpointLock() override;
private:
enum State {
diff --git a/net/socket_stream/socket_stream.h b/net/socket_stream/socket_stream.h
index c9de0c1..7387eb6 100644
--- a/net/socket_stream/socket_stream.h
+++ b/net/socket_stream/socket_stream.h
@@ -212,7 +212,7 @@
std::string headers_;
private:
- virtual ~RequestHeaders();
+ ~RequestHeaders() override;
};
class ResponseHeaders : public IOBuffer {
@@ -225,7 +225,7 @@
void Realloc(size_t new_size);
private:
- virtual ~ResponseHeaders();
+ ~ResponseHeaders() override;
scoped_ptr<char, base::FreeDeleter> headers_;
};
diff --git a/net/socket_stream/socket_stream_unittest.cc b/net/socket_stream/socket_stream_unittest.cc
index 7c4b50e..6d47086 100644
--- a/net/socket_stream/socket_stream_unittest.cc
+++ b/net/socket_stream/socket_stream_unittest.cc
@@ -59,7 +59,7 @@
// with the error code.
explicit SocketStreamEventRecorder(const CompletionCallback& callback)
: callback_(callback) {}
- virtual ~SocketStreamEventRecorder() {}
+ ~SocketStreamEventRecorder() override {}
void SetOnStartOpenConnection(
const base::Callback<int(SocketStreamEvent*)>& callback) {
@@ -88,9 +88,8 @@
on_error_ = callback;
}
- virtual int OnStartOpenConnection(
- SocketStream* socket,
- const CompletionCallback& callback) override {
+ int OnStartOpenConnection(SocketStream* socket,
+ const CompletionCallback& callback) override {
connection_callback_ = callback;
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_START_OPEN_CONNECTION,
@@ -99,8 +98,8 @@
return on_start_open_connection_.Run(&events_.back());
return OK;
}
- virtual void OnConnected(SocketStream* socket,
- int num_pending_send_allowed) override {
+ void OnConnected(SocketStream* socket,
+ int num_pending_send_allowed) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_CONNECTED,
socket, num_pending_send_allowed, std::string(),
@@ -108,23 +107,23 @@
if (!on_connected_.is_null())
on_connected_.Run(&events_.back());
}
- virtual void OnSentData(SocketStream* socket,
- int amount_sent) override {
+ void OnSentData(SocketStream* socket, int amount_sent) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_SENT_DATA, socket,
amount_sent, std::string(), NULL, OK));
if (!on_sent_data_.is_null())
on_sent_data_.Run(&events_.back());
}
- virtual void OnReceivedData(SocketStream* socket,
- const char* data, int len) override {
+ void OnReceivedData(SocketStream* socket,
+ const char* data,
+ int len) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_RECEIVED_DATA, socket, len,
std::string(data, len), NULL, OK));
if (!on_received_data_.is_null())
on_received_data_.Run(&events_.back());
}
- virtual void OnClose(SocketStream* socket) override {
+ void OnClose(SocketStream* socket) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_CLOSE, socket, 0,
std::string(), NULL, OK));
@@ -133,15 +132,15 @@
if (!callback_.is_null())
callback_.Run(OK);
}
- virtual void OnAuthRequired(SocketStream* socket,
- AuthChallengeInfo* auth_info) override {
+ void OnAuthRequired(SocketStream* socket,
+ AuthChallengeInfo* auth_info) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_AUTH_REQUIRED, socket, 0,
std::string(), auth_info, OK));
if (!on_auth_required_.is_null())
on_auth_required_.Run(&events_.back());
}
- virtual void OnError(const SocketStream* socket, int error) override {
+ void OnError(const SocketStream* socket, int error) override {
events_.push_back(
SocketStreamEvent(SocketStreamEvent::EVENT_ERROR, NULL, 0,
std::string(), NULL, error));
@@ -195,10 +194,10 @@
explicit SelfDeletingDelegate(const CompletionCallback& callback)
: socket_stream_(), callback_(callback) {}
- virtual ~SelfDeletingDelegate() {}
+ ~SelfDeletingDelegate() override {}
// Call DetachDelegate(), delete |this|, then run the callback.
- virtual void OnError(const SocketStream* socket, int error) override {
+ void OnError(const SocketStream* socket, int error) override {
// callback_ will be deleted when we delete |this|, so copy it to call it
// afterwards.
CompletionCallback callback = callback_;
@@ -214,18 +213,19 @@
EXPECT_EQ(socket_stream_->delegate(), this);
}
- virtual void OnConnected(SocketStream* socket, int max_pending_send_allowed)
- override {
+ void OnConnected(SocketStream* socket,
+ int max_pending_send_allowed) override {
ADD_FAILURE() << "OnConnected() should not be called";
}
- virtual void OnSentData(SocketStream* socket, int amount_sent) override {
+ void OnSentData(SocketStream* socket, int amount_sent) override {
ADD_FAILURE() << "OnSentData() should not be called";
}
- virtual void OnReceivedData(SocketStream* socket, const char* data, int len)
- override {
+ void OnReceivedData(SocketStream* socket,
+ const char* data,
+ int len) override {
ADD_FAILURE() << "OnReceivedData() should not be called";
}
- virtual void OnClose(SocketStream* socket) override {
+ void OnClose(SocketStream* socket) override {
ADD_FAILURE() << "OnClose() should not be called";
}
@@ -243,18 +243,17 @@
context_storage_.set_proxy_service(ProxyService::CreateFixed(proxy));
Init();
}
- virtual ~TestURLRequestContextWithProxy() {}
+ ~TestURLRequestContextWithProxy() override {}
};
class TestSocketStreamNetworkDelegate : public TestNetworkDelegate {
public:
TestSocketStreamNetworkDelegate()
: before_connect_result_(OK) {}
- virtual ~TestSocketStreamNetworkDelegate() {}
+ ~TestSocketStreamNetworkDelegate() override {}
- virtual int OnBeforeSocketStreamConnect(
- SocketStream* stream,
- const CompletionCallback& callback) override {
+ int OnBeforeSocketStreamConnect(SocketStream* stream,
+ const CompletionCallback& callback) override {
return before_connect_result_;
}
diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h
index fba98d7..02fa583 100644
--- a/net/spdy/buffered_spdy_framer.h
+++ b/net/spdy/buffered_spdy_framer.h
@@ -121,7 +121,7 @@
public:
BufferedSpdyFramer(SpdyMajorVersion version,
bool enable_compression);
- virtual ~BufferedSpdyFramer();
+ ~BufferedSpdyFramer() override;
// Sets callbacks to be called from the buffered spdy framer. A visitor must
// be set, or else the framer will likely crash. It is acceptable for the
@@ -135,41 +135,39 @@
void set_debug_visitor(SpdyFramerDebugVisitorInterface* debug_visitor);
// SpdyFramerVisitorInterface
- virtual void OnError(SpdyFramer* spdy_framer) override;
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional) override;
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override;
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override;
- virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
- const char* header_data,
- size_t len) override;
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override;
- virtual void OnSettings(bool clear_persisted) override;
- virtual void OnSetting(
- SpdySettingsIds id, uint8 flags, uint32 value) override;
- virtual void OnSettingsAck() override;
- virtual void OnSettingsEnd() override;
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override;
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override;
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override;
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override;
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- bool end) override;
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override;
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) override;
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
+ void OnError(SpdyFramer* spdy_framer) override;
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional) override;
+ void OnSynReply(SpdyStreamId stream_id, bool fin) override;
+ void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override;
+ bool OnControlFrameHeaderData(SpdyStreamId stream_id,
+ const char* header_data,
+ size_t len) override;
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override;
+ void OnSettings(bool clear_persisted) override;
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override;
+ void OnSettingsAck() override;
+ void OnSettingsEnd() override;
+ void OnPing(SpdyPingId unique_id, bool is_ack) override;
+ void OnRstStream(SpdyStreamId stream_id, SpdyRstStreamStatus status) override;
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override;
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override;
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ bool end) override;
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override;
+ void OnContinuation(SpdyStreamId stream_id, bool end) override;
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
// SpdyFramer methods.
size_t ProcessInput(const char* data, size_t len);
diff --git a/net/spdy/buffered_spdy_framer_unittest.cc b/net/spdy/buffered_spdy_framer_unittest.cc
index 0fc758b..6be20dd 100644
--- a/net/spdy/buffered_spdy_framer_unittest.cc
+++ b/net/spdy/buffered_spdy_framer_unittest.cc
@@ -25,79 +25,74 @@
promised_stream_id_(static_cast<SpdyStreamId>(-1)) {
}
- virtual void OnError(SpdyFramer::SpdyError error_code) override {
+ void OnError(SpdyFramer::SpdyError error_code) override {
LOG(INFO) << "SpdyFramer Error: " << error_code;
error_count_++;
}
- virtual void OnStreamError(
- SpdyStreamId stream_id,
- const std::string& description) override {
+ void OnStreamError(SpdyStreamId stream_id,
+ const std::string& description) override {
LOG(INFO) << "SpdyFramer Error on stream: " << stream_id << " "
<< description;
error_count_++;
}
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional,
- const SpdyHeaderBlock& headers) override {
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional,
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
syn_frame_count_++;
headers_ = headers;
}
- virtual void OnSynReply(SpdyStreamId stream_id,
- bool fin,
- const SpdyHeaderBlock& headers) override {
+ void OnSynReply(SpdyStreamId stream_id,
+ bool fin,
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
syn_reply_frame_count_++;
headers_ = headers;
}
- virtual void OnHeaders(SpdyStreamId stream_id,
- bool fin,
- const SpdyHeaderBlock& headers) override {
+ void OnHeaders(SpdyStreamId stream_id,
+ bool fin,
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
headers_frame_count_++;
headers_ = headers;
}
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override {
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override {
ADD_FAILURE() << "Unexpected OnDataFrameHeader call.";
}
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override {
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override {
LOG(FATAL) << "Unexpected OnStreamFrameData call.";
}
- virtual void OnSettings(bool clear_persisted) override {}
+ void OnSettings(bool clear_persisted) override {}
- virtual void OnSetting(SpdySettingsIds id,
- uint8 flags,
- uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
setting_count_++;
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {}
+ void OnPing(SpdyPingId unique_id, bool is_ack) override {}
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override {
- }
+ void OnRstStream(SpdyStreamId stream_id,
+ SpdyRstStreamStatus status) override {}
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override {
- }
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override {}
bool OnCredentialFrameData(const char*, size_t) {
LOG(FATAL) << "Unexpected OnCredentialFrameData call.";
@@ -111,12 +106,12 @@
void OnRstStream(const SpdyFrame& frame) {}
void OnGoAway(const SpdyFrame& frame) {}
void OnPing(const SpdyFrame& frame) {}
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override {}
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override {}
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) override {
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ const SpdyHeaderBlock& headers) override {
header_stream_id_ = stream_id;
EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
push_promise_frame_count_++;
@@ -125,7 +120,7 @@
headers_ = headers;
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
return true;
}
diff --git a/net/spdy/spdy_buffer.cc b/net/spdy/spdy_buffer.cc
index 0a69cd3..c1a602e 100644
--- a/net/spdy/spdy_buffer.cc
+++ b/net/spdy/spdy_buffer.cc
@@ -45,7 +45,7 @@
offset_(offset) {}
private:
- virtual ~SharedFrameIOBuffer() {
+ ~SharedFrameIOBuffer() override {
// Prevent ~IOBuffer() from trying to delete |data_|.
data_ = NULL;
}
diff --git a/net/spdy/spdy_buffer_producer.h b/net/spdy/spdy_buffer_producer.h
index d8777af..d098bb9 100644
--- a/net/spdy/spdy_buffer_producer.h
+++ b/net/spdy/spdy_buffer_producer.h
@@ -35,9 +35,9 @@
public:
explicit SimpleBufferProducer(scoped_ptr<SpdyBuffer> buffer);
- virtual ~SimpleBufferProducer();
+ ~SimpleBufferProducer() override;
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() override;
+ scoped_ptr<SpdyBuffer> ProduceBuffer() override;
private:
scoped_ptr<SpdyBuffer> buffer_;
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 6affd7b..9d7ea87 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -2839,53 +2839,50 @@
class FrameSerializationVisitor : public SpdyFrameVisitor {
public:
explicit FrameSerializationVisitor(SpdyFramer* framer) : framer_(framer) {}
- virtual ~FrameSerializationVisitor() {}
+ ~FrameSerializationVisitor() override {}
SpdySerializedFrame* ReleaseSerializedFrame() { return frame_.release(); }
- virtual void VisitData(const SpdyDataIR& data) override {
+ void VisitData(const SpdyDataIR& data) override {
frame_.reset(framer_->SerializeData(data));
}
- virtual void VisitSynStream(const SpdySynStreamIR& syn_stream) override {
+ void VisitSynStream(const SpdySynStreamIR& syn_stream) override {
frame_.reset(framer_->SerializeSynStream(syn_stream));
}
- virtual void VisitSynReply(const SpdySynReplyIR& syn_reply) override {
+ void VisitSynReply(const SpdySynReplyIR& syn_reply) override {
frame_.reset(framer_->SerializeSynReply(syn_reply));
}
- virtual void VisitRstStream(const SpdyRstStreamIR& rst_stream) override {
+ void VisitRstStream(const SpdyRstStreamIR& rst_stream) override {
frame_.reset(framer_->SerializeRstStream(rst_stream));
}
- virtual void VisitSettings(const SpdySettingsIR& settings) override {
+ void VisitSettings(const SpdySettingsIR& settings) override {
frame_.reset(framer_->SerializeSettings(settings));
}
- virtual void VisitPing(const SpdyPingIR& ping) override {
+ void VisitPing(const SpdyPingIR& ping) override {
frame_.reset(framer_->SerializePing(ping));
}
- virtual void VisitGoAway(const SpdyGoAwayIR& goaway) override {
+ void VisitGoAway(const SpdyGoAwayIR& goaway) override {
frame_.reset(framer_->SerializeGoAway(goaway));
}
- virtual void VisitHeaders(const SpdyHeadersIR& headers) override {
+ void VisitHeaders(const SpdyHeadersIR& headers) override {
frame_.reset(framer_->SerializeHeaders(headers));
}
- virtual void VisitWindowUpdate(
- const SpdyWindowUpdateIR& window_update) override {
+ void VisitWindowUpdate(const SpdyWindowUpdateIR& window_update) override {
frame_.reset(framer_->SerializeWindowUpdate(window_update));
}
- virtual void VisitBlocked(const SpdyBlockedIR& blocked) override {
+ void VisitBlocked(const SpdyBlockedIR& blocked) override {
frame_.reset(framer_->SerializeBlocked(blocked));
}
- virtual void VisitPushPromise(
- const SpdyPushPromiseIR& push_promise) override {
+ void VisitPushPromise(const SpdyPushPromiseIR& push_promise) override {
frame_.reset(framer_->SerializePushPromise(push_promise));
}
- virtual void VisitContinuation(
- const SpdyContinuationIR& continuation) override {
+ void VisitContinuation(const SpdyContinuationIR& continuation) override {
frame_.reset(framer_->SerializeContinuation(continuation));
}
- virtual void VisitAltSvc(const SpdyAltSvcIR& altsvc) override {
+ void VisitAltSvc(const SpdyAltSvcIR& altsvc) override {
frame_.reset(framer_->SerializeAltSvc(altsvc));
}
- virtual void VisitPriority(const SpdyPriorityIR& priority) override {
+ void VisitPriority(const SpdyPriorityIR& priority) override {
frame_.reset(framer_->SerializePriority(priority));
}
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc
index 982e75c..35b8a46 100644
--- a/net/spdy/spdy_framer_test.cc
+++ b/net/spdy/spdy_framer_test.cc
@@ -82,22 +82,22 @@
buffer_.reset(new char[kMaxDecompressedSize]);
}
- virtual void OnError(SpdyFramer* framer) override { LOG(FATAL); }
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override {
+ void OnError(SpdyFramer* framer) override { LOG(FATAL); }
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override {
LOG(FATAL) << "Unexpected data frame header";
}
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override {
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override {
LOG(FATAL);
}
- virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
- const char* header_data,
- size_t len) override {
+ bool OnControlFrameHeaderData(SpdyStreamId stream_id,
+ const char* header_data,
+ size_t len) override {
CHECK(buffer_.get() != NULL);
CHECK_GE(kMaxDecompressedSize, size_ + len);
CHECK(!finished_);
@@ -111,11 +111,11 @@
return true;
}
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional) override {
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdySynStreamIR syn_stream(stream_id);
@@ -129,7 +129,7 @@
size_ += framer.GetSynStreamMinimumSize();
}
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override {
+ void OnSynReply(SpdyStreamId stream_id, bool fin) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdyHeadersIR headers(stream_id);
@@ -140,27 +140,21 @@
size_ += framer.GetSynStreamMinimumSize();
}
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override {
+ void OnRstStream(SpdyStreamId stream_id,
+ SpdyRstStreamStatus status) override {
LOG(FATAL);
}
- virtual void OnSetting(SpdySettingsIds id,
- uint8 flags,
- uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
LOG(FATAL);
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {
- LOG(FATAL);
- }
- virtual void OnSettingsEnd() override { LOG(FATAL); }
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override {
+ void OnPing(SpdyPingId unique_id, bool is_ack) override { LOG(FATAL); }
+ void OnSettingsEnd() override { LOG(FATAL); }
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override {
LOG(FATAL);
}
- virtual void OnHeaders(SpdyStreamId stream_id,
- bool fin,
- bool end) override {
+ void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdyHeadersIR headers(stream_id);
@@ -175,9 +169,9 @@
LOG(FATAL);
}
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- bool end) override {
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ bool end) override {
SpdyFramer framer(version_);
framer.set_enable_compression(false);
SpdyPushPromiseIR push_promise(stream_id, promised_stream_id);
@@ -187,19 +181,18 @@
size_ += framer.GetPushPromiseMinimumSize();
}
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) override {
+ void OnContinuation(SpdyStreamId stream_id, bool end) override {
LOG(FATAL);
}
- virtual void OnPriority(SpdyStreamId stream_id,
- SpdyStreamId parent_stream_id,
- uint8 weight,
- bool exclusive) override {
+ void OnPriority(SpdyStreamId stream_id,
+ SpdyStreamId parent_stream_id,
+ uint8 weight,
+ bool exclusive) override {
// Do nothing.
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id,
- int frame_type) override {
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
LOG(FATAL);
return false;
}
@@ -209,8 +202,8 @@
return buffer_.release();
}
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override {
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override {
LOG(FATAL);
}
@@ -277,23 +270,23 @@
header_control_type_(DATA),
header_buffer_valid_(false) {}
- virtual void OnError(SpdyFramer* f) override {
+ void OnError(SpdyFramer* f) override {
LOG(INFO) << "SpdyFramer Error: "
<< SpdyFramer::ErrorCodeToString(f->error_code());
++error_count_;
}
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override {
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override {
++data_frame_count_;
header_stream_id_ = stream_id;
}
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override {
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override {
EXPECT_EQ(header_stream_id_, stream_id);
if (len == 0)
++zero_length_data_frame_count_;
@@ -308,9 +301,9 @@
std::cerr << "\", " << len << ")\n";
}
- virtual bool OnControlFrameHeaderData(SpdyStreamId stream_id,
- const char* header_data,
- size_t len) override {
+ bool OnControlFrameHeaderData(SpdyStreamId stream_id,
+ const char* header_data,
+ size_t len) override {
++control_frame_header_data_count_;
CHECK_EQ(header_stream_id_, stream_id);
if (len == 0) {
@@ -335,11 +328,11 @@
return true;
}
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional) override {
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional) override {
++syn_frame_count_;
if (framer_.protocol_version() > SPDY3) {
InitHeaderStreaming(HEADERS, stream_id);
@@ -351,7 +344,7 @@
}
}
- virtual void OnSynReply(SpdyStreamId stream_id, bool fin) override {
+ void OnSynReply(SpdyStreamId stream_id, bool fin) override {
++syn_reply_frame_count_;
if (framer_.protocol_version() > SPDY3) {
InitHeaderStreaming(HEADERS, stream_id);
@@ -363,45 +356,40 @@
}
}
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override {
+ void OnRstStream(SpdyStreamId stream_id,
+ SpdyRstStreamStatus status) override {
++fin_frame_count_;
}
- virtual bool OnRstStreamFrameData(const char* rst_stream_data,
- size_t len) override {
+ bool OnRstStreamFrameData(const char* rst_stream_data, size_t len) override {
if ((rst_stream_data != NULL) && (len > 0)) {
fin_opaque_data_ += std::string(rst_stream_data, len);
}
return true;
}
- virtual void OnSetting(SpdySettingsIds id,
- uint8 flags,
- uint32 value) override {
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {
++setting_count_;
}
- virtual void OnSettingsAck() override {
+ void OnSettingsAck() override {
DCHECK_LT(SPDY3, framer_.protocol_version());
++settings_ack_received_;
}
- virtual void OnSettingsEnd() override {
+ void OnSettingsEnd() override {
if (framer_.protocol_version() <= SPDY3) { return; }
++settings_ack_sent_;
}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {
- DLOG(FATAL);
- }
+ void OnPing(SpdyPingId unique_id, bool is_ack) override { DLOG(FATAL); }
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override {
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override {
++goaway_count_;
}
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
+ void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) override {
++headers_frame_count_;
InitHeaderStreaming(HEADERS, stream_id);
if (fin) {
@@ -409,31 +397,31 @@
}
}
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override {
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override {
last_window_update_stream_ = stream_id;
last_window_update_delta_ = delta_window_size;
}
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- bool end) override {
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ bool end) override {
++push_promise_frame_count_;
InitHeaderStreaming(PUSH_PROMISE, stream_id);
last_push_promise_stream_ = stream_id;
last_push_promise_promised_stream_ = promised_stream_id;
}
- virtual void OnContinuation(SpdyStreamId stream_id, bool end) override {
+ void OnContinuation(SpdyStreamId stream_id, bool end) override {
++continuation_count_;
}
- virtual void OnAltSvc(SpdyStreamId stream_id,
- uint32 max_age,
- uint16 port,
- StringPiece protocol_id,
- StringPiece host,
- StringPiece origin) override {
+ void OnAltSvc(SpdyStreamId stream_id,
+ uint32 max_age,
+ uint16 port,
+ StringPiece protocol_id,
+ StringPiece host,
+ StringPiece origin) override {
test_altsvc_ir_.set_stream_id(stream_id);
test_altsvc_ir_.set_max_age(max_age);
test_altsvc_ir_.set_port(port);
@@ -445,29 +433,29 @@
++altsvc_count_;
}
- virtual void OnPriority(SpdyStreamId stream_id,
- SpdyStreamId parent_stream_id,
- uint8 weight,
- bool exclusive) override {
+ void OnPriority(SpdyStreamId stream_id,
+ SpdyStreamId parent_stream_id,
+ uint8 weight,
+ bool exclusive) override {
++priority_count_;
}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
DLOG(INFO) << "Unknown frame type " << frame_type;
return on_unknown_frame_result_;
}
- virtual void OnSendCompressedFrame(SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t payload_len,
- size_t frame_len) override {
+ void OnSendCompressedFrame(SpdyStreamId stream_id,
+ SpdyFrameType type,
+ size_t payload_len,
+ size_t frame_len) override {
last_payload_len_ = payload_len;
last_frame_len_ = frame_len;
}
- virtual void OnReceiveCompressedFrame(SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t frame_len) override {
+ void OnReceiveCompressedFrame(SpdyStreamId stream_id,
+ SpdyFrameType type,
+ size_t frame_len) override {
last_frame_len_ = frame_len;
}
diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h
index fe3c87d..db84be1 100644
--- a/net/spdy/spdy_http_stream.h
+++ b/net/spdy/spdy_http_stream.h
@@ -32,7 +32,7 @@
public:
// |spdy_session| must not be NULL.
SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, bool direct);
- virtual ~SpdyHttpStream();
+ ~SpdyHttpStream() override;
SpdyStream* stream() { return stream_.get(); }
@@ -41,47 +41,45 @@
// HttpStream implementation.
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override;
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override;
- virtual int SendRequest(const HttpRequestHeaders& headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override;
- virtual UploadProgress GetUploadProgress() const override;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual void Close(bool not_reusable) override;
- virtual HttpStream* RenewStreamForAuth() override;
- virtual bool IsResponseBodyComplete() const override;
- virtual bool CanFindEndOfResponse() const override;
+ int SendRequest(const HttpRequestHeaders& headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override;
+ UploadProgress GetUploadProgress() const override;
+ int ReadResponseHeaders(const CompletionCallback& callback) override;
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void Close(bool not_reusable) override;
+ HttpStream* RenewStreamForAuth() override;
+ bool IsResponseBodyComplete() const override;
+ bool CanFindEndOfResponse() const override;
// Must not be called if a NULL SpdySession was pssed into the
// constructor.
- virtual bool IsConnectionReused() const override;
+ bool IsConnectionReused() const override;
- virtual void SetConnectionReused() override;
- virtual bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual bool GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) override;
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override;
- virtual bool IsSpdyHttpStream() const override;
- virtual void Drain(HttpNetworkSession* session) override;
- virtual void SetPriority(RequestPriority priority) override;
+ void SetConnectionReused() override;
+ bool IsConnectionReusable() const override;
+ int64 GetTotalReceivedBytes() const override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void GetSSLInfo(SSLInfo* ssl_info) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ bool IsSpdyHttpStream() const override;
+ void Drain(HttpNetworkSession* session) override;
+ void SetPriority(RequestPriority priority) override;
// SpdyStream::Delegate implementation.
- virtual void OnRequestHeadersSent() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ void OnRequestHeadersSent() override;
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
- virtual void OnDataSent() override;
- virtual void OnClose(int status) override;
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ void OnDataSent() override;
+ void OnClose(int status) override;
private:
// Must be called only when |request_info_| is non-NULL.
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index fc1b165..58dc73b 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -1545,7 +1545,7 @@
base::Unretained(this))) {
}
- virtual ~KillerCallback() {}
+ ~KillerCallback() override {}
const CompletionCallback& callback() const { return callback_; }
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index cb9bdfe..c408f0a 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -559,7 +559,7 @@
// to them.
class NET_EXPORT_PRIVATE SpdyFrameWithStreamIdIR : public SpdyFrameIR {
public:
- virtual ~SpdyFrameWithStreamIdIR() {}
+ ~SpdyFrameWithStreamIdIR() override {}
SpdyStreamId stream_id() const { return stream_id_; }
void set_stream_id(SpdyStreamId stream_id) {
DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
@@ -581,7 +581,7 @@
// flag. Implies SpdyFrameWithStreamIdIR.
class NET_EXPORT_PRIVATE SpdyFrameWithFinIR : public SpdyFrameWithStreamIdIR {
public:
- virtual ~SpdyFrameWithFinIR() {}
+ ~SpdyFrameWithFinIR() override {}
bool fin() const { return fin_; }
void set_fin(bool fin) { fin_ = fin; }
@@ -618,7 +618,7 @@
protected:
explicit SpdyFrameWithNameValueBlockIR(SpdyStreamId stream_id);
- virtual ~SpdyFrameWithNameValueBlockIR();
+ ~SpdyFrameWithNameValueBlockIR() override;
private:
SpdyNameValueBlock name_value_block_;
@@ -635,7 +635,7 @@
// Use in conjunction with SetDataShallow() for shallow-copy on data.
explicit SpdyDataIR(SpdyStreamId stream_id);
- virtual ~SpdyDataIR();
+ ~SpdyDataIR() override;
base::StringPiece data() const { return data_; }
@@ -663,7 +663,7 @@
data_ = data;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
// Used to store data that this SpdyDataIR should own.
@@ -698,7 +698,7 @@
unidirectional_ = unidirectional;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId associated_to_stream_id_;
@@ -713,7 +713,7 @@
explicit SpdySynReplyIR(SpdyStreamId stream_id)
: SpdyFrameWithNameValueBlockIR(stream_id) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
DISALLOW_COPY_AND_ASSIGN(SpdySynReplyIR);
@@ -724,7 +724,7 @@
SpdyRstStreamIR(SpdyStreamId stream_id, SpdyRstStreamStatus status,
base::StringPiece description);
- virtual ~SpdyRstStreamIR();
+ ~SpdyRstStreamIR() override;
SpdyRstStreamStatus status() const {
return status_;
@@ -739,7 +739,7 @@
description_ = description;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyRstStreamStatus status_;
@@ -763,7 +763,7 @@
SpdySettingsIR();
- virtual ~SpdySettingsIR();
+ ~SpdySettingsIR() override;
// Overwrites as appropriate.
const ValueMap& values() const { return values_; }
@@ -785,7 +785,7 @@
is_ack_ = is_ack;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
ValueMap values_;
@@ -804,7 +804,7 @@
bool is_ack() const { return is_ack_; }
void set_is_ack(bool is_ack) { is_ack_ = is_ack; }
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyPingId id_;
@@ -817,7 +817,7 @@
public:
SpdyGoAwayIR(SpdyStreamId last_good_stream_id, SpdyGoAwayStatus status,
const base::StringPiece& description);
- virtual ~SpdyGoAwayIR();
+ ~SpdyGoAwayIR() override;
SpdyStreamId last_good_stream_id() const { return last_good_stream_id_; }
void set_last_good_stream_id(SpdyStreamId last_good_stream_id) {
DCHECK_LE(0u, last_good_stream_id);
@@ -832,7 +832,7 @@
const base::StringPiece& description() const;
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId last_good_stream_id_;
@@ -849,7 +849,7 @@
has_priority_(false),
priority_(0) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
bool has_priority() const { return has_priority_; }
void set_has_priority(bool has_priority) { has_priority_ = has_priority; }
@@ -876,7 +876,7 @@
delta_ = delta;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
int32 delta_;
@@ -890,7 +890,7 @@
explicit SpdyBlockedIR(SpdyStreamId stream_id)
: SpdyFrameWithStreamIdIR(stream_id) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
DISALLOW_COPY_AND_ASSIGN(SpdyBlockedIR);
@@ -905,7 +905,7 @@
SpdyStreamId promised_stream_id() const { return promised_stream_id_; }
void set_promised_stream_id(SpdyStreamId id) { promised_stream_id_ = id; }
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId promised_stream_id_;
@@ -921,7 +921,7 @@
: SpdyFrameWithNameValueBlockIR(stream_id),
end_headers_(false) {}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
bool end_headers() const { return end_headers_; }
void set_end_headers(bool end_headers) {end_headers_ = end_headers;}
@@ -955,7 +955,7 @@
origin_ = origin;
}
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
uint32 max_age_;
@@ -980,7 +980,7 @@
bool exclusive() const { return exclusive_; }
void set_exclusive(bool exclusive) { exclusive_ = exclusive; }
- virtual void Visit(SpdyFrameVisitor* visitor) const override;
+ void Visit(SpdyFrameVisitor* visitor) const override;
private:
SpdyStreamId parent_stream_id_;
diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h
index 3b0736c..806af73 100644
--- a/net/spdy/spdy_proxy_client_socket.h
+++ b/net/spdy/spdy_proxy_client_socket.h
@@ -54,50 +54,49 @@
// On destruction Disconnect() is called.
- virtual ~SpdyProxyClientSocket();
+ ~SpdyProxyClientSocket() override;
// ProxyClientSocket methods:
- virtual const HttpResponseInfo* GetConnectResponseInfo() const override;
- virtual HttpStream* CreateConnectResponseStream() override;
- virtual const scoped_refptr<HttpAuthController>& GetAuthController() const
- override;
- virtual int RestartWithAuth(const CompletionCallback& callback) override;
- virtual bool IsUsingSpdy() const override;
- virtual NextProto GetProtocolNegotiated() const override;
+ const HttpResponseInfo* GetConnectResponseInfo() const override;
+ HttpStream* CreateConnectResponseStream() override;
+ const scoped_refptr<HttpAuthController>& GetAuthController() const override;
+ int RestartWithAuth(const CompletionCallback& callback) override;
+ bool IsUsingSpdy() const override;
+ NextProto GetProtocolNegotiated() const override;
// StreamSocket implementation.
- virtual int Connect(const CompletionCallback& callback) override;
- virtual void Disconnect() override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectedAndIdle() const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void SetSubresourceSpeculation() override;
- virtual void SetOmniboxSpeculation() override;
- virtual bool WasEverUsed() const override;
- virtual bool UsingTCPFastOpen() const override;
- virtual bool WasNpnNegotiated() const override;
- virtual NextProto GetNegotiatedProtocol() const override;
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override;
+ int Connect(const CompletionCallback& callback) override;
+ void Disconnect() override;
+ bool IsConnected() const override;
+ bool IsConnectedAndIdle() const override;
+ const BoundNetLog& NetLog() const override;
+ void SetSubresourceSpeculation() override;
+ void SetOmniboxSpeculation() override;
+ bool WasEverUsed() const override;
+ bool UsingTCPFastOpen() const override;
+ bool WasNpnNegotiated() const override;
+ NextProto GetNegotiatedProtocol() const override;
+ bool GetSSLInfo(SSLInfo* ssl_info) override;
// Socket implementation.
- virtual int Read(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
// SpdyStream::Delegate implementation.
- virtual void OnRequestHeadersSent() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ void OnRequestHeadersSent() override;
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
- virtual void OnDataSent() override;
- virtual void OnClose(int status) override;
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ void OnDataSent() override;
+ void OnClose(int status) override;
private:
enum State {
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index 13e6624..26785c6 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -1317,8 +1317,7 @@
base::Unretained(this))) {
}
- virtual ~DeleteSockCallback() {
- }
+ ~DeleteSockCallback() override {}
const CompletionCallback& callback() const { return callback_; }
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 293ed2b..ef2d8fe 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -250,7 +250,7 @@
const HostPortPair& trusted_spdy_proxy,
NetLog* net_log);
- virtual ~SpdySession();
+ ~SpdySession() override;
const HostPortPair& host_port_pair() const {
return spdy_session_key_.host_port_proxy_pair().first;
@@ -517,7 +517,7 @@
base::WeakPtr<SpdySession> GetWeakPtr();
// HigherLayeredPool implementation:
- virtual bool CloseOneIdleConnection() override;
+ bool CloseOneIdleConnection() override;
private:
friend class base::RefCounted<SpdySession>;
@@ -813,55 +813,49 @@
void DeleteExpiredPushedStreams();
// BufferedSpdyFramerVisitorInterface:
- virtual void OnError(SpdyFramer::SpdyError error_code) override;
- virtual void OnStreamError(SpdyStreamId stream_id,
- const std::string& description) override;
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override;
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override;
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override;
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override;
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override;
- virtual void OnSettings(bool clear_persisted) override;
- virtual void OnSetting(
- SpdySettingsIds id, uint8 flags, uint32 value) override;
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override;
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) override;
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional,
- const SpdyHeaderBlock& headers) override;
- virtual void OnSynReply(
- SpdyStreamId stream_id,
- bool fin,
- const SpdyHeaderBlock& headers) override;
- virtual void OnHeaders(
- SpdyStreamId stream_id,
- bool fin,
- const SpdyHeaderBlock& headers) override;
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
+ void OnError(SpdyFramer::SpdyError error_code) override;
+ void OnStreamError(SpdyStreamId stream_id,
+ const std::string& description) override;
+ void OnPing(SpdyPingId unique_id, bool is_ack) override;
+ void OnRstStream(SpdyStreamId stream_id, SpdyRstStreamStatus status) override;
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override;
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override;
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override;
+ void OnSettings(bool clear_persisted) override;
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override;
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override;
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ const SpdyHeaderBlock& headers) override;
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional,
+ const SpdyHeaderBlock& headers) override;
+ void OnSynReply(SpdyStreamId stream_id,
+ bool fin,
+ const SpdyHeaderBlock& headers) override;
+ void OnHeaders(SpdyStreamId stream_id,
+ bool fin,
+ const SpdyHeaderBlock& headers) override;
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override;
// SpdyFramerDebugVisitorInterface
- virtual void OnSendCompressedFrame(
- SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t payload_len,
- size_t frame_len) override;
- virtual void OnReceiveCompressedFrame(
- SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t frame_len) override;
+ void OnSendCompressedFrame(SpdyStreamId stream_id,
+ SpdyFrameType type,
+ size_t payload_len,
+ size_t frame_len) override;
+ void OnReceiveCompressedFrame(SpdyStreamId stream_id,
+ SpdyFrameType type,
+ size_t frame_len) override;
// Called when bytes are consumed from a SpdyBuffer for a DATA frame
// that is to be written or is being written. Increases the send
diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h
index de2ddfa..32b4ee3 100644
--- a/net/spdy/spdy_session_pool.h
+++ b/net/spdy/spdy_session_pool.h
@@ -61,7 +61,7 @@
size_t max_concurrent_streams_limit,
SpdySessionPool::TimeFunc time_func,
const std::string& trusted_spdy_proxy);
- virtual ~SpdySessionPool();
+ ~SpdySessionPool() override;
// In the functions below, a session is "available" if this pool has
// a reference to it and there is some SpdySessionKey for which
@@ -133,19 +133,19 @@
// We flush all idle sessions and release references to the active ones so
// they won't get re-used. The active ones will either complete successfully
// or error out due to the IP address change.
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
// SSLConfigService::Observer methods:
// We perform the same flushing as described above when SSL settings change.
- virtual void OnSSLConfigChanged() override;
+ void OnSSLConfigChanged() override;
// CertDatabase::Observer methods:
// We perform the same flushing as described above when certificate database
// is changed.
- virtual void OnCertAdded(const X509Certificate* cert) override;
- virtual void OnCACertChanged(const X509Certificate* cert) override;
+ void OnCertAdded(const X509Certificate* cert) override;
+ void OnCACertChanged(const X509Certificate* cert) override;
private:
friend class SpdySessionPoolPeer; // For testing.
diff --git a/net/spdy/spdy_session_pool_unittest.cc b/net/spdy/spdy_session_pool_unittest.cc
index 0a9903c..fef27bf 100644
--- a/net/spdy/spdy_session_pool_unittest.cc
+++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -62,20 +62,20 @@
: spdy_session_pool_(spdy_session_pool),
key_(key) {}
- virtual ~SessionOpeningDelegate() {}
+ ~SessionOpeningDelegate() override {}
- virtual void OnRequestHeadersSent() override {}
+ void OnRequestHeadersSent() override {}
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override {
return RESPONSE_HEADERS_ARE_COMPLETE;
}
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {}
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {}
- virtual void OnDataSent() override {}
+ void OnDataSent() override {}
- virtual void OnClose(int status) override {
+ void OnClose(int status) override {
ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_));
}
diff --git a/net/spdy/spdy_session_test_util.h b/net/spdy/spdy_session_test_util.h
index cc3f136..dcb1733 100644
--- a/net/spdy/spdy_session_test_util.h
+++ b/net/spdy/spdy_session_test_util.h
@@ -26,11 +26,11 @@
// function = "DoFoo"
SpdySessionTestTaskObserver(const std::string& file_name,
const std::string& function_name);
- virtual ~SpdySessionTestTaskObserver();
+ ~SpdySessionTestTaskObserver() override;
// Implements MessageLoop::TaskObserver.
- virtual void WillProcessTask(const base::PendingTask& pending_task) override;
- virtual void DidProcessTask(const base::PendingTask& pending_task) override;
+ void WillProcessTask(const base::PendingTask& pending_task) override;
+ void DidProcessTask(const base::PendingTask& pending_task) override;
// Returns the number of tasks posted by the given function and file.
uint16 executed_count() const { return executed_count_; }
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 914f6fe..e56d9ef 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -207,7 +207,7 @@
public:
StreamRequestDestroyingCallback() {}
- virtual ~StreamRequestDestroyingCallback() {}
+ ~StreamRequestDestroyingCallback() override {}
void SetRequestToDestroy(scoped_ptr<SpdyStreamRequest> request) {
request_ = request.Pass();
@@ -2303,9 +2303,9 @@
: StreamDelegateDoNothing(stream),
session_to_close_(session_to_close) {}
- virtual ~SessionClosingDelegate() {}
+ ~SessionClosingDelegate() override {}
- virtual void OnClose(int status) override {
+ void OnClose(int status) override {
session_to_close_->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error");
}
@@ -3379,9 +3379,9 @@
: StreamDelegateDoNothing(stream),
session_(session) {}
- virtual ~StreamCreatingDelegate() {}
+ ~StreamCreatingDelegate() override {}
- virtual void OnClose(int status) override {
+ void OnClose(int status) override {
GURL url(kDefaultURL);
ignore_result(
CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM,
@@ -3658,10 +3658,10 @@
base::StringPiece data)
: StreamDelegateSendImmediate(stream, data) {}
- virtual ~DropReceivedDataDelegate() {}
+ ~DropReceivedDataDelegate() override {}
// Drop any received data.
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {}
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {}
};
// Send data back and forth but use a delegate that drops its received
@@ -4243,13 +4243,13 @@
base::StringPiece data)
: StreamDelegateWithBody(stream, data) {}
- virtual ~StreamClosingDelegate() {}
+ ~StreamClosingDelegate() override {}
void set_stream_to_close(const base::WeakPtr<SpdyStream>& stream_to_close) {
stream_to_close_ = stream_to_close;
}
- virtual void OnDataSent() override {
+ void OnDataSent() override {
test::StreamDelegateWithBody::OnDataSent();
if (stream_to_close_.get()) {
stream_to_close_->Close();
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 6de0a39..e7dcd5b 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -61,9 +61,9 @@
DCHECK(stream_.get());
}
- virtual ~SynStreamBufferProducer() {}
+ ~SynStreamBufferProducer() override {}
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() override {
+ scoped_ptr<SpdyBuffer> ProduceBuffer() override {
if (!stream_.get()) {
NOTREACHED();
return scoped_ptr<SpdyBuffer>();
diff --git a/net/spdy/spdy_stream_test_util.h b/net/spdy/spdy_stream_test_util.h
index 7df12e8..16f4efb 100644
--- a/net/spdy/spdy_stream_test_util.h
+++ b/net/spdy/spdy_stream_test_util.h
@@ -23,15 +23,15 @@
class ClosingDelegate : public SpdyStream::Delegate {
public:
explicit ClosingDelegate(const base::WeakPtr<SpdyStream>& stream);
- virtual ~ClosingDelegate();
+ ~ClosingDelegate() override;
// SpdyStream::Delegate implementation.
- virtual void OnRequestHeadersSent() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ void OnRequestHeadersSent() override;
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
- virtual void OnDataSent() override;
- virtual void OnClose(int status) override;
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ void OnDataSent() override;
+ void OnClose(int status) override;
// Returns whether or not the stream is closed.
bool StreamIsClosed() const { return !stream_.get(); }
@@ -45,14 +45,14 @@
class StreamDelegateBase : public SpdyStream::Delegate {
public:
explicit StreamDelegateBase(const base::WeakPtr<SpdyStream>& stream);
- virtual ~StreamDelegateBase();
+ ~StreamDelegateBase() override;
- virtual void OnRequestHeadersSent() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ void OnRequestHeadersSent() override;
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
- virtual void OnDataSent() override;
- virtual void OnClose(int status) override;
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ void OnDataSent() override;
+ void OnClose(int status) override;
// Waits for the stream to be closed and returns the status passed
// to OnClose().
@@ -89,7 +89,7 @@
class StreamDelegateDoNothing : public StreamDelegateBase {
public:
StreamDelegateDoNothing(const base::WeakPtr<SpdyStream>& stream);
- virtual ~StreamDelegateDoNothing();
+ ~StreamDelegateDoNothing() override;
};
// Test delegate that sends data immediately in OnResponseHeadersUpdated().
@@ -98,9 +98,9 @@
// |data| can be NULL.
StreamDelegateSendImmediate(const base::WeakPtr<SpdyStream>& stream,
base::StringPiece data);
- virtual ~StreamDelegateSendImmediate();
+ ~StreamDelegateSendImmediate() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
private:
@@ -112,9 +112,9 @@
public:
StreamDelegateWithBody(const base::WeakPtr<SpdyStream>& stream,
base::StringPiece data);
- virtual ~StreamDelegateWithBody();
+ ~StreamDelegateWithBody() override;
- virtual void OnRequestHeadersSent() override;
+ void OnRequestHeadersSent() override;
private:
scoped_refptr<StringIOBuffer> buf_;
@@ -124,9 +124,9 @@
class StreamDelegateCloseOnHeaders : public StreamDelegateBase {
public:
StreamDelegateCloseOnHeaders(const base::WeakPtr<SpdyStream>& stream);
- virtual ~StreamDelegateCloseOnHeaders();
+ ~StreamDelegateCloseOnHeaders() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
};
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 2e1aba5..baa3548 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -208,50 +208,49 @@
class PriorityGetter : public BufferedSpdyFramerVisitorInterface {
public:
PriorityGetter() : priority_(0) {}
- virtual ~PriorityGetter() {}
+ ~PriorityGetter() override {}
SpdyPriority priority() const {
return priority_;
}
- virtual void OnError(SpdyFramer::SpdyError error_code) override {}
- virtual void OnStreamError(SpdyStreamId stream_id,
- const std::string& description) override {}
- virtual void OnSynStream(SpdyStreamId stream_id,
- SpdyStreamId associated_stream_id,
- SpdyPriority priority,
- bool fin,
- bool unidirectional,
- const SpdyHeaderBlock& headers) override {
+ void OnError(SpdyFramer::SpdyError error_code) override {}
+ void OnStreamError(SpdyStreamId stream_id,
+ const std::string& description) override {}
+ void OnSynStream(SpdyStreamId stream_id,
+ SpdyStreamId associated_stream_id,
+ SpdyPriority priority,
+ bool fin,
+ bool unidirectional,
+ const SpdyHeaderBlock& headers) override {
priority_ = priority;
}
- virtual void OnSynReply(SpdyStreamId stream_id,
- bool fin,
- const SpdyHeaderBlock& headers) override {}
- virtual void OnHeaders(SpdyStreamId stream_id,
- bool fin,
- const SpdyHeaderBlock& headers) override {}
- virtual void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override {}
- virtual void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len,
- bool fin) override {}
- virtual void OnSettings(bool clear_persisted) override {}
- virtual void OnSetting(
- SpdySettingsIds id, uint8 flags, uint32 value) override {}
- virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {}
- virtual void OnRstStream(SpdyStreamId stream_id,
- SpdyRstStreamStatus status) override {}
- virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyGoAwayStatus status) override {}
- virtual void OnWindowUpdate(SpdyStreamId stream_id,
- uint32 delta_window_size) override {}
- virtual void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- const SpdyHeaderBlock& headers) override {}
- virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
+ void OnSynReply(SpdyStreamId stream_id,
+ bool fin,
+ const SpdyHeaderBlock& headers) override {}
+ void OnHeaders(SpdyStreamId stream_id,
+ bool fin,
+ const SpdyHeaderBlock& headers) override {}
+ void OnDataFrameHeader(SpdyStreamId stream_id,
+ size_t length,
+ bool fin) override {}
+ void OnStreamFrameData(SpdyStreamId stream_id,
+ const char* data,
+ size_t len,
+ bool fin) override {}
+ void OnSettings(bool clear_persisted) override {}
+ void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {}
+ void OnPing(SpdyPingId unique_id, bool is_ack) override {}
+ void OnRstStream(SpdyStreamId stream_id,
+ SpdyRstStreamStatus status) override {}
+ void OnGoAway(SpdyStreamId last_accepted_stream_id,
+ SpdyGoAwayStatus status) override {}
+ void OnWindowUpdate(SpdyStreamId stream_id,
+ uint32 delta_window_size) override {}
+ void OnPushPromise(SpdyStreamId stream_id,
+ SpdyStreamId promised_stream_id,
+ const SpdyHeaderBlock& headers) override {}
+ bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override {
return false;
}
@@ -613,46 +612,46 @@
: MockClientSocket(BoundNetLog()),
read_result_(read_result) {}
- virtual ~FakeSpdySessionClientSocket() {}
+ ~FakeSpdySessionClientSocket() override {}
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return read_result_;
}
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override {
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
// Return kProtoUnknown to use the pool's default protocol.
- virtual NextProto GetNegotiatedProtocol() const override {
- return kProtoUnknown;
- }
+ NextProto GetNegotiatedProtocol() const override { return kProtoUnknown; }
// The functions below are not expected to be called.
- virtual int Connect(const CompletionCallback& callback) override {
+ int Connect(const CompletionCallback& callback) override {
ADD_FAILURE();
return ERR_UNEXPECTED;
}
- virtual bool WasEverUsed() const override {
+ bool WasEverUsed() const override {
ADD_FAILURE();
return false;
}
- virtual bool UsingTCPFastOpen() const override {
+ bool UsingTCPFastOpen() const override {
ADD_FAILURE();
return false;
}
- virtual bool WasNpnNegotiated() const override {
+ bool WasNpnNegotiated() const override {
ADD_FAILURE();
return false;
}
- virtual bool GetSSLInfo(SSLInfo* ssl_info) override {
+ bool GetSSLInfo(SSLInfo* ssl_info) override {
ADD_FAILURE();
return false;
}
diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h
index 897f670..e91800d 100644
--- a/net/spdy/spdy_test_util_common.h
+++ b/net/spdy/spdy_test_util_common.h
@@ -125,7 +125,7 @@
public:
StreamReleaserCallback();
- virtual ~StreamReleaserCallback();
+ ~StreamReleaserCallback() override;
// Returns a callback that releases |request|'s stream.
CompletionCallback MakeCallback(SpdyStreamRequest* request);
@@ -157,11 +157,11 @@
explicit MockECSignatureCreator(crypto::ECPrivateKey* key);
// crypto::ECSignatureCreator
- virtual bool Sign(const uint8* data,
- int data_len,
- std::vector<uint8>* signature) override;
- virtual bool DecodeSignature(const std::vector<uint8>& signature,
- std::vector<uint8>* out_raw_sig) override;
+ bool Sign(const uint8* data,
+ int data_len,
+ std::vector<uint8>* signature) override;
+ bool DecodeSignature(const std::vector<uint8>& signature,
+ std::vector<uint8>* out_raw_sig) override;
private:
crypto::ECPrivateKey* key_;
@@ -173,11 +173,10 @@
class MockECSignatureCreatorFactory : public crypto::ECSignatureCreatorFactory {
public:
MockECSignatureCreatorFactory();
- virtual ~MockECSignatureCreatorFactory();
+ ~MockECSignatureCreatorFactory() override;
// crypto::ECSignatureCreatorFactory
- virtual crypto::ECSignatureCreator* Create(
- crypto::ECPrivateKey* key) override;
+ crypto::ECSignatureCreator* Create(crypto::ECPrivateKey* key) override;
private:
DISALLOW_COPY_AND_ASSIGN(MockECSignatureCreatorFactory);
@@ -232,7 +231,7 @@
SpdyURLRequestContext(NextProto protocol,
bool force_spdy_over_ssl,
bool force_spdy_always);
- virtual ~SpdyURLRequestContext();
+ ~SpdyURLRequestContext() override;
MockClientSocketFactory& socket_factory() { return socket_factory_; }
diff --git a/net/spdy/spdy_websocket_stream.h b/net/spdy/spdy_websocket_stream.h
index 66a89e8..854afbf 100644
--- a/net/spdy/spdy_websocket_stream.h
+++ b/net/spdy/spdy_websocket_stream.h
@@ -60,7 +60,7 @@
SpdyWebSocketStream(const base::WeakPtr<SpdySession>& spdy_session,
Delegate* delegate);
- virtual ~SpdyWebSocketStream();
+ ~SpdyWebSocketStream() override;
// Initializes SPDY stream for the WebSocket.
// It might create SPDY stream asynchronously. In this case, this method
@@ -75,12 +75,12 @@
void Close();
// SpdyStream::Delegate
- virtual void OnRequestHeadersSent() override;
- virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated(
+ void OnRequestHeadersSent() override;
+ SpdyResponseHeadersStatus OnResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
- virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
- virtual void OnDataSent() override;
- virtual void OnClose(int status) override;
+ void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
+ void OnDataSent() override;
+ void OnClose(int status) override;
private:
friend class SpdyWebSocketStreamTest;
diff --git a/net/spdy/spdy_websocket_stream_unittest.cc b/net/spdy/spdy_websocket_stream_unittest.cc
index 5941bdf..fd94969 100644
--- a/net/spdy/spdy_websocket_stream_unittest.cc
+++ b/net/spdy/spdy_websocket_stream_unittest.cc
@@ -51,7 +51,7 @@
public:
explicit SpdyWebSocketStreamEventRecorder(const CompletionCallback& callback)
: callback_(callback) {}
- virtual ~SpdyWebSocketStreamEventRecorder() {}
+ ~SpdyWebSocketStreamEventRecorder() override {}
typedef base::Callback<void(SpdyWebSocketStreamEvent*)> StreamEventCallback;
@@ -74,7 +74,7 @@
on_close_ = callback;
}
- virtual void OnCreatedSpdyStream(int result) override {
+ void OnCreatedSpdyStream(int result) override {
events_.push_back(
SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_CREATED,
SpdyHeaderBlock(),
@@ -83,7 +83,7 @@
if (!on_created_.is_null())
on_created_.Run(&events_.back());
}
- virtual void OnSentSpdyHeaders() override {
+ void OnSentSpdyHeaders() override {
events_.push_back(
SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_SENT_HEADERS,
SpdyHeaderBlock(),
@@ -92,7 +92,7 @@
if (!on_sent_data_.is_null())
on_sent_data_.Run(&events_.back());
}
- virtual void OnSpdyResponseHeadersUpdated(
+ void OnSpdyResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override {
events_.push_back(
SpdyWebSocketStreamEvent(
@@ -103,7 +103,7 @@
if (!on_received_header_.is_null())
on_received_header_.Run(&events_.back());
}
- virtual void OnSentSpdyData(size_t bytes_sent) override {
+ void OnSentSpdyData(size_t bytes_sent) override {
events_.push_back(
SpdyWebSocketStreamEvent(
SpdyWebSocketStreamEvent::EVENT_SENT_DATA,
@@ -113,7 +113,7 @@
if (!on_sent_data_.is_null())
on_sent_data_.Run(&events_.back());
}
- virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override {
+ void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override {
std::string buffer_data;
size_t buffer_len = 0;
if (buffer) {
@@ -129,7 +129,7 @@
if (!on_received_data_.is_null())
on_received_data_.Run(&events_.back());
}
- virtual void OnCloseSpdyStream() override {
+ void OnCloseSpdyStream() override {
events_.push_back(
SpdyWebSocketStreamEvent(
SpdyWebSocketStreamEvent::EVENT_CLOSE,
diff --git a/net/spdy/spdy_write_queue_unittest.cc b/net/spdy/spdy_write_queue_unittest.cc
index cb24d12..a2b1435 100644
--- a/net/spdy/spdy_write_queue_unittest.cc
+++ b/net/spdy/spdy_write_queue_unittest.cc
@@ -59,9 +59,7 @@
base::Bind(RequeingBufferProducer::ConsumeCallback, queue));
}
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() override {
- return buffer_.Pass();
- }
+ scoped_ptr<SpdyBuffer> ProduceBuffer() override { return buffer_.Pass(); }
static void ConsumeCallback(SpdyWriteQueue* queue,
size_t size,
diff --git a/net/ssl/channel_id_service_unittest.cc b/net/ssl/channel_id_service_unittest.cc
index 52083e8..b5fc006 100644
--- a/net/ssl/channel_id_service_unittest.cc
+++ b/net/ssl/channel_id_service_unittest.cc
@@ -35,16 +35,16 @@
public:
FailingTaskRunner() {}
- virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) override {
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override {
return false;
}
- virtual bool RunsTasksOnCurrentThread() const override { return true; }
+ bool RunsTasksOnCurrentThread() const override { return true; }
protected:
- virtual ~FailingTaskRunner() {}
+ ~FailingTaskRunner() override {}
private:
DISALLOW_COPY_AND_ASSIGN(FailingTaskRunner);
@@ -56,21 +56,21 @@
MockChannelIDStoreWithAsyncGet()
: DefaultChannelIDStore(NULL), channel_id_count_(0) {}
- virtual int GetChannelID(const std::string& server_identifier,
- base::Time* expiration_time,
- std::string* private_key_result,
- std::string* cert_result,
- const GetChannelIDCallback& callback) override;
+ int GetChannelID(const std::string& server_identifier,
+ base::Time* expiration_time,
+ std::string* private_key_result,
+ std::string* cert_result,
+ const GetChannelIDCallback& callback) override;
- virtual void SetChannelID(const std::string& server_identifier,
- base::Time creation_time,
- base::Time expiration_time,
- const std::string& private_key,
- const std::string& cert) override {
+ void SetChannelID(const std::string& server_identifier,
+ base::Time creation_time,
+ base::Time expiration_time,
+ const std::string& private_key,
+ const std::string& cert) override {
channel_id_count_ = 1;
}
- virtual int GetChannelIDCount() override { return channel_id_count_; }
+ int GetChannelIDCount() override { return channel_id_count_; }
void CallGetChannelIDCallbackWithResult(int err,
base::Time expiration_time,
diff --git a/net/ssl/client_cert_store_mac.h b/net/ssl/client_cert_store_mac.h
index 5c697db..23e3a2f 100644
--- a/net/ssl/client_cert_store_mac.h
+++ b/net/ssl/client_cert_store_mac.h
@@ -17,12 +17,12 @@
class NET_EXPORT ClientCertStoreMac : public ClientCertStore {
public:
ClientCertStoreMac();
- virtual ~ClientCertStoreMac();
+ ~ClientCertStoreMac() override;
// ClientCertStore:
- virtual void GetClientCerts(const SSLCertRequestInfo& cert_request_info,
- CertificateList* selected_certs,
- const base::Closure& callback) override;
+ void GetClientCerts(const SSLCertRequestInfo& cert_request_info,
+ CertificateList* selected_certs,
+ const base::Closure& callback) override;
private:
friend class ClientCertStoreMacTest;
diff --git a/net/ssl/default_channel_id_store.cc b/net/ssl/default_channel_id_store.cc
index 4f43fbc..b71d7b3 100644
--- a/net/ssl/default_channel_id_store.cc
+++ b/net/ssl/default_channel_id_store.cc
@@ -41,8 +41,8 @@
public:
GetChannelIDTask(const std::string& server_identifier,
const GetChannelIDCallback& callback);
- virtual ~GetChannelIDTask();
- virtual void Run(DefaultChannelIDStore* store) override;
+ ~GetChannelIDTask() override;
+ void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
@@ -83,8 +83,8 @@
base::Time expiration_time,
const std::string& private_key,
const std::string& cert);
- virtual ~SetChannelIDTask();
- virtual void Run(DefaultChannelIDStore* store) override;
+ ~SetChannelIDTask() override;
+ void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
@@ -123,8 +123,8 @@
public:
DeleteChannelIDTask(const std::string& server_identifier,
const base::Closure& callback);
- virtual ~DeleteChannelIDTask();
- virtual void Run(DefaultChannelIDStore* store) override;
+ ~DeleteChannelIDTask() override;
+ void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
@@ -158,8 +158,8 @@
DeleteAllCreatedBetweenTask(base::Time delete_begin,
base::Time delete_end,
const base::Closure& callback);
- virtual ~DeleteAllCreatedBetweenTask();
- virtual void Run(DefaultChannelIDStore* store) override;
+ ~DeleteAllCreatedBetweenTask() override;
+ void Run(DefaultChannelIDStore* store) override;
private:
base::Time delete_begin_;
@@ -194,8 +194,8 @@
: public DefaultChannelIDStore::Task {
public:
explicit GetAllChannelIDsTask(const GetChannelIDListCallback& callback);
- virtual ~GetAllChannelIDsTask();
- virtual void Run(DefaultChannelIDStore* store) override;
+ ~GetAllChannelIDsTask() override;
+ void Run(DefaultChannelIDStore* store) override;
private:
std::string server_identifier_;
diff --git a/net/ssl/default_channel_id_store.h b/net/ssl/default_channel_id_store.h
index 3882c1f..9b98637 100644
--- a/net/ssl/default_channel_id_store.h
+++ b/net/ssl/default_channel_id_store.h
@@ -41,33 +41,28 @@
// backing store will be updated.
explicit DefaultChannelIDStore(PersistentStore* store);
- virtual ~DefaultChannelIDStore();
+ ~DefaultChannelIDStore() override;
// ChannelIDStore implementation.
- virtual int GetChannelID(
- const std::string& server_identifier,
- base::Time* expiration_time,
- std::string* private_key_result,
- std::string* cert_result,
- const GetChannelIDCallback& callback) override;
- virtual void SetChannelID(
- const std::string& server_identifier,
- base::Time creation_time,
- base::Time expiration_time,
- const std::string& private_key,
- const std::string& cert) override;
- virtual void DeleteChannelID(
- const std::string& server_identifier,
- const base::Closure& callback) override;
- virtual void DeleteAllCreatedBetween(
- base::Time delete_begin,
- base::Time delete_end,
- const base::Closure& callback) override;
- virtual void DeleteAll(const base::Closure& callback) override;
- virtual void GetAllChannelIDs(
- const GetChannelIDListCallback& callback) override;
- virtual int GetChannelIDCount() override;
- virtual void SetForceKeepSessionState() override;
+ int GetChannelID(const std::string& server_identifier,
+ base::Time* expiration_time,
+ std::string* private_key_result,
+ std::string* cert_result,
+ const GetChannelIDCallback& callback) override;
+ void SetChannelID(const std::string& server_identifier,
+ base::Time creation_time,
+ base::Time expiration_time,
+ const std::string& private_key,
+ const std::string& cert) override;
+ void DeleteChannelID(const std::string& server_identifier,
+ const base::Closure& callback) override;
+ void DeleteAllCreatedBetween(base::Time delete_begin,
+ base::Time delete_end,
+ const base::Closure& callback) override;
+ void DeleteAll(const base::Closure& callback) override;
+ void GetAllChannelIDs(const GetChannelIDListCallback& callback) override;
+ int GetChannelIDCount() override;
+ void SetForceKeepSessionState() override;
private:
class Task;
diff --git a/net/ssl/default_channel_id_store_unittest.cc b/net/ssl/default_channel_id_store_unittest.cc
index 9429753..ae27a19 100644
--- a/net/ssl/default_channel_id_store_unittest.cc
+++ b/net/ssl/default_channel_id_store_unittest.cc
@@ -69,15 +69,15 @@
MockPersistentStore();
// DefaultChannelIDStore::PersistentStore implementation.
- virtual void Load(const LoadedCallback& loaded_callback) override;
- virtual void AddChannelID(
+ void Load(const LoadedCallback& loaded_callback) override;
+ void AddChannelID(
const DefaultChannelIDStore::ChannelID& channel_id) override;
- virtual void DeleteChannelID(
+ void DeleteChannelID(
const DefaultChannelIDStore::ChannelID& channel_id) override;
- virtual void SetForceKeepSessionState() override;
+ void SetForceKeepSessionState() override;
protected:
- virtual ~MockPersistentStore();
+ ~MockPersistentStore() override;
private:
typedef std::map<std::string, DefaultChannelIDStore::ChannelID>
diff --git a/net/ssl/ssl_client_auth_cache.h b/net/ssl/ssl_client_auth_cache.h
index 4ee47ed..53d5312 100644
--- a/net/ssl/ssl_client_auth_cache.h
+++ b/net/ssl/ssl_client_auth_cache.h
@@ -28,7 +28,7 @@
class NET_EXPORT_PRIVATE SSLClientAuthCache : public CertDatabase::Observer {
public:
SSLClientAuthCache();
- virtual ~SSLClientAuthCache();
+ ~SSLClientAuthCache() override;
// Checks for a client certificate preference for SSL server at |server|.
// Returns true if a preference is found, and sets |*certificate| to the
@@ -48,7 +48,7 @@
void Remove(const HostPortPair& server);
// CertDatabase::Observer methods:
- virtual void OnCertAdded(const X509Certificate* cert) override;
+ void OnCertAdded(const X509Certificate* cert) override;
private:
typedef HostPortPair AuthCacheKey;
diff --git a/net/ssl/ssl_config_service_defaults.h b/net/ssl/ssl_config_service_defaults.h
index ff58029..de867da 100644
--- a/net/ssl/ssl_config_service_defaults.h
+++ b/net/ssl/ssl_config_service_defaults.h
@@ -18,10 +18,10 @@
SSLConfigServiceDefaults();
// Store default SSL config settings in |config|.
- virtual void GetSSLConfig(SSLConfig* config) override;
+ void GetSSLConfig(SSLConfig* config) override;
private:
- virtual ~SSLConfigServiceDefaults();
+ ~SSLConfigServiceDefaults() override;
// Default value of prefs.
const SSLConfig default_config_;
diff --git a/net/ssl/ssl_config_service_unittest.cc b/net/ssl/ssl_config_service_unittest.cc
index 0d9659c..7306c68 100644
--- a/net/ssl/ssl_config_service_unittest.cc
+++ b/net/ssl/ssl_config_service_unittest.cc
@@ -19,9 +19,7 @@
explicit MockSSLConfigService(const SSLConfig& config) : config_(config) {}
// SSLConfigService implementation
- virtual void GetSSLConfig(SSLConfig* config) override {
- *config = config_;
- }
+ void GetSSLConfig(SSLConfig* config) override { *config = config_; }
// Sets the SSLConfig to be returned by GetSSLConfig and processes any
// updates.
@@ -32,7 +30,7 @@
}
private:
- virtual ~MockSSLConfigService() {}
+ ~MockSSLConfigService() override {}
SSLConfig config_;
};
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 98f50b6..63d8024 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -32,7 +32,7 @@
: headers_(headers), contents_(contents) {
}
- virtual std::string ToResponseString() const override {
+ std::string ToResponseString() const override {
return headers_ + "\r\n" + contents_;
}
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index fc9f554..9123a51 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -35,7 +35,7 @@
public:
HttpListenSocket(const SocketDescriptor socket_descriptor,
StreamListenSocket::Delegate* delegate);
- virtual ~HttpListenSocket();
+ ~HttpListenSocket() override;
virtual void Listen();
// Listen on the current IO thread. If the IO thread has changed since this
@@ -106,7 +106,7 @@
// Creates a http test server. InitializeAndWaitUntilReady() must be called
// to start the server.
EmbeddedTestServer();
- virtual ~EmbeddedTestServer();
+ ~EmbeddedTestServer() override;
// Initializes and waits until the server is ready to accept requests.
bool InitializeAndWaitUntilReady() WARN_UNUSED_RESULT;
@@ -166,12 +166,12 @@
scoped_ptr<HttpRequest> request);
// StreamListenSocket::Delegate overrides:
- virtual void DidAccept(StreamListenSocket* server,
- scoped_ptr<StreamListenSocket> connection) override;
- virtual void DidRead(StreamListenSocket* connection,
- const char* data,
- int length) override;
- virtual void DidClose(StreamListenSocket* connection) override;
+ void DidAccept(StreamListenSocket* server,
+ scoped_ptr<StreamListenSocket> connection) override;
+ void DidRead(StreamListenSocket* connection,
+ const char* data,
+ int length) override;
+ void DidClose(StreamListenSocket* connection) override;
HttpConnection* FindConnection(StreamListenSocket* socket);
diff --git a/net/test/embedded_test_server/embedded_test_server_unittest.cc b/net/test/embedded_test_server/embedded_test_server_unittest.cc
index 6a1df6e..bbe321b 100644
--- a/net/test/embedded_test_server/embedded_test_server_unittest.cc
+++ b/net/test/embedded_test_server/embedded_test_server_unittest.cc
@@ -66,7 +66,7 @@
}
// URLFetcherDelegate override.
- virtual void OnURLFetchComplete(const URLFetcher* source) override {
+ void OnURLFetchComplete(const URLFetcher* source) override {
++num_responses_received_;
if (num_responses_received_ == num_responses_expected_)
base::MessageLoop::current()->Quit();
@@ -260,7 +260,7 @@
message_loop_present_on_shutdown_(message_loop_present_on_shutdown) {}
// base::PlatformThread::Delegate:
- virtual void ThreadMain() override {
+ void ThreadMain() override {
scoped_refptr<base::SingleThreadTaskRunner> io_thread_runner;
base::Thread io_thread("io_thread");
base::Thread::Options thread_options;
@@ -298,7 +298,7 @@
}
// URLFetcherDelegate override.
- virtual void OnURLFetchComplete(const URLFetcher* source) override {
+ void OnURLFetchComplete(const URLFetcher* source) override {
base::MessageLoop::current()->Quit();
}
diff --git a/net/test/embedded_test_server/http_response.h b/net/test/embedded_test_server/http_response.h
index 2172354..821c027 100644
--- a/net/test/embedded_test_server/http_response.h
+++ b/net/test/embedded_test_server/http_response.h
@@ -32,7 +32,7 @@
class BasicHttpResponse : public HttpResponse {
public:
BasicHttpResponse();
- virtual ~BasicHttpResponse();
+ ~BasicHttpResponse() override;
// The response code.
HttpStatusCode code() const { return code_; }
@@ -54,7 +54,7 @@
}
// Generates and returns a http response string.
- virtual std::string ToResponseString() const override;
+ std::string ToResponseString() const override;
private:
HttpStatusCode code_;
diff --git a/net/test/net_test_suite.h b/net/test/net_test_suite.h
index 1a400d4..e0f601e 100644
--- a/net/test/net_test_suite.h
+++ b/net/test/net_test_suite.h
@@ -21,11 +21,11 @@
class NetTestSuite : public base::TestSuite {
public:
NetTestSuite(int argc, char** argv);
- virtual ~NetTestSuite();
+ ~NetTestSuite() override;
- virtual void Initialize() override;
+ void Initialize() override;
- virtual void Shutdown() override;
+ void Shutdown() override;
protected:
// This constructor is only accessible to specialized net test
diff --git a/net/test/spawned_test_server/local_test_server.h b/net/test/spawned_test_server/local_test_server.h
index a719598..37b1185 100644
--- a/net/test/spawned_test_server/local_test_server.h
+++ b/net/test/spawned_test_server/local_test_server.h
@@ -38,7 +38,7 @@
const SSLOptions& ssl_options,
const base::FilePath& document_root);
- virtual ~LocalTestServer();
+ ~LocalTestServer() override;
// Start the test server and block until it's ready. Returns true on success.
bool Start() WARN_UNUSED_RESULT;
diff --git a/net/test/spawned_test_server/local_test_server_posix.cc b/net/test/spawned_test_server/local_test_server_posix.cc
index 64c9b44..0edbedf 100644
--- a/net/test/spawned_test_server/local_test_server_posix.cc
+++ b/net/test/spawned_test_server/local_test_server_posix.cc
@@ -34,7 +34,7 @@
: path_string_(path_string),
port_string_(port_string) {}
- virtual bool Includes(const base::ProcessEntry& entry) const override {
+ bool Includes(const base::ProcessEntry& entry) const override {
if (entry.parent_pid() != 1)
return false;
bool found_path_string = false;
diff --git a/net/test/url_request/url_request_failed_job.h b/net/test/url_request/url_request_failed_job.h
index ea35116..4307f91 100644
--- a/net/test/url_request/url_request_failed_job.h
+++ b/net/test/url_request/url_request_failed_job.h
@@ -22,7 +22,7 @@
NetworkDelegate* network_delegate,
int net_error);
- virtual void Start() override;
+ void Start() override;
// Adds the testing URLs to the URLRequestFilter.
static void AddUrlHandler();
@@ -42,7 +42,7 @@
const std::string& hostname);
protected:
- virtual ~URLRequestFailedJob();
+ ~URLRequestFailedJob() override;
private:
static URLRequestJob* Factory(URLRequest* request,
diff --git a/net/test/url_request/url_request_mock_http_job.cc b/net/test/url_request/url_request_mock_http_job.cc
index c611f36..5542ac7 100644
--- a/net/test/url_request/url_request_mock_http_job.cc
+++ b/net/test/url_request/url_request_mock_http_job.cc
@@ -37,10 +37,10 @@
: base_path_(base_path),
map_all_requests_to_base_path_(map_all_requests_to_base_path),
worker_pool_(worker_pool) {}
- virtual ~MockJobInterceptor() {}
+ ~MockJobInterceptor() override {}
// net::URLRequestJobFactory::ProtocolHandler implementation
- virtual net::URLRequestJob* MaybeInterceptRequest(
+ net::URLRequestJob* MaybeInterceptRequest(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override {
return new URLRequestMockHTTPJob(
diff --git a/net/test/url_request/url_request_mock_http_job.h b/net/test/url_request/url_request_mock_http_job.h
index eb68a2d..1a01a30 100644
--- a/net/test/url_request/url_request_mock_http_job.h
+++ b/net/test/url_request/url_request_mock_http_job.h
@@ -34,13 +34,12 @@
const base::FilePath& file_path,
const scoped_refptr<base::TaskRunner>& task_runner);
- virtual void Start() override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual int GetResponseCode() const override;
- virtual bool GetCharset(std::string* charset) override;
- virtual void GetResponseInfo(HttpResponseInfo* info) override;
- virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) override;
+ void Start() override;
+ bool GetMimeType(std::string* mime_type) const override;
+ int GetResponseCode() const override;
+ bool GetCharset(std::string* charset) override;
+ void GetResponseInfo(HttpResponseInfo* info) override;
+ bool IsRedirectResponse(GURL* location, int* http_status_code) override;
// Adds the testing URLs to the URLRequestFilter.
static void AddUrlHandler(
@@ -74,7 +73,7 @@
const scoped_refptr<base::SequencedWorkerPool>& worker_pool);
protected:
- virtual ~URLRequestMockHTTPJob();
+ ~URLRequestMockHTTPJob() override;
private:
void GetResponseInfoConst(HttpResponseInfo* info) const;
diff --git a/net/tools/balsa/balsa_frame.h b/net/tools/balsa/balsa_frame.h
index 73c3dd9..5198dd1 100644
--- a/net/tools/balsa/balsa_frame.h
+++ b/net/tools/balsa/balsa_frame.h
@@ -201,36 +201,35 @@
private:
class DoNothingBalsaVisitor : public BalsaVisitorInterface {
- virtual void ProcessBodyInput(const char *input, size_t size) override {}
- virtual void ProcessBodyData(const char *input, size_t size) override {}
- virtual void ProcessHeaderInput(const char *input, size_t size) override {}
- virtual void ProcessTrailerInput(const char *input, size_t size) override {}
- virtual void ProcessHeaders(const BalsaHeaders& headers) override {}
- virtual void ProcessRequestFirstLine(const char* line_input,
- size_t line_length,
- const char* method_input,
- size_t method_length,
- const char* request_uri_input,
- size_t request_uri_length,
- const char* version_input,
- size_t version_length) override {}
- virtual void ProcessResponseFirstLine(const char *line_input,
- size_t line_length,
- const char *version_input,
- size_t version_length,
- const char *status_input,
- size_t status_length,
- const char *reason_input,
- size_t reason_length) override {}
- virtual void ProcessChunkLength(size_t chunk_length) override {}
- virtual void ProcessChunkExtensions(const char *input,
- size_t size) override {}
- virtual void HeaderDone() override {}
- virtual void MessageDone() override {}
- virtual void HandleHeaderError(BalsaFrame* framer) override {}
- virtual void HandleHeaderWarning(BalsaFrame* framer) override {}
- virtual void HandleChunkingError(BalsaFrame* framer) override {}
- virtual void HandleBodyError(BalsaFrame* framer) override {}
+ void ProcessBodyInput(const char* input, size_t size) override {}
+ void ProcessBodyData(const char* input, size_t size) override {}
+ void ProcessHeaderInput(const char* input, size_t size) override {}
+ void ProcessTrailerInput(const char* input, size_t size) override {}
+ void ProcessHeaders(const BalsaHeaders& headers) override {}
+ void ProcessRequestFirstLine(const char* line_input,
+ size_t line_length,
+ const char* method_input,
+ size_t method_length,
+ const char* request_uri_input,
+ size_t request_uri_length,
+ const char* version_input,
+ size_t version_length) override {}
+ void ProcessResponseFirstLine(const char* line_input,
+ size_t line_length,
+ const char* version_input,
+ size_t version_length,
+ const char* status_input,
+ size_t status_length,
+ const char* reason_input,
+ size_t reason_length) override {}
+ void ProcessChunkLength(size_t chunk_length) override {}
+ void ProcessChunkExtensions(const char* input, size_t size) override {}
+ void HeaderDone() override {}
+ void MessageDone() override {}
+ void HandleHeaderError(BalsaFrame* framer) override {}
+ void HandleHeaderWarning(BalsaFrame* framer) override {}
+ void HandleChunkingError(BalsaFrame* framer) override {}
+ void HandleBodyError(BalsaFrame* framer) override {}
};
bool last_char_was_slash_r_;
diff --git a/net/tools/balsa/simple_buffer.h b/net/tools/balsa/simple_buffer.h
index d58894e..d914ec5 100644
--- a/net/tools/balsa/simple_buffer.h
+++ b/net/tools/balsa/simple_buffer.h
@@ -16,7 +16,7 @@
public:
SimpleBuffer();
explicit SimpleBuffer(int size);
- virtual ~SimpleBuffer();
+ ~SimpleBuffer() override;
std::string str() const;
@@ -32,32 +32,32 @@
// The following functions all override pure virtual functions
// in BufferInterface. See buffer_interface.h for a description
// of what they do.
- virtual int ReadableBytes() const override;
- virtual int BufferSize() const override;
- virtual int BytesFree() const override;
+ int ReadableBytes() const override;
+ int BufferSize() const override;
+ int BytesFree() const override;
- virtual bool Empty() const override;
- virtual bool Full() const override;
+ bool Empty() const override;
+ bool Full() const override;
- virtual int Write(const char* bytes, int size) override;
+ int Write(const char* bytes, int size) override;
- virtual void GetWritablePtr(char **ptr, int* size) const override;
+ void GetWritablePtr(char** ptr, int* size) const override;
- virtual void GetReadablePtr(char **ptr, int* size) const override;
+ void GetReadablePtr(char** ptr, int* size) const override;
- virtual int Read(char* bytes, int size) override;
+ int Read(char* bytes, int size) override;
- virtual void Clear() override;
+ void Clear() override;
// This can be an expensive operation: costing a new/delete, and copying of
// all existing data. Even if the existing buffer does not need to be
// resized, unread data may still need to be non-destructively copied to
// consolidate fragmented free space.
- virtual bool Reserve(int size) override;
+ bool Reserve(int size) override;
- virtual void AdvanceReadablePtr(int amount_to_advance) override;
+ void AdvanceReadablePtr(int amount_to_advance) override;
- virtual void AdvanceWritablePtr(int amount_to_advance) override;
+ void AdvanceWritablePtr(int amount_to_advance) override;
void Swap(SimpleBuffer* other) {
char* tmp = storage_;
diff --git a/net/tools/dump_cache/cache_dumper.h b/net/tools/dump_cache/cache_dumper.h
index 46c3eec..9b071d7 100644
--- a/net/tools/dump_cache/cache_dumper.h
+++ b/net/tools/dump_cache/cache_dumper.h
@@ -47,13 +47,18 @@
public:
explicit CacheDumper(disk_cache::Backend* cache);
- virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) override;
- virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
- net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) override;
- virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
- base::Time last_modified) override;
+ int CreateEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ const net::CompletionCallback& callback) override;
+ int WriteEntry(disk_cache::Entry* entry,
+ int stream,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) override;
+ void CloseEntry(disk_cache::Entry* entry,
+ base::Time last_used,
+ base::Time last_modified) override;
private:
disk_cache::Backend* cache_;
@@ -64,13 +69,18 @@
public:
explicit DiskDumper(const base::FilePath& path);
- virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry,
- const net::CompletionCallback& callback) override;
- virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
- net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) override;
- virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
- base::Time last_modified) override;
+ int CreateEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ const net::CompletionCallback& callback) override;
+ int WriteEntry(disk_cache::Entry* entry,
+ int stream,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const net::CompletionCallback& callback) override;
+ void CloseEntry(disk_cache::Entry* entry,
+ base::Time last_used,
+ base::Time last_modified) override;
private:
base::FilePath path_;
diff --git a/net/tools/gdig/file_net_log.h b/net/tools/gdig/file_net_log.h
index 005ea31..62ba221 100644
--- a/net/tools/gdig/file_net_log.h
+++ b/net/tools/gdig/file_net_log.h
@@ -20,10 +20,10 @@
class FileNetLogObserver : public NetLog::ThreadSafeObserver {
public:
explicit FileNetLogObserver(FILE* destination);
- virtual ~FileNetLogObserver();
+ ~FileNetLogObserver() override;
// NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const net::NetLog::Entry& entry) override;
+ void OnAddEntry(const net::NetLog::Entry& entry) override;
private:
FILE* const destination_;
diff --git a/net/tools/get_server_time/get_server_time.cc b/net/tools/get_server_time/get_server_time.cc
index 8ad907d..800bb34 100644
--- a/net/tools/get_server_time/get_server_time.cc
+++ b/net/tools/get_server_time/get_server_time.cc
@@ -72,21 +72,22 @@
public:
QuitDelegate() {}
- virtual ~QuitDelegate() {}
+ ~QuitDelegate() override {}
// net::URLFetcherDelegate implementation.
- virtual void OnURLFetchComplete(const net::URLFetcher* source) override {
+ void OnURLFetchComplete(const net::URLFetcher* source) override {
base::MessageLoop::current()->Quit();
}
- virtual void OnURLFetchDownloadProgress(
- const net::URLFetcher* source,
- int64 current, int64 total) override {
+ void OnURLFetchDownloadProgress(const net::URLFetcher* source,
+ int64 current,
+ int64 total) override {
NOTREACHED();
}
- virtual void OnURLFetchUploadProgress(const net::URLFetcher* source,
- int64 current, int64 total) override {
+ void OnURLFetchUploadProgress(const net::URLFetcher* source,
+ int64 current,
+ int64 total) override {
NOTREACHED();
}
@@ -100,13 +101,13 @@
public:
PrintingLogObserver() {}
- virtual ~PrintingLogObserver() {
+ ~PrintingLogObserver() override {
// This is guaranteed to be safe as this program is single threaded.
net_log()->RemoveThreadSafeObserver(this);
}
// NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(const net::NetLog::Entry& entry) override {
+ void OnAddEntry(const net::NetLog::Entry& entry) override {
// The log level of the entry is unknown, so just assume it maps
// to VLOG(1).
if (!VLOG_IS_ON(1))
diff --git a/net/tools/net_watcher/net_watcher.cc b/net/tools/net_watcher/net_watcher.cc
index e9b3496..b6cf393 100644
--- a/net/tools/net_watcher/net_watcher.cc
+++ b/net/tools/net_watcher/net_watcher.cc
@@ -88,34 +88,30 @@
public:
NetWatcher() {}
- virtual ~NetWatcher() {}
+ ~NetWatcher() override {}
// net::NetworkChangeNotifier::IPAddressObserver implementation.
- virtual void OnIPAddressChanged() override {
- LOG(INFO) << "OnIPAddressChanged()";
- }
+ void OnIPAddressChanged() override { LOG(INFO) << "OnIPAddressChanged()"; }
// net::NetworkChangeNotifier::ConnectionTypeObserver implementation.
- virtual void OnConnectionTypeChanged(
+ void OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) override {
LOG(INFO) << "OnConnectionTypeChanged("
<< ConnectionTypeToString(type) << ")";
}
// net::NetworkChangeNotifier::DNSObserver implementation.
- virtual void OnDNSChanged() override {
- LOG(INFO) << "OnDNSChanged()";
- }
+ void OnDNSChanged() override { LOG(INFO) << "OnDNSChanged()"; }
// net::NetworkChangeNotifier::NetworkChangeObserver implementation.
- virtual void OnNetworkChanged(
+ void OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) override {
LOG(INFO) << "OnNetworkChanged("
<< ConnectionTypeToString(type) << ")";
}
// net::ProxyConfigService::Observer implementation.
- virtual void OnProxyConfigChanged(
+ void OnProxyConfigChanged(
const net::ProxyConfig& config,
net::ProxyConfigService::ConfigAvailability availability) override {
LOG(INFO) << "OnProxyConfigChanged("
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index f29af96..edcd0ce 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -762,9 +762,6 @@
// an infinite loop in the EpollServer, as the alarm fires and is immediately
// rescheduled.
ASSERT_TRUE(Initialize());
- if (negotiated_version_ < QUIC_VERSION_19) {
- return;
- }
client_->client()->WaitForCryptoHandshakeConfirmed();
// Ensure both stream and connection level are flow control blocked by setting
@@ -857,22 +854,27 @@
}
TEST_P(EndToEndTest, NegotiateMaxOpenStreams) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_allow_more_open_streams, true);
+
// Negotiate 1 max open stream.
client_config_.SetMaxStreamsPerConnection(1, 1);
ASSERT_TRUE(Initialize());
client_->client()->WaitForCryptoHandshakeConfirmed();
// Make the client misbehave after negotiation.
- QuicSessionPeer::SetMaxOpenStreams(client_->client()->session(), 10);
+ const int kServerMaxStreams = kMaxStreamsMinimumIncrement + 1;
+ QuicSessionPeer::SetMaxOpenStreams(client_->client()->session(),
+ kServerMaxStreams + 1);
- HTTPMessage request(HttpConstants::HTTP_1_1,
- HttpConstants::POST, "/foo");
+ HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/foo");
request.AddHeader("content-length", "3");
request.set_has_complete_message(false);
- // Open two simultaneous streams.
- client_->SendMessage(request);
- client_->SendMessage(request);
+ // The server supports a small number of additional streams beyond the
+ // negotiated limit. Open enough streams to go beyond that limit.
+ for (int i = 0; i < kServerMaxStreams + 1; ++i) {
+ client_->SendMessage(request);
+ }
client_->WaitForResponse();
EXPECT_FALSE(client_->connected());
@@ -1245,7 +1247,7 @@
set_server_initial_session_flow_control_receive_window(kServerSessionIFCW);
ASSERT_TRUE(Initialize());
- if (negotiated_version_ <= QUIC_VERSION_19) {
+ if (negotiated_version_ == QUIC_VERSION_19) {
return;
}
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index 8a78878..61f8c01 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -111,10 +111,8 @@
EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy());
}
-TEST_P(ToolsQuicClientSessionTest, EmptyPacketReceived) {
- // This test covers broken behavior that empty packets cause QUIC connection
- // broken.
-
+// Regression test for b/17206611.
+TEST_P(ToolsQuicClientSessionTest, InvalidPacketReceived) {
// Create Packet with 0 length.
QuicEncryptedPacket invalid_packet(nullptr, 0, false);
IPEndPoint server_address(TestPeerIPAddress(), kTestPort);
@@ -126,16 +124,12 @@
Invoke(reinterpret_cast<MockConnection*>(session_->connection()),
&MockConnection::ReallyProcessUdpPacket));
- // Expect call to close connection with error QUIC_INVALID_PACKET_HEADER.
- // TODO(b/17206611): Correct behavior: packet should get dropped and
- // connection should remain open.
- EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
- QUIC_INVALID_PACKET_HEADER, _)).Times(1);
+ // Validate that empty packets don't close the connection.
+ EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0);
session_->connection()->ProcessUdpPacket(client_address, server_address,
invalid_packet);
- // Create a packet that causes DecryptPacket failed. The packet will get
- // dropped without closing connection. This is a correct behavior.
+ // Verifiy that small, invalid packets don't close the connection.
char buf[2] = {0x00, 0x01};
QuicEncryptedPacket valid_packet(buf, 2, false);
// Close connection shouldn't be called.
diff --git a/net/tools/quic/quic_server_session.cc b/net/tools/quic/quic_server_session.cc
index 842c6ef..5b073c8 100644
--- a/net/tools/quic/quic_server_session.cc
+++ b/net/tools/quic/quic_server_session.cc
@@ -123,7 +123,7 @@
cached_network_params.set_max_bandwidth_timestamp_seconds(
max_bandwidth_timestamp);
cached_network_params.set_min_rtt_ms(
- sent_packet_manager.GetRttStats()->min_rtt().ToMilliseconds());
+ sent_packet_manager.GetRttStats()->MinRtt().ToMilliseconds());
cached_network_params.set_previous_connection_state(
bandwidth_recorder.EstimateRecordedDuringSlowStart()
? CachedNetworkParameters::SLOW_START
diff --git a/net/tools/quic/quic_server_session_test.cc b/net/tools/quic/quic_server_session_test.cc
index 72c65a8..0c25f81 100644
--- a/net/tools/quic/quic_server_session_test.cc
+++ b/net/tools/quic/quic_server_session_test.cc
@@ -357,7 +357,7 @@
expected_network_params.set_min_rtt_ms(session_->connection()
->sent_packet_manager()
.GetRttStats()
- ->min_rtt()
+ ->MinRtt()
.ToMilliseconds());
expected_network_params.set_previous_connection_state(
CachedNetworkParameters::CONGESTION_AVOIDANCE);
diff --git a/net/udp/datagram_client_socket.h b/net/udp/datagram_client_socket.h
index 31fc43f..c2c2cba 100644
--- a/net/udp/datagram_client_socket.h
+++ b/net/udp/datagram_client_socket.h
@@ -15,7 +15,7 @@
class NET_EXPORT_PRIVATE DatagramClientSocket : public DatagramSocket,
public Socket {
public:
- virtual ~DatagramClientSocket() {}
+ ~DatagramClientSocket() override {}
// Initialize this socket as a client socket to server at |address|.
// Returns a network error code.
diff --git a/net/udp/datagram_server_socket.h b/net/udp/datagram_server_socket.h
index 4c38cc8..d3796c3 100644
--- a/net/udp/datagram_server_socket.h
+++ b/net/udp/datagram_server_socket.h
@@ -17,7 +17,7 @@
// A UDP Socket.
class NET_EXPORT DatagramServerSocket : public DatagramSocket {
public:
- virtual ~DatagramServerSocket() {}
+ ~DatagramServerSocket() override {}
// Initialize this socket as a server socket listening at |address|.
// Returns a network error code.
diff --git a/net/udp/udp_client_socket.h b/net/udp/udp_client_socket.h
index d689640..427db7e 100644
--- a/net/udp/udp_client_socket.h
+++ b/net/udp/udp_client_socket.h
@@ -21,20 +21,22 @@
const RandIntCallback& rand_int_cb,
net::NetLog* net_log,
const net::NetLog::Source& source);
- virtual ~UDPClientSocket();
+ ~UDPClientSocket() override;
// DatagramClientSocket implementation.
- virtual int Connect(const IPEndPoint& address) override;
- virtual int Read(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buf, int buf_len,
- const CompletionCallback& callback) override;
- virtual void Close() override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
- virtual const BoundNetLog& NetLog() const override;
+ int Connect(const IPEndPoint& address) override;
+ int Read(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ int Write(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void Close() override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
+ const BoundNetLog& NetLog() const override;
private:
UDPSocket socket_;
diff --git a/net/udp/udp_server_socket.h b/net/udp/udp_server_socket.h
index 9801ff8..77ca86d 100644
--- a/net/udp/udp_server_socket.h
+++ b/net/udp/udp_server_socket.h
@@ -19,33 +19,33 @@
class NET_EXPORT UDPServerSocket : public DatagramServerSocket {
public:
UDPServerSocket(net::NetLog* net_log, const net::NetLog::Source& source);
- virtual ~UDPServerSocket();
+ ~UDPServerSocket() override;
// Implement DatagramServerSocket:
- virtual int Listen(const IPEndPoint& address) override;
- virtual int RecvFrom(IOBuffer* buf,
- int buf_len,
- IPEndPoint* address,
- const CompletionCallback& callback) override;
- virtual int SendTo(IOBuffer* buf,
- int buf_len,
- const IPEndPoint& address,
- const CompletionCallback& callback) override;
- virtual int SetReceiveBufferSize(int32 size) override;
- virtual int SetSendBufferSize(int32 size) override;
- virtual void Close() override;
- virtual int GetPeerAddress(IPEndPoint* address) const override;
- virtual int GetLocalAddress(IPEndPoint* address) const override;
- virtual const BoundNetLog& NetLog() const override;
- virtual void AllowAddressReuse() override;
- virtual void AllowBroadcast() override;
- virtual int JoinGroup(const IPAddressNumber& group_address) const override;
- virtual int LeaveGroup(const IPAddressNumber& group_address) const override;
- virtual int SetMulticastInterface(uint32 interface_index) override;
- virtual int SetMulticastTimeToLive(int time_to_live) override;
- virtual int SetMulticastLoopbackMode(bool loopback) override;
- virtual int SetDiffServCodePoint(DiffServCodePoint dscp) override;
- virtual void DetachFromThread() override;
+ int Listen(const IPEndPoint& address) override;
+ int RecvFrom(IOBuffer* buf,
+ int buf_len,
+ IPEndPoint* address,
+ const CompletionCallback& callback) override;
+ int SendTo(IOBuffer* buf,
+ int buf_len,
+ const IPEndPoint& address,
+ const CompletionCallback& callback) override;
+ int SetReceiveBufferSize(int32 size) override;
+ int SetSendBufferSize(int32 size) override;
+ void Close() override;
+ int GetPeerAddress(IPEndPoint* address) const override;
+ int GetLocalAddress(IPEndPoint* address) const override;
+ const BoundNetLog& NetLog() const override;
+ void AllowAddressReuse() override;
+ void AllowBroadcast() override;
+ int JoinGroup(const IPAddressNumber& group_address) const override;
+ int LeaveGroup(const IPAddressNumber& group_address) const override;
+ int SetMulticastInterface(uint32 interface_index) override;
+ int SetMulticastTimeToLive(int time_to_live) override;
+ int SetMulticastLoopbackMode(bool loopback) override;
+ int SetDiffServCodePoint(DiffServCodePoint dscp) override;
+ void DetachFromThread() override;
private:
UDPSocket socket_;
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h
index 292a42f..2ac564d 100644
--- a/net/udp/udp_socket_libevent.h
+++ b/net/udp/udp_socket_libevent.h
@@ -179,9 +179,9 @@
// MessageLoopForIO::Watcher methods
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) override;
+ void OnFileCanReadWithoutBlocking(int /* fd */) override;
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {}
+ void OnFileCanWriteWithoutBlocking(int /* fd */) override {}
private:
UDPSocketLibevent* const socket_;
@@ -195,9 +195,9 @@
// MessageLoopForIO::Watcher methods
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) override {}
+ void OnFileCanReadWithoutBlocking(int /* fd */) override {}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override;
+ void OnFileCanWriteWithoutBlocking(int /* fd */) override;
private:
UDPSocketLibevent* const socket_;
diff --git a/net/url_request/data_protocol_handler.h b/net/url_request/data_protocol_handler.h
index 3c2c4d4..cc0f7b8 100644
--- a/net/url_request/data_protocol_handler.h
+++ b/net/url_request/data_protocol_handler.h
@@ -18,9 +18,10 @@
: public URLRequestJobFactory::ProtocolHandler {
public:
DataProtocolHandler();
- virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const override;
- virtual bool IsSafeRedirectTarget(const GURL& location) const override;
+ URLRequestJob* MaybeCreateJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
private:
DISALLOW_COPY_AND_ASSIGN(DataProtocolHandler);
diff --git a/net/url_request/file_protocol_handler.h b/net/url_request/file_protocol_handler.h
index 02b5c9f..4ac81d3 100644
--- a/net/url_request/file_protocol_handler.h
+++ b/net/url_request/file_protocol_handler.h
@@ -28,10 +28,11 @@
public:
explicit FileProtocolHandler(
const scoped_refptr<base::TaskRunner>& file_task_runner);
- virtual ~FileProtocolHandler();
- virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const override;
- virtual bool IsSafeRedirectTarget(const GURL& location) const override;
+ ~FileProtocolHandler() override;
+ URLRequestJob* MaybeCreateJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
private:
const scoped_refptr<base::TaskRunner> file_task_runner_;
diff --git a/net/url_request/ftp_protocol_handler.h b/net/url_request/ftp_protocol_handler.h
index c3091b9..a951e05 100644
--- a/net/url_request/ftp_protocol_handler.h
+++ b/net/url_request/ftp_protocol_handler.h
@@ -22,9 +22,10 @@
public URLRequestJobFactory::ProtocolHandler {
public:
explicit FtpProtocolHandler(FtpTransactionFactory* ftp_transaction_factory);
- virtual ~FtpProtocolHandler();
- virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const override;
+ ~FtpProtocolHandler() override;
+ URLRequestJob* MaybeCreateJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override;
private:
friend class FtpTestURLRequestContext;
diff --git a/net/url_request/static_http_user_agent_settings.h b/net/url_request/static_http_user_agent_settings.h
index 4edb948..57bbd07 100644
--- a/net/url_request/static_http_user_agent_settings.h
+++ b/net/url_request/static_http_user_agent_settings.h
@@ -20,11 +20,11 @@
public:
StaticHttpUserAgentSettings(const std::string& accept_language,
const std::string& user_agent);
- virtual ~StaticHttpUserAgentSettings();
+ ~StaticHttpUserAgentSettings() override;
// HttpUserAgentSettings implementation
- virtual std::string GetAcceptLanguage() const override;
- virtual std::string GetUserAgent() const override;
+ std::string GetAcceptLanguage() const override;
+ std::string GetUserAgent() const override;
private:
const std::string accept_language_;
diff --git a/net/url_request/test_url_fetcher_factory.h b/net/url_request/test_url_fetcher_factory.h
index c004ce7..078e8cb 100644
--- a/net/url_request/test_url_fetcher_factory.h
+++ b/net/url_request/test_url_fetcher_factory.h
@@ -84,70 +84,66 @@
TestURLFetcher(int id,
const GURL& url,
URLFetcherDelegate* d);
- virtual ~TestURLFetcher();
+ ~TestURLFetcher() override;
// URLFetcher implementation
- virtual void SetUploadData(const std::string& upload_content_type,
- const std::string& upload_content) override;
- virtual void SetUploadFilePath(
+ void SetUploadData(const std::string& upload_content_type,
+ const std::string& upload_content) override;
+ void SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
uint64 range_offset,
uint64 range_length,
scoped_refptr<base::TaskRunner> file_task_runner) override;
- virtual void SetChunkedUpload(
- const std::string& upload_content_type) override;
+ void SetChunkedUpload(const std::string& upload_content_type) override;
// Overriden to cache the chunks uploaded. Caller can read back the uploaded
// chunks with the upload_chunks() accessor.
- virtual void AppendChunkToUpload(const std::string& data,
- bool is_last_chunk) override;
- virtual void SetLoadFlags(int load_flags) override;
- virtual int GetLoadFlags() const override;
- virtual void SetReferrer(const std::string& referrer) override;
- virtual void SetReferrerPolicy(
- URLRequest::ReferrerPolicy referrer_policy) override;
- virtual void SetExtraRequestHeaders(
+ void AppendChunkToUpload(const std::string& data,
+ bool is_last_chunk) override;
+ void SetLoadFlags(int load_flags) override;
+ int GetLoadFlags() const override;
+ void SetReferrer(const std::string& referrer) override;
+ void SetReferrerPolicy(URLRequest::ReferrerPolicy referrer_policy) override;
+ void SetExtraRequestHeaders(
const std::string& extra_request_headers) override;
- virtual void AddExtraRequestHeader(const std::string& header_line) override;
- virtual void SetRequestContext(
+ void AddExtraRequestHeader(const std::string& header_line) override;
+ void SetRequestContext(
URLRequestContextGetter* request_context_getter) override;
- virtual void SetFirstPartyForCookies(
- const GURL& first_party_for_cookies) override;
- virtual void SetURLRequestUserData(
+ void SetFirstPartyForCookies(const GURL& first_party_for_cookies) override;
+ void SetURLRequestUserData(
const void* key,
const CreateDataCallback& create_data_callback) override;
- virtual void SetStopOnRedirect(bool stop_on_redirect) override;
- virtual void SetAutomaticallyRetryOn5xx(bool retry) override;
- virtual void SetMaxRetriesOn5xx(int max_retries) override;
- virtual int GetMaxRetriesOn5xx() const override;
- virtual base::TimeDelta GetBackoffDelay() const override;
- virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) override;
- virtual void SaveResponseToFileAtPath(
+ void SetStopOnRedirect(bool stop_on_redirect) override;
+ void SetAutomaticallyRetryOn5xx(bool retry) override;
+ void SetMaxRetriesOn5xx(int max_retries) override;
+ int GetMaxRetriesOn5xx() const override;
+ base::TimeDelta GetBackoffDelay() const override;
+ void SetAutomaticallyRetryOnNetworkChanges(int max_retries) override;
+ void SaveResponseToFileAtPath(
const base::FilePath& file_path,
scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
- virtual void SaveResponseToTemporaryFile(
+ void SaveResponseToTemporaryFile(
scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
- virtual void SaveResponseWithWriter(
+ void SaveResponseWithWriter(
scoped_ptr<URLFetcherResponseWriter> response_writer) override;
- virtual HttpResponseHeaders* GetResponseHeaders() const override;
- virtual HostPortPair GetSocketAddress() const override;
- virtual bool WasFetchedViaProxy() const override;
- virtual void Start() override;
+ HttpResponseHeaders* GetResponseHeaders() const override;
+ HostPortPair GetSocketAddress() const override;
+ bool WasFetchedViaProxy() const override;
+ void Start() override;
// URL we were created with. Because of how we're using URLFetcher GetURL()
// always returns an empty URL. Chances are you'll want to use
// GetOriginalURL() in your tests.
- virtual const GURL& GetOriginalURL() const override;
- virtual const GURL& GetURL() const override;
- virtual const URLRequestStatus& GetStatus() const override;
- virtual int GetResponseCode() const override;
- virtual const ResponseCookies& GetCookies() const override;
- virtual void ReceivedContentWasMalformed() override;
+ const GURL& GetOriginalURL() const override;
+ const GURL& GetURL() const override;
+ const URLRequestStatus& GetStatus() const override;
+ int GetResponseCode() const override;
+ const ResponseCookies& GetCookies() const override;
+ void ReceivedContentWasMalformed() override;
// Override response access functions to return fake data.
- virtual bool GetResponseAsString(
- std::string* out_response_string) const override;
- virtual bool GetResponseAsFilePath(
- bool take_ownership, base::FilePath* out_response_path) const override;
+ bool GetResponseAsString(std::string* out_response_string) const override;
+ bool GetResponseAsFilePath(bool take_ownership,
+ base::FilePath* out_response_path) const override;
void GetExtraRequestHeaders(HttpRequestHeaders* headers) const;
@@ -241,13 +237,12 @@
public ScopedURLFetcherFactory {
public:
TestURLFetcherFactory();
- virtual ~TestURLFetcherFactory();
+ ~TestURLFetcherFactory() override;
- virtual URLFetcher* CreateURLFetcher(
- int id,
- const GURL& url,
- URLFetcher::RequestType request_type,
- URLFetcherDelegate* d) override;
+ URLFetcher* CreateURLFetcher(int id,
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d) override;
TestURLFetcher* GetFetcherByID(int id) const;
void RemoveFetcherFromMap(int id);
void SetDelegateForTests(TestURLFetcherDelegateForTests* delegate_for_tests);
@@ -299,11 +294,11 @@
// Start the request. This will call the given delegate asynchronously
// with the pre-baked response as parameter.
- virtual void Start() override;
+ void Start() override;
- virtual const GURL& GetURL() const override;
+ const GURL& GetURL() const override;
- virtual ~FakeURLFetcher();
+ ~FakeURLFetcher() override;
private:
// This is the method which actually calls the delegate that is passed in the
@@ -396,18 +391,17 @@
FakeURLFetcherFactory(URLFetcherFactory* default_factory,
const FakeURLFetcherCreator& creator);
- virtual ~FakeURLFetcherFactory();
+ ~FakeURLFetcherFactory() override;
// If no fake response is set for the given URL this method will delegate the
// call to |default_factory_| if it is not NULL, or return NULL if it is
// NULL.
// Otherwise, it will return a URLFetcher object which will respond with the
// pre-baked response that the client has set by calling SetFakeResponse().
- virtual URLFetcher* CreateURLFetcher(
- int id,
- const GURL& url,
- URLFetcher::RequestType request_type,
- URLFetcherDelegate* d) override;
+ URLFetcher* CreateURLFetcher(int id,
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d) override;
// Sets the fake response for a given URL. The |response_data| may be empty.
// The |response_code| may be any HttpStatusCode. For instance, HTTP_OK will
@@ -453,14 +447,13 @@
class URLFetcherImplFactory : public URLFetcherFactory {
public:
URLFetcherImplFactory();
- virtual ~URLFetcherImplFactory();
+ ~URLFetcherImplFactory() override;
// This method will create a real URLFetcher.
- virtual URLFetcher* CreateURLFetcher(
- int id,
- const GURL& url,
- URLFetcher::RequestType request_type,
- URLFetcherDelegate* d) override;
+ URLFetcher* CreateURLFetcher(int id,
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d) override;
};
} // namespace net
diff --git a/net/url_request/test_url_request_interceptor.cc b/net/url_request/test_url_request_interceptor.cc
index ec60e08..b0fd315 100644
--- a/net/url_request/test_url_request_interceptor.cc
+++ b/net/url_request/test_url_request_interceptor.cc
@@ -30,10 +30,10 @@
file_path,
worker_task_runner) {}
- virtual int GetResponseCode() const override { return 200; }
+ int GetResponseCode() const override { return 200; }
private:
- virtual ~TestURLRequestJob() {}
+ ~TestURLRequestJob() override {}
DISALLOW_COPY_AND_ASSIGN(TestURLRequestJob);
};
@@ -54,7 +54,7 @@
network_task_runner_(network_task_runner),
worker_task_runner_(worker_task_runner),
hit_count_(0) {}
- virtual ~Delegate() {}
+ ~Delegate() override {}
void Register() {
net::URLRequestFilter::GetInstance()->AddHostnameInterceptor(
@@ -91,7 +91,7 @@
typedef std::map<GURL, base::FilePath> ResponseMap;
// When computing matches, this ignores the query parameters of the url.
- virtual net::URLRequestJob* MaybeInterceptRequest(
+ net::URLRequestJob* MaybeInterceptRequest(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
diff --git a/net/url_request/url_fetcher_core.h b/net/url_request/url_fetcher_core.h
index c064a42..6bf449f 100644
--- a/net/url_request/url_fetcher_core.h
+++ b/net/url_request/url_fetcher_core.h
@@ -122,15 +122,13 @@
base::FilePath* out_response_path);
// Overridden from URLRequest::Delegate:
- virtual void OnReceivedRedirect(URLRequest* request,
- const RedirectInfo& redirect_info,
- bool* defer_redirect) override;
- virtual void OnResponseStarted(URLRequest* request) override;
- virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) override;
- virtual void OnCertificateRequested(
- URLRequest* request,
- SSLCertRequestInfo* cert_request_info) override;
+ void OnReceivedRedirect(URLRequest* request,
+ const RedirectInfo& redirect_info,
+ bool* defer_redirect) override;
+ void OnResponseStarted(URLRequest* request) override;
+ void OnReadCompleted(URLRequest* request, int bytes_read) override;
+ void OnCertificateRequested(URLRequest* request,
+ SSLCertRequestInfo* cert_request_info) override;
URLFetcherDelegate* delegate() const { return delegate_; }
static void CancelAll();
@@ -161,7 +159,7 @@
DISALLOW_COPY_AND_ASSIGN(Registry);
};
- virtual ~URLFetcherCore();
+ ~URLFetcherCore() override;
// Wrapper functions that allow us to ensure actions happen on the right
// thread.
diff --git a/net/url_request/url_fetcher_impl.h b/net/url_request/url_fetcher_impl.h
index e534904..29c8bd5 100644
--- a/net/url_request/url_fetcher_impl.h
+++ b/net/url_request/url_fetcher_impl.h
@@ -34,64 +34,59 @@
URLFetcherImpl(const GURL& url,
RequestType request_type,
URLFetcherDelegate* d);
- virtual ~URLFetcherImpl();
+ ~URLFetcherImpl() override;
// URLFetcher implementation:
- virtual void SetUploadData(const std::string& upload_content_type,
- const std::string& upload_content) override;
- virtual void SetUploadFilePath(
+ void SetUploadData(const std::string& upload_content_type,
+ const std::string& upload_content) override;
+ void SetUploadFilePath(
const std::string& upload_content_type,
const base::FilePath& file_path,
uint64 range_offset,
uint64 range_length,
scoped_refptr<base::TaskRunner> file_task_runner) override;
- virtual void SetChunkedUpload(
- const std::string& upload_content_type) override;
- virtual void AppendChunkToUpload(const std::string& data,
- bool is_last_chunk) override;
- virtual void SetLoadFlags(int load_flags) override;
- virtual int GetLoadFlags() const override;
- virtual void SetReferrer(const std::string& referrer) override;
- virtual void SetReferrerPolicy(
- URLRequest::ReferrerPolicy referrer_policy) override;
- virtual void SetExtraRequestHeaders(
+ void SetChunkedUpload(const std::string& upload_content_type) override;
+ void AppendChunkToUpload(const std::string& data,
+ bool is_last_chunk) override;
+ void SetLoadFlags(int load_flags) override;
+ int GetLoadFlags() const override;
+ void SetReferrer(const std::string& referrer) override;
+ void SetReferrerPolicy(URLRequest::ReferrerPolicy referrer_policy) override;
+ void SetExtraRequestHeaders(
const std::string& extra_request_headers) override;
- virtual void AddExtraRequestHeader(const std::string& header_line) override;
- virtual void SetRequestContext(
+ void AddExtraRequestHeader(const std::string& header_line) override;
+ void SetRequestContext(
URLRequestContextGetter* request_context_getter) override;
- virtual void SetFirstPartyForCookies(
- const GURL& first_party_for_cookies) override;
- virtual void SetURLRequestUserData(
+ void SetFirstPartyForCookies(const GURL& first_party_for_cookies) override;
+ void SetURLRequestUserData(
const void* key,
const CreateDataCallback& create_data_callback) override;
- virtual void SetStopOnRedirect(bool stop_on_redirect) override;
- virtual void SetAutomaticallyRetryOn5xx(bool retry) override;
- virtual void SetMaxRetriesOn5xx(int max_retries) override;
- virtual int GetMaxRetriesOn5xx() const override;
- virtual base::TimeDelta GetBackoffDelay() const override;
- virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) override;
- virtual void SaveResponseToFileAtPath(
+ void SetStopOnRedirect(bool stop_on_redirect) override;
+ void SetAutomaticallyRetryOn5xx(bool retry) override;
+ void SetMaxRetriesOn5xx(int max_retries) override;
+ int GetMaxRetriesOn5xx() const override;
+ base::TimeDelta GetBackoffDelay() const override;
+ void SetAutomaticallyRetryOnNetworkChanges(int max_retries) override;
+ void SaveResponseToFileAtPath(
const base::FilePath& file_path,
scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
- virtual void SaveResponseToTemporaryFile(
+ void SaveResponseToTemporaryFile(
scoped_refptr<base::SequencedTaskRunner> file_task_runner) override;
- virtual void SaveResponseWithWriter(
+ void SaveResponseWithWriter(
scoped_ptr<URLFetcherResponseWriter> response_writer) override;
- virtual HttpResponseHeaders* GetResponseHeaders() const override;
- virtual HostPortPair GetSocketAddress() const override;
- virtual bool WasFetchedViaProxy() const override;
- virtual void Start() override;
- virtual const GURL& GetOriginalURL() const override;
- virtual const GURL& GetURL() const override;
- virtual const URLRequestStatus& GetStatus() const override;
- virtual int GetResponseCode() const override;
- virtual const ResponseCookies& GetCookies() const override;
- virtual void ReceivedContentWasMalformed() override;
- virtual bool GetResponseAsString(
- std::string* out_response_string) const override;
- virtual bool GetResponseAsFilePath(
- bool take_ownership,
- base::FilePath* out_response_path) const override;
+ HttpResponseHeaders* GetResponseHeaders() const override;
+ HostPortPair GetSocketAddress() const override;
+ bool WasFetchedViaProxy() const override;
+ void Start() override;
+ const GURL& GetOriginalURL() const override;
+ const GURL& GetURL() const override;
+ const URLRequestStatus& GetStatus() const override;
+ int GetResponseCode() const override;
+ const ResponseCookies& GetCookies() const override;
+ void ReceivedContentWasMalformed() override;
+ bool GetResponseAsString(std::string* out_response_string) const override;
+ bool GetResponseAsFilePath(bool take_ownership,
+ base::FilePath* out_response_path) const override;
static void CancelAll();
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc
index 5c97366..cf52773 100644
--- a/net/url_request/url_fetcher_impl_unittest.cc
+++ b/net/url_request/url_fetcher_impl_unittest.cc
@@ -67,12 +67,10 @@
}
// TestURLRequestContextGetter:
- virtual TestURLRequestContext* GetURLRequestContext() override {
- return context_;
- }
+ TestURLRequestContext* GetURLRequestContext() override { return context_; }
protected:
- virtual ~ThrottlingTestURLRequestContextGetter() {}
+ ~ThrottlingTestURLRequestContextGetter() override {}
TestURLRequestContext* const context_;
};
@@ -95,7 +93,7 @@
// Subclasses that override this should either call this function or
// CleanupAfterFetchComplete() at the end of their processing, depending on
// whether they want to check for a non-empty HTTP 200 response or not.
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
// Deletes |fetcher| and terminates the message loop.
void CleanupAfterFetchComplete();
@@ -146,10 +144,10 @@
virtual void SetUp() override;
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
protected:
GURL test_url_;
@@ -231,10 +229,10 @@
class URLFetcherPostTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that does a POST of a file using
@@ -249,10 +247,10 @@
}
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
private:
base::FilePath path_;
@@ -264,10 +262,10 @@
class URLFetcherEmptyPostTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that tests download progress reports.
@@ -279,12 +277,12 @@
}
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
- int64 current,
- int64 total) override;
+ void OnURLFetchDownloadProgress(const URLFetcher* source,
+ int64 current,
+ int64 total) override;
protected:
// Download progress returned by the previous callback.
@@ -298,13 +296,14 @@
class URLFetcherDownloadProgressCancelTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
- virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
- int64 current,
- int64 total) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchDownloadProgress(const URLFetcher* source,
+ int64 current,
+ int64 total) override;
+
protected:
bool cancelled_;
};
@@ -313,12 +312,13 @@
class URLFetcherUploadProgressTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchUploadProgress(const URLFetcher* source,
- int64 current,
- int64 total) override;
+ void OnURLFetchUploadProgress(const URLFetcher* source,
+ int64 current,
+ int64 total) override;
+
protected:
int64 previous_progress_;
std::string chunk_;
@@ -329,14 +329,15 @@
class URLFetcherHeadersTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that tests SocketAddress.
class URLFetcherSocketAddressTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
protected:
std::string expected_host_;
uint16 expected_port_;
@@ -349,10 +350,10 @@
virtual ~URLFetcherStopOnRedirectTest();
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
protected:
// The URL we should be redirected to.
@@ -365,10 +366,11 @@
class URLFetcherProtectTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
private:
Time start_time_;
};
@@ -378,10 +380,11 @@
class URLFetcherProtectTestPassedThrough : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
private:
Time start_time_;
};
@@ -392,7 +395,7 @@
URLFetcherBadHTTPSTest();
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
private:
base::FilePath cert_dir_;
@@ -402,10 +405,10 @@
class URLFetcherCancelTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) override;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
void CancelRequest();
};
@@ -418,7 +421,7 @@
}
private:
- virtual ~CancelTestURLRequestContext() {
+ ~CancelTestURLRequestContext() override {
// The d'tor should execute in the IO thread. Post the quit task to the
// current thread.
base::MessageLoop::current()->PostTask(FROM_HERE,
@@ -439,7 +442,7 @@
}
// TestURLRequestContextGetter:
- virtual TestURLRequestContext* GetURLRequestContext() override {
+ TestURLRequestContext* GetURLRequestContext() override {
if (!context_.get()) {
context_.reset(new CancelTestURLRequestContext());
DCHECK(context_->throttler_manager());
@@ -474,7 +477,7 @@
}
protected:
- virtual ~CancelTestURLRequestContextGetter() {}
+ ~CancelTestURLRequestContextGetter() override {}
private:
scoped_ptr<TestURLRequestContext> context_;
@@ -487,7 +490,8 @@
class URLFetcherMultipleAttemptTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
private:
std::string data_;
};
@@ -501,7 +505,7 @@
void CreateFetcherForTempFile(const GURL& url);
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchComplete(const URLFetcher* source) override;
protected:
base::FilePath expected_file_;
diff --git a/net/url_request/url_fetcher_response_writer.h b/net/url_request/url_fetcher_response_writer.h
index 3321f5c..fb99522 100644
--- a/net/url_request/url_fetcher_response_writer.h
+++ b/net/url_request/url_fetcher_response_writer.h
@@ -60,17 +60,17 @@
class NET_EXPORT URLFetcherStringWriter : public URLFetcherResponseWriter {
public:
URLFetcherStringWriter();
- virtual ~URLFetcherStringWriter();
+ ~URLFetcherStringWriter() override;
const std::string& data() const { return data_; }
// URLFetcherResponseWriter overrides:
- virtual int Initialize(const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buffer,
- int num_bytes,
- const CompletionCallback& callback) override;
- virtual int Finish(const CompletionCallback& callback) override;
- virtual URLFetcherStringWriter* AsStringWriter() override;
+ int Initialize(const CompletionCallback& callback) override;
+ int Write(IOBuffer* buffer,
+ int num_bytes,
+ const CompletionCallback& callback) override;
+ int Finish(const CompletionCallback& callback) override;
+ URLFetcherStringWriter* AsStringWriter() override;
private:
std::string data_;
@@ -86,17 +86,17 @@
URLFetcherFileWriter(
scoped_refptr<base::SequencedTaskRunner> file_task_runner,
const base::FilePath& file_path);
- virtual ~URLFetcherFileWriter();
+ ~URLFetcherFileWriter() override;
const base::FilePath& file_path() const { return file_path_; }
// URLFetcherResponseWriter overrides:
- virtual int Initialize(const CompletionCallback& callback) override;
- virtual int Write(IOBuffer* buffer,
- int num_bytes,
- const CompletionCallback& callback) override;
- virtual int Finish(const CompletionCallback& callback) override;
- virtual URLFetcherFileWriter* AsFileWriter() override;
+ int Initialize(const CompletionCallback& callback) override;
+ int Write(IOBuffer* buffer,
+ int num_bytes,
+ const CompletionCallback& callback) override;
+ int Finish(const CompletionCallback& callback) override;
+ URLFetcherFileWriter* AsFileWriter() override;
// Drops ownership of the file at |file_path_|.
// This class will not delete it or write to it again.
diff --git a/net/url_request/url_range_request_job.h b/net/url_request/url_range_request_job.h
index 190389d..38a6802 100644
--- a/net/url_request/url_range_request_job.h
+++ b/net/url_request/url_range_request_job.h
@@ -24,14 +24,13 @@
URLRangeRequestJob(URLRequest* request,
NetworkDelegate* delegate);
- virtual void SetExtraRequestHeaders(
- const HttpRequestHeaders& headers) override;
+ void SetExtraRequestHeaders(const HttpRequestHeaders& headers) override;
const std::vector<HttpByteRange>& ranges() const { return ranges_; }
int range_parse_result() const { return range_parse_result_; }
protected:
- virtual ~URLRangeRequestJob();
+ ~URLRangeRequestJob() override;
private:
std::vector<HttpByteRange> ranges_;
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index a0d5789..3db6c68 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -278,7 +278,7 @@
// If destroyed after Start() has been called but while IO is pending,
// then the request will be effectively canceled and the delegate
// will not have any more of its methods called.
- virtual ~URLRequest();
+ ~URLRequest() override;
// Changes the default cookie policy from allowing all cookies to blocking all
// cookies. Embedders that want to implement a more flexible policy should
diff --git a/net/url_request/url_request_about_job.h b/net/url_request/url_request_about_job.h
index d4b4867..36778b8 100644
--- a/net/url_request/url_request_about_job.h
+++ b/net/url_request/url_request_about_job.h
@@ -18,11 +18,11 @@
URLRequestAboutJob(URLRequest* request, NetworkDelegate* network_delegate);
// URLRequestJob:
- virtual void Start() override;
- virtual bool GetMimeType(std::string* mime_type) const override;
+ void Start() override;
+ bool GetMimeType(std::string* mime_type) const override;
private:
- virtual ~URLRequestAboutJob();
+ ~URLRequestAboutJob() override;
void StartAsync();
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index 2e2fcc4..666bd03 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -51,25 +51,25 @@
class BasicNetworkDelegate : public NetworkDelegate {
public:
BasicNetworkDelegate() {}
- virtual ~BasicNetworkDelegate() {}
+ ~BasicNetworkDelegate() override {}
private:
- virtual int OnBeforeURLRequest(URLRequest* request,
- const CompletionCallback& callback,
- GURL* new_url) override {
+ int OnBeforeURLRequest(URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) override {
return OK;
}
- virtual int OnBeforeSendHeaders(URLRequest* request,
- const CompletionCallback& callback,
- HttpRequestHeaders* headers) override {
+ int OnBeforeSendHeaders(URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) override {
return OK;
}
- virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) override {}
+ void OnSendHeaders(URLRequest* request,
+ const HttpRequestHeaders& headers) override {}
- virtual int OnHeadersReceived(
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
@@ -78,22 +78,21 @@
return OK;
}
- virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) override {}
+ void OnBeforeRedirect(URLRequest* request,
+ const GURL& new_location) override {}
- virtual void OnResponseStarted(URLRequest* request) override {}
+ void OnResponseStarted(URLRequest* request) override {}
- virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) override {}
+ void OnRawBytesRead(const URLRequest& request, int bytes_read) override {}
- virtual void OnCompleted(URLRequest* request, bool started) override {}
+ void OnCompleted(URLRequest* request, bool started) override {}
- virtual void OnURLRequestDestroyed(URLRequest* request) override {}
+ void OnURLRequestDestroyed(URLRequest* request) override {}
- virtual void OnPACScriptError(int line_number,
- const base::string16& error) override {}
+ void OnPACScriptError(int line_number, const base::string16& error) override {
+ }
- virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
+ NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
@@ -101,31 +100,30 @@
return NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
- virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) override {
+ bool OnCanGetCookies(const URLRequest& request,
+ const CookieList& cookie_list) override {
return true;
}
- virtual bool OnCanSetCookie(const URLRequest& request,
- const std::string& cookie_line,
- CookieOptions* options) override {
+ bool OnCanSetCookie(const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) override {
return true;
}
- virtual bool OnCanAccessFile(const net::URLRequest& request,
- const base::FilePath& path) const override {
+ bool OnCanAccessFile(const net::URLRequest& request,
+ const base::FilePath& path) const override {
return true;
}
- virtual bool OnCanThrottleRequest(const URLRequest& request) const override {
+ bool OnCanThrottleRequest(const URLRequest& request) const override {
// Returning true will only enable throttling if there's also a
// URLRequestThrottlerManager, which there isn't, by default.
return true;
}
- virtual int OnBeforeSocketStreamConnect(
- SocketStream* stream,
- const CompletionCallback& callback) override {
+ int OnBeforeSocketStreamConnect(SocketStream* stream,
+ const CompletionCallback& callback) override {
return OK;
}
@@ -165,9 +163,7 @@
}
protected:
- virtual ~BasicURLRequestContext() {
- AssertNoURLRequests();
- }
+ ~BasicURLRequestContext() override { AssertNoURLRequests(); }
private:
// Threads should be torn down last.
diff --git a/net/url_request/url_request_context_builder_unittest.cc b/net/url_request/url_request_context_builder_unittest.cc
index f0f4b82..677023c 100644
--- a/net/url_request/url_request_context_builder_unittest.cc
+++ b/net/url_request/url_request_context_builder_unittest.cc
@@ -43,15 +43,15 @@
public:
explicit MockHttpAuthHandlerFactory(int return_code) :
return_code_(return_code) {}
- virtual ~MockHttpAuthHandlerFactory() {}
+ ~MockHttpAuthHandlerFactory() override {}
- virtual int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
- HttpAuth::Target target,
- const GURL& origin,
- CreateReason reason,
- int nonce_count,
- const BoundNetLog& net_log,
- scoped_ptr<HttpAuthHandler>* handler) override {
+ int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ CreateReason reason,
+ int nonce_count,
+ const BoundNetLog& net_log,
+ scoped_ptr<HttpAuthHandler>* handler) override {
handler->reset();
return return_code_;
}
diff --git a/net/url_request/url_request_context_getter.h b/net/url_request/url_request_context_getter.h
index aa2d64b..17d17bd 100644
--- a/net/url_request/url_request_context_getter.h
+++ b/net/url_request/url_request_context_getter.h
@@ -62,13 +62,13 @@
const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
// net::URLRequestContextGetter implementation:
- virtual net::URLRequestContext* GetURLRequestContext() override;
+ net::URLRequestContext* GetURLRequestContext() override;
- virtual scoped_refptr<base::SingleThreadTaskRunner>
- GetNetworkTaskRunner() const override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
+ const override;
private:
- virtual ~TrivialURLRequestContextGetter();
+ ~TrivialURLRequestContextGetter() override;
net::URLRequestContext* context_;
const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
diff --git a/net/url_request/url_request_data_job.h b/net/url_request/url_request_data_job.h
index c39ae8d..0b3c7fa 100644
--- a/net/url_request/url_request_data_job.h
+++ b/net/url_request/url_request_data_job.h
@@ -30,13 +30,13 @@
URLRequestDataJob(URLRequest* request, NetworkDelegate* network_delegate);
// URLRequestSimpleJob
- virtual int GetData(std::string* mime_type,
- std::string* charset,
- std::string* data,
- const CompletionCallback& callback) const override;
+ int GetData(std::string* mime_type,
+ std::string* charset,
+ std::string* data,
+ const CompletionCallback& callback) const override;
private:
- virtual ~URLRequestDataJob();
+ ~URLRequestDataJob() override;
DISALLOW_COPY_AND_ASSIGN(URLRequestDataJob);
};
diff --git a/net/url_request/url_request_error_job.h b/net/url_request/url_request_error_job.h
index 0bb37ec..059db26 100644
--- a/net/url_request/url_request_error_job.h
+++ b/net/url_request/url_request_error_job.h
@@ -20,10 +20,10 @@
NetworkDelegate* network_delegate,
int error);
- virtual void Start() override;
+ void Start() override;
private:
- virtual ~URLRequestErrorJob();
+ ~URLRequestErrorJob() override;
void StartAsync();
diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h
index b353697..dfb2d74 100644
--- a/net/url_request/url_request_file_dir_job.h
+++ b/net/url_request/url_request_file_dir_job.h
@@ -27,21 +27,18 @@
virtual void StartAsync();
// Overridden from URLRequestJob:
- virtual void Start() override;
- virtual void Kill() override;
- virtual bool ReadRawData(IOBuffer* buf,
- int buf_size,
- int* bytes_read) override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual bool GetCharset(std::string* charset) override;
+ void Start() override;
+ void Kill() override;
+ bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ bool GetMimeType(std::string* mime_type) const override;
+ bool GetCharset(std::string* charset) override;
// Overridden from DirectoryLister::DirectoryListerDelegate:
- virtual void OnListFile(
- const DirectoryLister::DirectoryListerData& data) override;
- virtual void OnListDone(int error) override;
+ void OnListFile(const DirectoryLister::DirectoryListerData& data) override;
+ void OnListDone(int error) override;
private:
- virtual ~URLRequestFileDirJob();
+ ~URLRequestFileDirJob() override;
void CloseLister();
diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h
index 3a5aae7..fe7c6e9 100644
--- a/net/url_request/url_request_file_job.h
+++ b/net/url_request/url_request_file_job.h
@@ -36,24 +36,20 @@
const scoped_refptr<base::TaskRunner>& file_task_runner);
// URLRequestJob:
- virtual void Start() override;
- virtual void Kill() override;
- virtual bool ReadRawData(IOBuffer* buf,
- int buf_size,
- int* bytes_read) override;
- virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) override;
- virtual Filter* SetupFilter() const override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual void SetExtraRequestHeaders(
- const HttpRequestHeaders& headers) override;
+ void Start() override;
+ void Kill() override;
+ bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ bool IsRedirectResponse(GURL* location, int* http_status_code) override;
+ Filter* SetupFilter() const override;
+ bool GetMimeType(std::string* mime_type) const override;
+ void SetExtraRequestHeaders(const HttpRequestHeaders& headers) override;
// An interface for subclasses who wish to monitor read operations.
virtual void OnSeekComplete(int64 result);
virtual void OnReadComplete(net::IOBuffer* buf, int result);
protected:
- virtual ~URLRequestFileJob();
+ ~URLRequestFileJob() override;
int64 remaining_bytes() const { return remaining_bytes_; }
diff --git a/net/url_request/url_request_file_job_unittest.cc b/net/url_request/url_request_file_job_unittest.cc
index ba87766..f4d7f7a 100644
--- a/net/url_request/url_request_file_job_unittest.cc
+++ b/net/url_request/url_request_file_job_unittest.cc
@@ -39,14 +39,14 @@
const std::vector<std::string>& data_chunks() { return data_chunks_; }
protected:
- virtual ~URLRequestFileJobWithCallbacks() {}
+ ~URLRequestFileJobWithCallbacks() override {}
- virtual void OnSeekComplete(int64 result) override {
+ void OnSeekComplete(int64 result) override {
ASSERT_EQ(seek_position_, 0);
seek_position_ = result;
}
- virtual void OnReadComplete(IOBuffer* buf, int result) override {
+ void OnReadComplete(IOBuffer* buf, int result) override {
data_chunks_.push_back(std::string(buf->data(), result));
}
@@ -67,9 +67,9 @@
: path_(path), observer_(observer) {
}
- virtual ~CallbacksJobFactory() {}
+ ~CallbacksJobFactory() override {}
- virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
+ URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
NetworkDelegate* network_delegate) const override {
@@ -82,15 +82,15 @@
return job;
}
- virtual bool IsHandledProtocol(const std::string& scheme) const override {
+ bool IsHandledProtocol(const std::string& scheme) const override {
return scheme == "file";
}
- virtual bool IsHandledURL(const GURL& url) const override {
+ bool IsHandledURL(const GURL& url) const override {
return IsHandledProtocol(url.scheme());
}
- virtual bool IsSafeRedirectTarget(const GURL& location) const override {
+ bool IsSafeRedirectTarget(const GURL& location) const override {
return false;
}
@@ -116,7 +116,7 @@
class JobObserverImpl : public CallbacksJobFactory::JobObserver {
public:
- virtual void OnJobCreated(URLRequestFileJobWithCallbacks* job) override {
+ void OnJobCreated(URLRequestFileJobWithCallbacks* job) override {
jobs_.push_back(job);
}
diff --git a/net/url_request/url_request_filter.cc b/net/url_request/url_request_filter.cc
index 04d61cc..eaa3325 100644
--- a/net/url_request/url_request_filter.cc
+++ b/net/url_request/url_request_filter.cc
@@ -18,11 +18,12 @@
public:
explicit URLRequestFilterInterceptor(URLRequest::ProtocolFactory* factory)
: factory_(factory) {}
- virtual ~URLRequestFilterInterceptor() {}
+ ~URLRequestFilterInterceptor() override {}
// URLRequestInterceptor implementation.
- virtual URLRequestJob* MaybeInterceptRequest(
- URLRequest* request, NetworkDelegate* network_delegate) const override {
+ URLRequestJob* MaybeInterceptRequest(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override {
return factory_(request, network_delegate, request->url().scheme());
}
diff --git a/net/url_request/url_request_filter.h b/net/url_request/url_request_filter.h
index 3388d92..4366dbd 100644
--- a/net/url_request/url_request_filter.h
+++ b/net/url_request/url_request_filter.h
@@ -67,7 +67,7 @@
int hit_count() const { return hit_count_; }
// URLRequestInterceptor implementation:
- virtual URLRequestJob* MaybeInterceptRequest(
+ URLRequestJob* MaybeInterceptRequest(
URLRequest* request,
NetworkDelegate* network_delegate) const override;
@@ -79,7 +79,7 @@
typedef base::hash_map<std::string, URLRequestInterceptor*> URLInterceptorMap;
URLRequestFilter();
- virtual ~URLRequestFilter();
+ ~URLRequestFilter() override;
// Maps hostnames to interceptors. Hostnames take priority over URLs.
HostnameInterceptorMap hostname_interceptor_map_;
diff --git a/net/url_request/url_request_filter_unittest.cc b/net/url_request/url_request_filter_unittest.cc
index bd2a782..3d23b7b 100644
--- a/net/url_request/url_request_filter_unittest.cc
+++ b/net/url_request/url_request_filter_unittest.cc
@@ -40,10 +40,11 @@
class TestURLRequestInterceptor : public URLRequestInterceptor {
public:
- virtual ~TestURLRequestInterceptor() {}
+ ~TestURLRequestInterceptor() override {}
- virtual URLRequestJob* MaybeInterceptRequest(
- URLRequest* request, NetworkDelegate* network_delegate) const override {
+ URLRequestJob* MaybeInterceptRequest(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override {
job_c = new URLRequestTestJob(request, network_delegate);
return job_c;
}
diff --git a/net/url_request/url_request_ftp_job.h b/net/url_request/url_request_ftp_job.h
index 61d4cff..74caf72 100644
--- a/net/url_request/url_request_ftp_job.h
+++ b/net/url_request/url_request_ftp_job.h
@@ -34,16 +34,16 @@
FtpAuthCache* ftp_auth_cache);
protected:
- virtual ~URLRequestFtpJob();
+ ~URLRequestFtpJob() override;
// Overridden from URLRequestJob:
- virtual bool IsSafeRedirect(const GURL& location) override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual void GetResponseInfo(HttpResponseInfo* info) override;
- virtual HostPortPair GetSocketAddress() const override;
- virtual void SetPriority(RequestPriority priority) override;
- virtual void Start() override;
- virtual void Kill() override;
+ bool IsSafeRedirect(const GURL& location) override;
+ bool GetMimeType(std::string* mime_type) const override;
+ void GetResponseInfo(HttpResponseInfo* info) override;
+ HostPortPair GetSocketAddress() const override;
+ void SetPriority(RequestPriority priority) override;
+ void Start() override;
+ void Kill() override;
RequestPriority priority() const { return priority_; }
@@ -62,18 +62,16 @@
void LogFtpServerType(char server_type);
// Overridden from URLRequestJob:
- virtual LoadState GetLoadState() const override;
- virtual bool NeedsAuth() override;
- virtual void GetAuthChallengeInfo(
+ LoadState GetLoadState() const override;
+ bool NeedsAuth() override;
+ void GetAuthChallengeInfo(
scoped_refptr<AuthChallengeInfo>* auth_info) override;
- virtual void SetAuth(const AuthCredentials& credentials) override;
- virtual void CancelAuth() override;
+ void SetAuth(const AuthCredentials& credentials) override;
+ void CancelAuth() override;
// TODO(ibrar): Yet to give another look at this function.
- virtual UploadProgress GetUploadProgress() const override;
- virtual bool ReadRawData(IOBuffer* buf,
- int buf_size,
- int *bytes_read) override;
+ UploadProgress GetUploadProgress() const override;
+ bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
void HandleAuthNeededResponse();
diff --git a/net/url_request/url_request_ftp_job_unittest.cc b/net/url_request/url_request_ftp_job_unittest.cc
index 629613d..5f41edc 100644
--- a/net/url_request/url_request_ftp_job_unittest.cc
+++ b/net/url_request/url_request_ftp_job_unittest.cc
@@ -67,18 +67,15 @@
config_.proxy_rules().ParseFromString("ftp=localhost");
}
- virtual void AddObserver(Observer* observer) override {
- observer_ = observer;
- }
+ void AddObserver(Observer* observer) override { observer_ = observer; }
- virtual void RemoveObserver(Observer* observer) override {
+ void RemoveObserver(Observer* observer) override {
if (observer_ == observer) {
observer_ = NULL;
}
}
- virtual ConfigAvailability GetLatestProxyConfig(
- ProxyConfig* config) override {
+ ConfigAvailability GetLatestProxyConfig(ProxyConfig* config) override {
*config = config_;
return CONFIG_VALID;
}
@@ -108,16 +105,14 @@
using URLRequestFtpJob::priority;
protected:
- virtual ~TestURLRequestFtpJob() {}
+ ~TestURLRequestFtpJob() override {}
};
class MockFtpTransactionFactory : public FtpTransactionFactory {
public:
- virtual FtpTransaction* CreateTransaction() override {
- return NULL;
- }
+ FtpTransaction* CreateTransaction() override { return NULL; }
- virtual void Suspend(bool suspend) override {}
+ void Suspend(bool suspend) override {}
};
// Fixture for priority-related tests. Priority matters when there is
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index fc26e94..a53bbab 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -55,20 +55,20 @@
class URLRequestHttpJob::HttpFilterContext : public FilterContext {
public:
explicit HttpFilterContext(URLRequestHttpJob* job);
- virtual ~HttpFilterContext();
+ ~HttpFilterContext() override;
// FilterContext implementation.
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual bool GetURL(GURL* gurl) const override;
- virtual bool GetContentDisposition(std::string* disposition) const override;
- virtual base::Time GetRequestTime() const override;
- virtual bool IsCachedContent() const override;
- virtual bool IsDownload() const override;
- virtual bool SdchResponseExpected() const override;
- virtual int64 GetByteReadCount() const override;
- virtual int GetResponseCode() const override;
- virtual const URLRequestContext* GetURLRequestContext() const override;
- virtual void RecordPacketStats(StatisticSelector statistic) const override;
+ bool GetMimeType(std::string* mime_type) const override;
+ bool GetURL(GURL* gurl) const override;
+ bool GetContentDisposition(std::string* disposition) const override;
+ base::Time GetRequestTime() const override;
+ bool IsCachedContent() const override;
+ bool IsDownload() const override;
+ bool SdchResponseExpected() const override;
+ int64 GetByteReadCount() const override;
+ int GetResponseCode() const override;
+ const URLRequestContext* GetURLRequestContext() const override;
+ 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.
diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h
index 4b0cc67..f4bea7e 100644
--- a/net/url_request/url_request_http_job.h
+++ b/net/url_request/url_request_http_job.h
@@ -45,12 +45,12 @@
NetworkDelegate* network_delegate,
const HttpUserAgentSettings* http_user_agent_settings);
- virtual ~URLRequestHttpJob();
+ ~URLRequestHttpJob() override;
// Overridden from URLRequestJob:
- virtual void SetPriority(RequestPriority priority) override;
- virtual void Start() override;
- virtual void Kill() override;
+ void SetPriority(RequestPriority priority) override;
+ void Start() override;
+ void Kill() override;
RequestPriority priority() const {
return priority_;
@@ -99,44 +99,40 @@
void RestartTransactionWithAuth(const AuthCredentials& credentials);
// Overridden from URLRequestJob:
- virtual void SetUpload(UploadDataStream* upload) override;
- virtual void SetExtraRequestHeaders(
- const HttpRequestHeaders& headers) override;
- virtual LoadState GetLoadState() const override;
- virtual UploadProgress GetUploadProgress() const override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual bool GetCharset(std::string* charset) override;
- virtual void GetResponseInfo(HttpResponseInfo* info) override;
- virtual void GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual bool GetResponseCookies(std::vector<std::string>* cookies) override;
- virtual int GetResponseCode() const override;
- virtual Filter* SetupFilter() const override;
- virtual bool CopyFragmentOnRedirect(const GURL& location) const override;
- virtual bool IsSafeRedirect(const GURL& location) override;
- virtual bool NeedsAuth() override;
- virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) override;
- virtual void SetAuth(const AuthCredentials& credentials) override;
- virtual void CancelAuth() override;
- virtual void ContinueWithCertificate(X509Certificate* client_cert) override;
- virtual void ContinueDespiteLastError() override;
- virtual void ResumeNetworkStart() override;
- virtual bool ReadRawData(IOBuffer* buf, int buf_size,
- int* bytes_read) override;
- virtual void StopCaching() override;
- virtual bool GetFullRequestHeaders(
- HttpRequestHeaders* headers) const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual void DoneReading() override;
- virtual void DoneReadingRedirectResponse() override;
+ void SetUpload(UploadDataStream* upload) override;
+ void SetExtraRequestHeaders(const HttpRequestHeaders& headers) override;
+ LoadState GetLoadState() const override;
+ UploadProgress GetUploadProgress() const override;
+ bool GetMimeType(std::string* mime_type) const override;
+ bool GetCharset(std::string* charset) override;
+ void GetResponseInfo(HttpResponseInfo* info) override;
+ void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ bool GetResponseCookies(std::vector<std::string>* cookies) override;
+ int GetResponseCode() const override;
+ Filter* SetupFilter() const override;
+ bool CopyFragmentOnRedirect(const GURL& location) const override;
+ bool IsSafeRedirect(const GURL& location) override;
+ bool NeedsAuth() override;
+ void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) override;
+ void SetAuth(const AuthCredentials& credentials) override;
+ void CancelAuth() override;
+ void ContinueWithCertificate(X509Certificate* client_cert) override;
+ void ContinueDespiteLastError() override;
+ void ResumeNetworkStart() override;
+ bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ void StopCaching() override;
+ bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override;
+ int64 GetTotalReceivedBytes() const override;
+ void DoneReading() override;
+ void DoneReadingRedirectResponse() override;
- virtual HostPortPair GetSocketAddress() const override;
- virtual void NotifyURLRequestDestroyed() override;
+ HostPortPair GetSocketAddress() const override;
+ void NotifyURLRequestDestroyed() override;
void RecordTimer();
void ResetTimer();
- virtual void UpdatePacketReadTimes() override;
+ void UpdatePacketReadTimes() override;
void RecordPacketStats(FilterContext::StatisticSelector statistic) const;
void RecordCompressionHistograms();
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc
index c6848d3..b8892c7 100644
--- a/net/url_request/url_request_http_job_unittest.cc
+++ b/net/url_request/url_request_http_job_unittest.cc
@@ -43,7 +43,7 @@
using URLRequestHttpJob::priority;
protected:
- virtual ~TestURLRequestHttpJob() {}
+ ~TestURLRequestHttpJob() override {}
};
class URLRequestHttpJobTest : public ::testing::Test {
@@ -253,61 +253,59 @@
}
// Fake implementation of HttpStreamBase methods.
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override {
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override {
initialize_stream_was_called_ = true;
return ERR_IO_PENDING;
}
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override {
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
+ int ReadResponseHeaders(const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override {
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual void Close(bool not_reusable) override {}
+ void Close(bool not_reusable) override {}
- virtual bool IsResponseBodyComplete() const override { return false; }
+ bool IsResponseBodyComplete() const override { return false; }
- virtual bool CanFindEndOfResponse() const override { return false; }
+ bool CanFindEndOfResponse() const override { return false; }
- virtual bool IsConnectionReused() const override { return false; }
- virtual void SetConnectionReused() override {}
+ bool IsConnectionReused() const override { return false; }
+ void SetConnectionReused() override {}
- virtual bool IsConnectionReusable() const override { return false; }
+ bool IsConnectionReusable() const override { return false; }
- virtual int64 GetTotalReceivedBytes() const override { return 0; }
+ int64 GetTotalReceivedBytes() const override { return 0; }
- virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const
- override {
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override {
return false;
}
- virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
+ void GetSSLInfo(SSLInfo* ssl_info) override {}
- virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info)
- override {}
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {}
- virtual bool IsSpdyHttpStream() const override { return false; }
+ bool IsSpdyHttpStream() const override { return false; }
- virtual void Drain(HttpNetworkSession* session) override {}
+ void Drain(HttpNetworkSession* session) override {}
- virtual void SetPriority(RequestPriority priority) override {}
+ void SetPriority(RequestPriority priority) override {}
// Fake implementation of WebSocketHandshakeStreamBase method(s)
- virtual scoped_ptr<WebSocketStream> Upgrade() override {
+ scoped_ptr<WebSocketStream> Upgrade() override {
return scoped_ptr<WebSocketStream>();
}
diff --git a/net/url_request/url_request_intercepting_job_factory.h b/net/url_request/url_request_intercepting_job_factory.h
index 909a25c..857dbf4 100644
--- a/net/url_request/url_request_intercepting_job_factory.h
+++ b/net/url_request/url_request_intercepting_job_factory.h
@@ -35,16 +35,16 @@
URLRequestInterceptingJobFactory(
scoped_ptr<URLRequestJobFactory> job_factory,
scoped_ptr<URLRequestInterceptor> interceptor);
- virtual ~URLRequestInterceptingJobFactory();
+ ~URLRequestInterceptingJobFactory() override;
// URLRequestJobFactory implementation
- virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
+ URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
NetworkDelegate* network_delegate) const override;
- virtual bool IsHandledProtocol(const std::string& scheme) const override;
- virtual bool IsHandledURL(const GURL& url) const override;
- virtual bool IsSafeRedirectTarget(const GURL& location) const override;
+ bool IsHandledProtocol(const std::string& scheme) const override;
+ bool IsHandledURL(const GURL& url) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
private:
scoped_ptr<URLRequestJobFactory> job_factory_;
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index 5b8760f..e824689 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -219,7 +219,7 @@
// base::PowerObserver methods:
// We invoke URLRequestJob::Kill on suspend (crbug.com/4606).
- virtual void OnSuspend() override;
+ void OnSuspend() override;
// Called after a NetworkDelegate has been informed that the URLRequest
// will be destroyed. This is used to track that no pending callbacks
@@ -229,7 +229,7 @@
protected:
friend class base::RefCounted<URLRequestJob>;
- virtual ~URLRequestJob();
+ ~URLRequestJob() override;
// Notifies the job that a certificate is requested.
void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info);
diff --git a/net/url_request/url_request_job_factory_impl.h b/net/url_request/url_request_job_factory_impl.h
index 94112c1..695661e 100644
--- a/net/url_request/url_request_job_factory_impl.h
+++ b/net/url_request/url_request_job_factory_impl.h
@@ -20,7 +20,7 @@
class NET_EXPORT URLRequestJobFactoryImpl : public URLRequestJobFactory {
public:
URLRequestJobFactoryImpl();
- virtual ~URLRequestJobFactoryImpl();
+ ~URLRequestJobFactoryImpl() override;
// Sets the ProtocolHandler for a scheme. Returns true on success, false on
// failure (a ProtocolHandler already exists for |scheme|). On success,
@@ -29,13 +29,13 @@
ProtocolHandler* protocol_handler);
// URLRequestJobFactory implementation
- virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
+ URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
NetworkDelegate* network_delegate) const override;
- virtual bool IsHandledProtocol(const std::string& scheme) const override;
- virtual bool IsHandledURL(const GURL& url) const override;
- virtual bool IsSafeRedirectTarget(const GURL& location) const override;
+ bool IsHandledProtocol(const std::string& scheme) const override;
+ bool IsHandledURL(const GURL& url) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
private:
// For testing only.
diff --git a/net/url_request/url_request_job_factory_impl_unittest.cc b/net/url_request/url_request_job_factory_impl_unittest.cc
index 61467f1..2c7b3e2 100644
--- a/net/url_request/url_request_job_factory_impl_unittest.cc
+++ b/net/url_request/url_request_job_factory_impl_unittest.cc
@@ -26,7 +26,7 @@
status_(status),
weak_factory_(this) {}
- virtual void Start() override {
+ void Start() override {
// Start reading asynchronously so that all error reporting and data
// callbacks happen as they would for network requests.
base::MessageLoop::current()->PostTask(
@@ -35,7 +35,7 @@
}
protected:
- virtual ~MockURLRequestJob() {}
+ ~MockURLRequestJob() override {}
private:
void StartAsync() {
@@ -49,8 +49,9 @@
class DummyProtocolHandler : public URLRequestJobFactory::ProtocolHandler {
public:
- virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const override {
+ URLRequestJob* MaybeCreateJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override {
return new MockURLRequestJob(
request,
network_delegate,
diff --git a/net/url_request/url_request_redirect_job.h b/net/url_request/url_request_redirect_job.h
index 54bc3f0..ab08399 100644
--- a/net/url_request/url_request_redirect_job.h
+++ b/net/url_request/url_request_redirect_job.h
@@ -42,15 +42,14 @@
const std::string& redirect_reason);
// URLRequestJob implementation:
- virtual void GetResponseInfo(HttpResponseInfo* info) override;
- virtual void GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual void Start() override;
- virtual bool CopyFragmentOnRedirect(const GURL& location) const override;
- virtual int GetResponseCode() const override;
+ void GetResponseInfo(HttpResponseInfo* info) override;
+ void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void Start() override;
+ bool CopyFragmentOnRedirect(const GURL& location) const override;
+ int GetResponseCode() const override;
private:
- virtual ~URLRequestRedirectJob();
+ ~URLRequestRedirectJob() override;
void StartAsync();
diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h
index 01bd319..85d8f7e 100644
--- a/net/url_request/url_request_simple_job.h
+++ b/net/url_request/url_request_simple_job.h
@@ -20,15 +20,13 @@
public:
URLRequestSimpleJob(URLRequest* request, NetworkDelegate* network_delegate);
- virtual void Start() override;
- virtual bool ReadRawData(IOBuffer* buf,
- int buf_size,
- int *bytes_read) override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual bool GetCharset(std::string* charset) override;
+ void Start() override;
+ bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ bool GetMimeType(std::string* mime_type) const override;
+ bool GetCharset(std::string* charset) override;
protected:
- virtual ~URLRequestSimpleJob();
+ ~URLRequestSimpleJob() override;
// Subclasses must override the way response data is determined.
// The return value should be:
diff --git a/net/url_request/url_request_simple_job_unittest.cc b/net/url_request/url_request_simple_job_unittest.cc
index b75da80..5ee71b5 100644
--- a/net/url_request/url_request_simple_job_unittest.cc
+++ b/net/url_request/url_request_simple_job_unittest.cc
@@ -32,10 +32,10 @@
}
protected:
- virtual int GetData(std::string* mime_type,
- std::string* charset,
- std::string* data,
- const CompletionCallback& callback) const override {
+ int GetData(std::string* mime_type,
+ std::string* charset,
+ std::string* data,
+ const CompletionCallback& callback) const override {
mime_type->assign("text/plain");
charset->assign("US-ASCII");
data->assign(kTestData);
@@ -43,7 +43,7 @@
}
private:
- virtual ~MockSimpleJob() {}
+ ~MockSimpleJob() override {}
std::string data_;
@@ -53,7 +53,7 @@
class SimpleJobProtocolHandler :
public URLRequestJobFactory::ProtocolHandler {
public:
- virtual URLRequestJob* MaybeCreateJob(
+ URLRequestJob* MaybeCreateJob(
URLRequest* request,
NetworkDelegate* network_delegate) const override {
return new MockSimpleJob(request, network_delegate);
diff --git a/net/url_request/url_request_test_job.cc b/net/url_request/url_request_test_job.cc
index 3806e25..ecf3943 100644
--- a/net/url_request/url_request_test_job.cc
+++ b/net/url_request/url_request_test_job.cc
@@ -27,8 +27,9 @@
class TestJobProtocolHandler : public URLRequestJobFactory::ProtocolHandler {
public:
// URLRequestJobFactory::ProtocolHandler implementation:
- virtual URLRequestJob* MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const override {
+ URLRequestJob* MaybeCreateJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override {
return new URLRequestTestJob(request, network_delegate);
}
};
diff --git a/net/url_request/url_request_test_job.h b/net/url_request/url_request_test_job.h
index f0f26fd..fbdbe0f 100644
--- a/net/url_request/url_request_test_job.h
+++ b/net/url_request/url_request_test_job.h
@@ -108,19 +108,15 @@
static URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler();
// Job functions
- virtual void SetPriority(RequestPriority priority) override;
- virtual void Start() override;
- virtual bool ReadRawData(IOBuffer* buf,
- int buf_size,
- int *bytes_read) override;
- virtual void Kill() override;
- virtual bool GetMimeType(std::string* mime_type) const override;
- virtual void GetResponseInfo(HttpResponseInfo* info) override;
- virtual void GetLoadTimingInfo(
- LoadTimingInfo* load_timing_info) const override;
- virtual int GetResponseCode() const override;
- virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) override;
+ void SetPriority(RequestPriority priority) override;
+ void Start() override;
+ bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ void Kill() override;
+ bool GetMimeType(std::string* mime_type) const override;
+ void GetResponseInfo(HttpResponseInfo* info) override;
+ void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ int GetResponseCode() const override;
+ bool IsRedirectResponse(GURL* location, int* http_status_code) override;
protected:
// Override to specify whether the next read done from this job will
@@ -133,7 +129,7 @@
// When the stage is DONE, this job will not be put on the queue.
enum Stage { WAITING, DATA_AVAILABLE, ALL_DATA, DONE };
- virtual ~URLRequestTestJob();
+ ~URLRequestTestJob() override;
// Call to process the next opeation, usually sending a notification, and
// advancing the stage if necessary. THIS MAY DELETE THE OBJECT.
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index d301154..5784931 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -58,7 +58,7 @@
// URLRequestContext before it is constructed completely. If
// |delay_initialization| is true, Init() needs be be called manually.
explicit TestURLRequestContext(bool delay_initialization);
- virtual ~TestURLRequestContext();
+ ~TestURLRequestContext() override;
void Init();
@@ -108,12 +108,12 @@
scoped_ptr<TestURLRequestContext> context);
// URLRequestContextGetter implementation.
- virtual TestURLRequestContext* GetURLRequestContext() override;
- virtual scoped_refptr<base::SingleThreadTaskRunner>
- GetNetworkTaskRunner() const override;
+ TestURLRequestContext* GetURLRequestContext() override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
+ const override;
protected:
- virtual ~TestURLRequestContextGetter();
+ ~TestURLRequestContextGetter() override;
private:
const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
@@ -125,7 +125,7 @@
class TestDelegate : public URLRequest::Delegate {
public:
TestDelegate();
- virtual ~TestDelegate();
+ ~TestDelegate() override;
void set_cancel_in_received_redirect(bool val) { cancel_in_rr_ = val; }
void set_cancel_in_response_started(bool val) { cancel_in_rs_ = val; }
@@ -169,21 +169,20 @@
void ClearFullRequestHeaders();
// URLRequest::Delegate:
- virtual void OnReceivedRedirect(URLRequest* request,
- const RedirectInfo& redirect_info,
- bool* defer_redirect) override;
- virtual void OnBeforeNetworkStart(URLRequest* request, bool* defer) override;
- virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) override;
+ void OnReceivedRedirect(URLRequest* request,
+ const RedirectInfo& redirect_info,
+ bool* defer_redirect) override;
+ void OnBeforeNetworkStart(URLRequest* request, bool* defer) override;
+ void OnAuthRequired(URLRequest* request,
+ AuthChallengeInfo* auth_info) override;
// NOTE: |fatal| causes |certificate_errors_are_fatal_| to be set to true.
// (Unit tests use this as a post-condition.) But for policy, this method
// consults |allow_certificate_errors_|.
- virtual void OnSSLCertificateError(URLRequest* request,
- const SSLInfo& ssl_info,
- bool fatal) override;
- virtual void OnResponseStarted(URLRequest* request) override;
- virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) override;
+ void OnSSLCertificateError(URLRequest* request,
+ const SSLInfo& ssl_info,
+ bool fatal) override;
+ void OnResponseStarted(URLRequest* request) override;
+ void OnReadCompleted(URLRequest* request, int bytes_read) override;
private:
static const int kBufferSize = 4096;
@@ -229,7 +228,7 @@
};
TestNetworkDelegate();
- virtual ~TestNetworkDelegate();
+ ~TestNetworkDelegate() override;
// Writes the LoadTimingInfo during the most recent call to OnBeforeRedirect.
bool GetLoadTimingInfoBeforeRedirect(
@@ -284,51 +283,45 @@
protected:
// NetworkDelegate:
- virtual int OnBeforeURLRequest(URLRequest* request,
- const CompletionCallback& callback,
- GURL* new_url) override;
- virtual int OnBeforeSendHeaders(URLRequest* request,
- const CompletionCallback& callback,
- HttpRequestHeaders* headers) override;
- virtual void OnBeforeSendProxyHeaders(
- net::URLRequest* request,
- const net::ProxyInfo& proxy_info,
- net::HttpRequestHeaders* headers) override;
- virtual void OnSendHeaders(URLRequest* request,
- const HttpRequestHeaders& headers) override;
- virtual int OnHeadersReceived(
+ int OnBeforeURLRequest(URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) override;
+ int OnBeforeSendHeaders(URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) override;
+ void OnBeforeSendProxyHeaders(net::URLRequest* request,
+ const net::ProxyInfo& proxy_info,
+ net::HttpRequestHeaders* headers) override;
+ void OnSendHeaders(URLRequest* request,
+ const HttpRequestHeaders& headers) override;
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
GURL* allowed_unsafe_redirect_url) override;
- virtual void OnBeforeRedirect(URLRequest* request,
- const GURL& new_location) override;
- virtual void OnResponseStarted(URLRequest* request) override;
- virtual void OnRawBytesRead(const URLRequest& request,
- int bytes_read) override;
- virtual void OnCompleted(URLRequest* request, bool started) override;
- virtual void OnURLRequestDestroyed(URLRequest* request) override;
- virtual void OnPACScriptError(int line_number,
- const base::string16& error) override;
- virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
+ void OnBeforeRedirect(URLRequest* request, const GURL& new_location) override;
+ void OnResponseStarted(URLRequest* request) override;
+ void OnRawBytesRead(const URLRequest& request, int bytes_read) override;
+ void OnCompleted(URLRequest* request, bool started) override;
+ void OnURLRequestDestroyed(URLRequest* request) override;
+ void OnPACScriptError(int line_number, const base::string16& error) override;
+ NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
AuthCredentials* credentials) override;
- virtual bool OnCanGetCookies(const URLRequest& request,
- const CookieList& cookie_list) override;
- virtual bool OnCanSetCookie(const URLRequest& request,
- const std::string& cookie_line,
- CookieOptions* options) override;
- virtual bool OnCanAccessFile(const URLRequest& request,
- const base::FilePath& path) const override;
- virtual bool OnCanThrottleRequest(
- const URLRequest& request) const override;
- virtual int OnBeforeSocketStreamConnect(
- SocketStream* stream,
- const CompletionCallback& callback) override;
- virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
+ bool OnCanGetCookies(const URLRequest& request,
+ const CookieList& cookie_list) override;
+ bool OnCanSetCookie(const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) override;
+ bool OnCanAccessFile(const URLRequest& request,
+ const base::FilePath& path) const override;
+ bool OnCanThrottleRequest(const URLRequest& request) const override;
+ int OnBeforeSocketStreamConnect(SocketStream* stream,
+ const CompletionCallback& callback) override;
+ bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const URLRequest& request,
const GURL& target_url,
const GURL& referrer_url) const override;
@@ -406,7 +399,7 @@
public:
TestJobInterceptor();
- virtual URLRequestJob* MaybeCreateJob(
+ URLRequestJob* MaybeCreateJob(
URLRequest* request,
NetworkDelegate* network_delegate) const override;
void set_main_intercept_job(URLRequestJob* job);
diff --git a/net/url_request/url_request_throttler_entry.h b/net/url_request/url_request_throttler_entry.h
index 489eecb..281d0f5 100644
--- a/net/url_request/url_request_throttler_entry.h
+++ b/net/url_request/url_request_throttler_entry.h
@@ -93,19 +93,18 @@
void DetachManager();
// Implementation of URLRequestThrottlerEntryInterface.
- virtual bool ShouldRejectRequest(
- const URLRequest& request,
- NetworkDelegate* network_delegate) const override;
- virtual int64 ReserveSendingTimeForNextRequest(
+ bool ShouldRejectRequest(const URLRequest& request,
+ NetworkDelegate* network_delegate) const override;
+ int64 ReserveSendingTimeForNextRequest(
const base::TimeTicks& earliest_time) override;
- virtual base::TimeTicks GetExponentialBackoffReleaseTime() const override;
- virtual void UpdateWithResponse(
+ base::TimeTicks GetExponentialBackoffReleaseTime() const override;
+ void UpdateWithResponse(
const std::string& host,
const URLRequestThrottlerHeaderInterface* response) override;
- virtual void ReceivedContentWasMalformed(int response_code) override;
+ void ReceivedContentWasMalformed(int response_code) override;
protected:
- virtual ~URLRequestThrottlerEntry();
+ ~URLRequestThrottlerEntry() override;
void Initialize();
diff --git a/net/url_request/url_request_throttler_header_adapter.h b/net/url_request/url_request_throttler_header_adapter.h
index ddf7865..e5fbcd2 100644
--- a/net/url_request/url_request_throttler_header_adapter.h
+++ b/net/url_request/url_request_throttler_header_adapter.h
@@ -20,11 +20,11 @@
: public URLRequestThrottlerHeaderInterface {
public:
explicit URLRequestThrottlerHeaderAdapter(HttpResponseHeaders* headers);
- virtual ~URLRequestThrottlerHeaderAdapter();
+ ~URLRequestThrottlerHeaderAdapter() override;
// Implementation of URLRequestThrottlerHeaderInterface
- virtual std::string GetNormalizedValue(const std::string& key) const override;
- virtual int GetResponseCode() const override;
+ std::string GetNormalizedValue(const std::string& key) const override;
+ int GetResponseCode() const override;
private:
const scoped_refptr<HttpResponseHeaders> response_header_;
diff --git a/net/url_request/url_request_throttler_manager.h b/net/url_request/url_request_throttler_manager.h
index 10c6561..ee2f221 100644
--- a/net/url_request/url_request_throttler_manager.h
+++ b/net/url_request/url_request_throttler_manager.h
@@ -38,7 +38,7 @@
public NetworkChangeNotifier::ConnectionTypeObserver {
public:
URLRequestThrottlerManager();
- virtual ~URLRequestThrottlerManager();
+ ~URLRequestThrottlerManager() override;
// Must be called for every request, returns the URL request throttler entry
// associated with the URL. The caller must inform this entry of some events.
@@ -78,10 +78,10 @@
NetLog* net_log() const;
// IPAddressObserver interface.
- virtual void OnIPAddressChanged() override;
+ void OnIPAddressChanged() override;
// ConnectionTypeObserver interface.
- virtual void OnConnectionTypeChanged(
+ void OnConnectionTypeChanged(
NetworkChangeNotifier::ConnectionType type) override;
// Method that allows us to transform a URL into an ID that can be used in our
diff --git a/net/url_request/url_request_throttler_simulation_unittest.cc b/net/url_request/url_request_throttler_simulation_unittest.cc
index 129a776..cd18659 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -135,11 +135,11 @@
end_downtime_ = start_time + duration;
}
- virtual void AdvanceTime(const TimeTicks& absolute_time) override {
+ void AdvanceTime(const TimeTicks& absolute_time) override {
now_ = absolute_time;
}
- virtual void PerformAction() override {
+ void PerformAction() override {
// We are inserted at the end of the actor's list, so all Requester
// instances have already done their bit.
if (num_current_tick_queries_ > max_experienced_queries_per_tick_)
@@ -306,17 +306,13 @@
: URLRequestThrottlerEntry(manager, std::string()),
mock_backoff_entry_(&backoff_policy_) {}
- virtual const BackoffEntry* GetBackoffEntry() const override {
+ const BackoffEntry* GetBackoffEntry() const override {
return &mock_backoff_entry_;
}
- virtual BackoffEntry* GetBackoffEntry() override {
- return &mock_backoff_entry_;
- }
+ BackoffEntry* GetBackoffEntry() override { return &mock_backoff_entry_; }
- virtual TimeTicks ImplGetTimeNow() const override {
- return fake_now_;
- }
+ TimeTicks ImplGetTimeNow() const override { return fake_now_; }
void SetFakeNow(const TimeTicks& fake_time) {
fake_now_ = fake_time;
@@ -328,7 +324,7 @@
}
protected:
- virtual ~MockURLRequestThrottlerEntry() {}
+ ~MockURLRequestThrottlerEntry() override {}
private:
TimeTicks fake_now_;
@@ -414,14 +410,14 @@
DCHECK(server_);
}
- virtual void AdvanceTime(const TimeTicks& absolute_time) override {
+ void AdvanceTime(const TimeTicks& absolute_time) override {
if (time_of_last_success_.is_null())
time_of_last_success_ = absolute_time;
throttler_entry_->SetFakeNow(absolute_time);
}
- virtual void PerformAction() override {
+ void PerformAction() override {
TimeDelta effective_delay = time_between_requests_;
TimeDelta current_jitter = TimeDelta::FromMilliseconds(
request_jitter_.InMilliseconds() * base::RandDouble());
diff --git a/net/url_request/url_request_throttler_test_support.h b/net/url_request/url_request_throttler_test_support.h
index 60a63b2..a710333 100644
--- a/net/url_request/url_request_throttler_test_support.h
+++ b/net/url_request/url_request_throttler_test_support.h
@@ -16,10 +16,10 @@
class MockBackoffEntry : public BackoffEntry {
public:
explicit MockBackoffEntry(const BackoffEntry::Policy* const policy);
- virtual ~MockBackoffEntry();
+ ~MockBackoffEntry() override;
// BackoffEntry overrides.
- virtual base::TimeTicks ImplGetTimeNow() const override;
+ base::TimeTicks ImplGetTimeNow() const override;
void set_fake_now(const base::TimeTicks& now);
@@ -42,11 +42,11 @@
MockURLRequestThrottlerHeaderAdapter(const std::string& retry_value,
const std::string& opt_out_value,
int response_code);
- virtual ~MockURLRequestThrottlerHeaderAdapter();
+ ~MockURLRequestThrottlerHeaderAdapter() override;
// URLRequestThrottlerHeaderInterface overrides.
- virtual std::string GetNormalizedValue(const std::string& key) const override;
- virtual int GetResponseCode() const override;
+ std::string GetNormalizedValue(const std::string& key) const override;
+ int GetResponseCode() const override;
private:
std::string fake_retry_value_;
diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc
index 4188b77..5a309b9 100644
--- a/net/url_request/url_request_throttler_unittest.cc
+++ b/net/url_request/url_request_throttler_unittest.cc
@@ -63,13 +63,11 @@
backoff_policy_.num_errors_to_ignore = 0;
}
- virtual const BackoffEntry* GetBackoffEntry() const override {
+ const BackoffEntry* GetBackoffEntry() const override {
return &mock_backoff_entry_;
}
- virtual BackoffEntry* GetBackoffEntry() override {
- return &mock_backoff_entry_;
- }
+ BackoffEntry* GetBackoffEntry() override { return &mock_backoff_entry_; }
static bool ExplicitUserRequest(int load_flags) {
return URLRequestThrottlerEntry::ExplicitUserRequest(load_flags);
@@ -85,7 +83,7 @@
}
// Overridden for tests.
- virtual TimeTicks ImplGetTimeNow() const override { return fake_time_now_; }
+ TimeTicks ImplGetTimeNow() const override { return fake_time_now_; }
void set_exponential_backoff_release_time(
const base::TimeTicks& release_time) {
@@ -106,7 +104,7 @@
MockBackoffEntry mock_backoff_entry_;
protected:
- virtual ~MockURLRequestThrottlerEntry() {}
+ ~MockURLRequestThrottlerEntry() override {}
};
class MockURLRequestThrottlerManager : public URLRequestThrottlerManager {
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 5756801..700b070 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -367,22 +367,22 @@
const AuthCallback& callback);
// TestNetworkDelegate implementation.
- virtual int OnBeforeURLRequest(URLRequest* request,
- const CompletionCallback& callback,
- GURL* new_url) override;
+ int OnBeforeURLRequest(URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) override;
- virtual int OnBeforeSendHeaders(URLRequest* request,
- const CompletionCallback& callback,
- HttpRequestHeaders* headers) override;
+ int OnBeforeSendHeaders(URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) override;
- virtual int OnHeadersReceived(
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
GURL* allowed_unsafe_redirect_url) override;
- virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
+ NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
@@ -596,7 +596,7 @@
set_network_delegate(delegate);
Init();
}
- virtual ~TestURLRequestContextWithProxy() {}
+ ~TestURLRequestContextWithProxy() override {}
};
} // namespace
@@ -1105,11 +1105,9 @@
RestartTestJob(URLRequest* request, NetworkDelegate* network_delegate)
: URLRequestTestJob(request, network_delegate, true) {}
protected:
- virtual void StartAsync() override {
- this->NotifyRestartRequired();
- }
+ void StartAsync() override { this->NotifyRestartRequired(); }
private:
- virtual ~RestartTestJob() {}
+ ~RestartTestJob() override {}
};
class CancelTestJob : public URLRequestTestJob {
@@ -1117,11 +1115,9 @@
explicit CancelTestJob(URLRequest* request, NetworkDelegate* network_delegate)
: URLRequestTestJob(request, network_delegate, true) {}
protected:
- virtual void StartAsync() override {
- request_->Cancel();
- }
+ void StartAsync() override { request_->Cancel(); }
private:
- virtual ~CancelTestJob() {}
+ ~CancelTestJob() override {}
};
class CancelThenRestartTestJob : public URLRequestTestJob {
@@ -1131,12 +1127,12 @@
: URLRequestTestJob(request, network_delegate, true) {
}
protected:
- virtual void StartAsync() override {
+ void StartAsync() override {
request_->Cancel();
this->NotifyRestartRequired();
}
private:
- virtual ~CancelThenRestartTestJob() {}
+ ~CancelThenRestartTestJob() override {}
};
// An Interceptor for use with interceptor tests
@@ -1156,13 +1152,12 @@
URLRequest::Deprecated::RegisterRequestInterceptor(this);
}
- virtual ~TestInterceptor() {
+ ~TestInterceptor() override {
URLRequest::Deprecated::UnregisterRequestInterceptor(this);
}
- virtual URLRequestJob* MaybeIntercept(
- URLRequest* request,
- NetworkDelegate* network_delegate) override {
+ URLRequestJob* MaybeIntercept(URLRequest* request,
+ NetworkDelegate* network_delegate) override {
if (restart_main_request_) {
restart_main_request_ = false;
did_restart_main_ = true;
@@ -1197,10 +1192,9 @@
return job;
}
- virtual URLRequestJob* MaybeInterceptRedirect(
- URLRequest* request,
- NetworkDelegate* network_delegate,
- const GURL& location) override {
+ URLRequestJob* MaybeInterceptRedirect(URLRequest* request,
+ NetworkDelegate* network_delegate,
+ const GURL& location) override {
if (cancel_redirect_request_) {
cancel_redirect_request_ = false;
did_cancel_redirect_ = true;
@@ -1217,8 +1211,9 @@
true);
}
- virtual URLRequestJob* MaybeInterceptResponse(
- URLRequest* request, NetworkDelegate* network_delegate) override {
+ URLRequestJob* MaybeInterceptResponse(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) override {
if (cancel_final_request_) {
cancel_final_request_ = false;
did_cancel_final_ = true;
@@ -2396,10 +2391,10 @@
public:
explicit FixedDateNetworkDelegate(const std::string& fixed_date)
: fixed_date_(fixed_date) {}
- virtual ~FixedDateNetworkDelegate() {}
+ ~FixedDateNetworkDelegate() override {}
// NetworkDelegate implementation
- virtual int OnHeadersReceived(
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
@@ -3991,24 +3986,24 @@
class AsyncLoggingNetworkDelegate : public TestNetworkDelegate {
public:
AsyncLoggingNetworkDelegate() {}
- virtual ~AsyncLoggingNetworkDelegate() {}
+ ~AsyncLoggingNetworkDelegate() override {}
// NetworkDelegate implementation.
- virtual int OnBeforeURLRequest(URLRequest* request,
- const CompletionCallback& callback,
- GURL* new_url) override {
+ int OnBeforeURLRequest(URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) override {
TestNetworkDelegate::OnBeforeURLRequest(request, callback, new_url);
return RunCallbackAsynchronously(request, callback);
}
- virtual int OnBeforeSendHeaders(URLRequest* request,
- const CompletionCallback& callback,
- HttpRequestHeaders* headers) override {
+ int OnBeforeSendHeaders(URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) override {
TestNetworkDelegate::OnBeforeSendHeaders(request, callback, headers);
return RunCallbackAsynchronously(request, callback);
}
- virtual int OnHeadersReceived(
+ int OnHeadersReceived(
URLRequest* request,
const CompletionCallback& callback,
const HttpResponseHeaders* original_response_headers,
@@ -4022,7 +4017,7 @@
return RunCallbackAsynchronously(request, callback);
}
- virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired(
+ NetworkDelegate::AuthRequiredResponse OnAuthRequired(
URLRequest* request,
const AuthChallengeInfo& auth_info,
const AuthCallback& callback,
@@ -4083,12 +4078,12 @@
else if (cancel_stage == CANCEL_ON_READ_COMPLETED)
set_cancel_in_received_data(true);
}
- virtual ~AsyncLoggingUrlRequestDelegate() {}
+ ~AsyncLoggingUrlRequestDelegate() override {}
// URLRequest::Delegate implementation:
- void virtual OnReceivedRedirect(URLRequest* request,
- const RedirectInfo& redirect_info,
- bool* defer_redirect) override {
+ void OnReceivedRedirect(URLRequest* request,
+ const RedirectInfo& redirect_info,
+ bool* defer_redirect) override {
*defer_redirect = true;
AsyncDelegateLogger::Run(
request,
@@ -4100,7 +4095,7 @@
base::Unretained(this), request, redirect_info));
}
- virtual void OnResponseStarted(URLRequest* request) override {
+ void OnResponseStarted(URLRequest* request) override {
AsyncDelegateLogger::Run(
request,
LOAD_STATE_WAITING_FOR_DELEGATE,
@@ -4111,8 +4106,7 @@
base::Unretained(this), request));
}
- virtual void OnReadCompleted(URLRequest* request,
- int bytes_read) override {
+ void OnReadCompleted(URLRequest* request, int bytes_read) override {
AsyncDelegateLogger::Run(
request,
LOAD_STATE_IDLE,
@@ -4578,9 +4572,9 @@
const char kExtraValue[] = "fubar";
class RedirectWithAdditionalHeadersDelegate : public TestDelegate {
- 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 {
TestDelegate::OnReceivedRedirect(request, redirect_info, defer_redirect);
request->SetExtraRequestHeaderByName(kExtraHeader, kExtraValue, false);
}
@@ -4615,9 +4609,9 @@
const char kExtraHeaderToRemove[] = "To-Be-Removed";
class RedirectWithHeaderRemovalDelegate : public TestDelegate {
- 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 {
TestDelegate::OnReceivedRedirect(request, redirect_info, defer_redirect);
request->RemoveRequestHeaderByName(kExtraHeaderToRemove);
}
@@ -6811,9 +6805,8 @@
public:
SSLClientAuthTestDelegate() : on_certificate_requested_count_(0) {
}
- virtual void OnCertificateRequested(
- URLRequest* request,
- SSLCertRequestInfo* cert_request_info) override {
+ void OnCertificateRequested(URLRequest* request,
+ SSLCertRequestInfo* cert_request_info) override {
on_certificate_requested_count_++;
base::MessageLoop::current()->Quit();
}
@@ -7092,7 +7085,7 @@
}
// SSLConfigService:
- virtual void GetSSLConfig(SSLConfig* config) override {
+ void GetSSLConfig(SSLConfig* config) override {
*config = SSLConfig();
config->rev_checking_enabled = online_rev_checking_;
config->verify_ev_cert = ev_enabled_;
@@ -7104,7 +7097,7 @@
}
protected:
- virtual ~TestSSLConfigService() {}
+ ~TestSSLConfigService() override {}
private:
const bool ev_enabled_;
@@ -7664,7 +7657,7 @@
class HTTPSHardFailTest : public HTTPSOCSPTest {
protected:
- virtual void SetupContext(URLRequestContext* context) override {
+ void SetupContext(URLRequestContext* context) override {
context->set_ssl_config_service(
new TestSSLConfigService(false /* check for EV */,
false /* online revocation checking */,
@@ -7702,7 +7695,7 @@
class HTTPSEVCRLSetTest : public HTTPSOCSPTest {
protected:
- virtual void SetupContext(URLRequestContext* context) override {
+ void SetupContext(URLRequestContext* context) override {
context->set_ssl_config_service(
new TestSSLConfigService(true /* check for EV */,
false /* online revocation checking */,
@@ -7887,7 +7880,7 @@
class HTTPSCRLSetTest : public HTTPSOCSPTest {
protected:
- virtual void SetupContext(URLRequestContext* context) override {
+ void SetupContext(URLRequestContext* context) override {
context->set_ssl_config_service(
new TestSSLConfigService(false /* check for EV */,
false /* online revocation checking */,
diff --git a/net/url_request/view_cache_helper_unittest.cc b/net/url_request/view_cache_helper_unittest.cc
index 31ad0ba..097eade 100644
--- a/net/url_request/view_cache_helper_unittest.cc
+++ b/net/url_request/view_cache_helper_unittest.cc
@@ -21,9 +21,7 @@
public:
TestURLRequestContext();
- virtual ~TestURLRequestContext() {
- AssertNoURLRequests();
- }
+ ~TestURLRequestContext() override { AssertNoURLRequests(); }
// Gets a pointer to the cache backend.
disk_cache::Backend* GetBackend();
diff --git a/net/websockets/websocket_basic_handshake_stream.h b/net/websockets/websocket_basic_handshake_stream.h
index cc8f5bf..98e80a2 100644
--- a/net/websockets/websocket_basic_handshake_stream.h
+++ b/net/websockets/websocket_basic_handshake_stream.h
@@ -36,41 +36,39 @@
std::vector<std::string> requested_extensions,
std::string* failure_message);
- virtual ~WebSocketBasicHandshakeStream();
+ ~WebSocketBasicHandshakeStream() override;
// HttpStreamBase methods
- virtual int InitializeStream(const HttpRequestInfo* request_info,
- RequestPriority priority,
- const BoundNetLog& net_log,
- const CompletionCallback& callback) override;
- virtual int SendRequest(const HttpRequestHeaders& request_headers,
- HttpResponseInfo* response,
- const CompletionCallback& callback) override;
- virtual int ReadResponseHeaders(const CompletionCallback& callback) override;
- virtual int ReadResponseBody(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) override;
- virtual void Close(bool not_reusable) override;
- virtual bool IsResponseBodyComplete() const override;
- virtual bool CanFindEndOfResponse() const override;
- virtual bool IsConnectionReused() const override;
- virtual void SetConnectionReused() override;
- virtual bool IsConnectionReusable() const override;
- virtual int64 GetTotalReceivedBytes() const override;
- virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const
- override;
- virtual void GetSSLInfo(SSLInfo* ssl_info) override;
- virtual void GetSSLCertRequestInfo(
- SSLCertRequestInfo* cert_request_info) override;
- virtual bool IsSpdyHttpStream() const override;
- virtual void Drain(HttpNetworkSession* session) override;
- virtual void SetPriority(RequestPriority priority) override;
+ int InitializeStream(const HttpRequestInfo* request_info,
+ RequestPriority priority,
+ const BoundNetLog& net_log,
+ const CompletionCallback& callback) override;
+ int SendRequest(const HttpRequestHeaders& request_headers,
+ HttpResponseInfo* response,
+ const CompletionCallback& callback) override;
+ int ReadResponseHeaders(const CompletionCallback& callback) override;
+ int ReadResponseBody(IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback) override;
+ void Close(bool not_reusable) override;
+ bool IsResponseBodyComplete() const override;
+ bool CanFindEndOfResponse() const override;
+ bool IsConnectionReused() const override;
+ void SetConnectionReused() override;
+ bool IsConnectionReusable() const override;
+ int64 GetTotalReceivedBytes() const override;
+ bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
+ void GetSSLInfo(SSLInfo* ssl_info) override;
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override;
+ bool IsSpdyHttpStream() const override;
+ void Drain(HttpNetworkSession* session) override;
+ void SetPriority(RequestPriority priority) override;
// This is called from the top level once correct handshake response headers
// have been received. It creates an appropriate subclass of WebSocketStream
// depending on what extensions were negotiated. This object is unusable after
// Upgrade() has been called and should be disposed of as soon as possible.
- virtual scoped_ptr<WebSocketStream> Upgrade() override;
+ scoped_ptr<WebSocketStream> Upgrade() override;
// Set the value used for the next Sec-WebSocket-Key header
// deterministically. The key is only used once, and then discarded.
diff --git a/net/websockets/websocket_basic_stream.h b/net/websockets/websocket_basic_stream.h
index ed2f195..d456d8d 100644
--- a/net/websockets/websocket_basic_stream.h
+++ b/net/websockets/websocket_basic_stream.h
@@ -40,20 +40,20 @@
// The destructor has to make sure the connection is closed when we finish so
// that it does not get returned to the pool.
- virtual ~WebSocketBasicStream();
+ ~WebSocketBasicStream() override;
// WebSocketStream implementation.
- virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override;
+ int ReadFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override;
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override;
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override;
- virtual void Close() override;
+ void Close() override;
- virtual std::string GetSubProtocol() const override;
+ std::string GetSubProtocol() const override;
- virtual std::string GetExtensions() const override;
+ std::string GetExtensions() const override;
////////////////////////////////////////////////////////////////////////////
// Methods for testing only.
diff --git a/net/websockets/websocket_basic_stream_test.cc b/net/websockets/websocket_basic_stream_test.cc
index a658fcf..92b7d3f 100644
--- a/net/websockets/websocket_basic_stream_test.cc
+++ b/net/websockets/websocket_basic_stream_test.cc
@@ -90,7 +90,7 @@
: StaticSocketDataProvider(reads, reads_count, writes, writes_count),
strict_mode_(strict_mode) {}
- virtual ~StrictStaticSocketDataProvider() {
+ ~StrictStaticSocketDataProvider() override {
if (strict_mode_) {
EXPECT_EQ(read_count(), read_index());
EXPECT_EQ(write_count(), write_index());
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 9585dc2..a6eeb1c 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -153,27 +153,27 @@
public:
explicit ConnectDelegate(WebSocketChannel* creator) : creator_(creator) {}
- virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
+ void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
creator_->OnConnectSuccess(stream.Pass());
// |this| may have been deleted.
}
- virtual void OnFailure(const std::string& message) override {
+ void OnFailure(const std::string& message) override {
creator_->OnConnectFailure(message);
// |this| has been deleted.
}
- virtual void OnStartOpeningHandshake(
+ void OnStartOpeningHandshake(
scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
creator_->OnStartOpeningHandshake(request.Pass());
}
- virtual void OnFinishOpeningHandshake(
+ void OnFinishOpeningHandshake(
scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
creator_->OnFinishOpeningHandshake(response.Pass());
}
- virtual void OnSSLCertificateError(
+ void OnSSLCertificateError(
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
ssl_error_callbacks,
const SSLInfo& ssl_info,
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index c7bfeb0..15163de 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -192,38 +192,35 @@
// This fake EventInterface is for tests which need a WebSocketEventInterface
// implementation but are not verifying how it is used.
class FakeWebSocketEventInterface : public WebSocketEventInterface {
- virtual ChannelState OnAddChannelResponse(
- bool fail,
- const std::string& selected_protocol,
- const std::string& extensions) override {
+ ChannelState OnAddChannelResponse(bool fail,
+ const std::string& selected_protocol,
+ const std::string& extensions) override {
return fail ? CHANNEL_DELETED : CHANNEL_ALIVE;
}
- virtual ChannelState OnDataFrame(bool fin,
- WebSocketMessageType type,
- const std::vector<char>& data) override {
+ ChannelState OnDataFrame(bool fin,
+ WebSocketMessageType type,
+ const std::vector<char>& data) override {
return CHANNEL_ALIVE;
}
- virtual ChannelState OnFlowControl(int64 quota) override {
- return CHANNEL_ALIVE;
- }
- virtual ChannelState OnClosingHandshake() override { return CHANNEL_ALIVE; }
- virtual ChannelState OnFailChannel(const std::string& message) override {
+ ChannelState OnFlowControl(int64 quota) override { return CHANNEL_ALIVE; }
+ ChannelState OnClosingHandshake() override { return CHANNEL_ALIVE; }
+ ChannelState OnFailChannel(const std::string& message) override {
return CHANNEL_DELETED;
}
- virtual ChannelState OnDropChannel(bool was_clean,
- uint16 code,
- const std::string& reason) override {
+ ChannelState OnDropChannel(bool was_clean,
+ uint16 code,
+ const std::string& reason) override {
return CHANNEL_DELETED;
}
- virtual ChannelState OnStartOpeningHandshake(
+ ChannelState OnStartOpeningHandshake(
scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
return CHANNEL_ALIVE;
}
- virtual ChannelState OnFinishOpeningHandshake(
+ ChannelState OnFinishOpeningHandshake(
scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
return CHANNEL_ALIVE;
}
- virtual ChannelState OnSSLCertificateError(
+ ChannelState OnSSLCertificateError(
scoped_ptr<SSLErrorCallbacks> ssl_error_callbacks,
const GURL& url,
const SSLInfo& ssl_info,
@@ -245,23 +242,23 @@
const std::string& extensions)
: protocol_(protocol), extensions_(extensions) {}
- virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int ReadFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
return ERR_IO_PENDING;
}
- virtual void Close() override {}
+ void Close() override {}
// Returns the string passed to the constructor.
- virtual std::string GetSubProtocol() const override { return protocol_; }
+ std::string GetSubProtocol() const override { return protocol_; }
// Returns the string passed to the constructor.
- virtual std::string GetExtensions() const override { return extensions_; }
+ std::string GetExtensions() const override { return extensions_; }
private:
// The string to return from GetSubProtocol().
@@ -456,7 +453,7 @@
ReadableFakeWebSocketStream() : index_(0), read_frames_pending_(false) {}
// Check that all the prepared responses have been consumed.
- virtual ~ReadableFakeWebSocketStream() {
+ ~ReadableFakeWebSocketStream() override {
CHECK(index_ >= responses_.size());
CHECK(!read_frames_pending_);
}
@@ -492,8 +489,8 @@
new Response(async, error, ScopedVector<WebSocketFrame>()));
}
- virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int ReadFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
CHECK(!read_frames_pending_);
if (index_ >= responses_.size())
return ERR_IO_PENDING;
@@ -549,8 +546,8 @@
// synchronously.
class WriteableFakeWebSocketStream : public FakeWebSocketStream {
public:
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
return OK;
}
};
@@ -558,8 +555,8 @@
// A FakeWebSocketStream where writes always fail.
class UnWriteableFakeWebSocketStream : public FakeWebSocketStream {
public:
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
return ERR_CONNECTION_RESET;
}
};
@@ -574,8 +571,8 @@
public:
EchoeyFakeWebSocketStream() : read_frames_(NULL), done_(false) {}
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
// Users of WebSocketStream will not expect the ReadFrames() callback to be
// called from within WriteFrames(), so post it to the message loop instead.
stored_frames_.insert(stored_frames_.end(), frames->begin(), frames->end());
@@ -584,8 +581,8 @@
return OK;
}
- virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int ReadFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
read_callback_ = callback;
read_frames_ = frames;
if (done_)
@@ -647,8 +644,8 @@
public:
ResetOnWriteFakeWebSocketStream() : closed_(false), weak_ptr_factory_(this) {}
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&ResetOnWriteFakeWebSocketStream::CallCallbackUnlessClosed,
@@ -664,13 +661,13 @@
return ERR_IO_PENDING;
}
- virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override {
+ int ReadFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override {
read_callback_ = callback;
return ERR_IO_PENDING;
}
- virtual void Close() override { closed_ = true; }
+ void Close() override { closed_ = true; }
private:
void CallCallbackUnlessClosed(const CompletionCallback& callback, int value) {
@@ -736,8 +733,8 @@
class FakeSSLErrorCallbacks
: public WebSocketEventInterface::SSLErrorCallbacks {
public:
- virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) override {}
- virtual void ContinueSSLRequest() override {}
+ void CancelSSLRequest(int error, const SSLInfo* ssl_info) override {}
+ void ContinueSSLRequest() override {}
};
// Base class for all test fixtures.
@@ -847,7 +844,7 @@
EVENT_ON_SSL_CERTIFICATE_ERROR) {}
// Create a ChannelDeletingFakeWebSocketEventInterface. Defined out-of-line to
// avoid circular dependency.
- virtual scoped_ptr<WebSocketEventInterface> CreateEventInterface() override;
+ scoped_ptr<WebSocketEventInterface> CreateEventInterface() override;
// Tests can set deleting_ to a bitmap of EventInterfaceCall members that they
// want to cause Channel deletion. The default is for all calls to cause
@@ -864,46 +861,45 @@
WebSocketChannelDeletingTest* fixture)
: fixture_(fixture) {}
- virtual ChannelState OnAddChannelResponse(
- bool fail,
- const std::string& selected_protocol,
- const std::string& extensions) override {
+ ChannelState OnAddChannelResponse(bool fail,
+ const std::string& selected_protocol,
+ const std::string& extensions) override {
return fixture_->DeleteIfDeleting(EVENT_ON_ADD_CHANNEL_RESPONSE);
}
- virtual ChannelState OnDataFrame(bool fin,
- WebSocketMessageType type,
- const std::vector<char>& data) override {
+ ChannelState OnDataFrame(bool fin,
+ WebSocketMessageType type,
+ const std::vector<char>& data) override {
return fixture_->DeleteIfDeleting(EVENT_ON_DATA_FRAME);
}
- virtual ChannelState OnFlowControl(int64 quota) override {
+ ChannelState OnFlowControl(int64 quota) override {
return fixture_->DeleteIfDeleting(EVENT_ON_FLOW_CONTROL);
}
- virtual ChannelState OnClosingHandshake() override {
+ ChannelState OnClosingHandshake() override {
return fixture_->DeleteIfDeleting(EVENT_ON_CLOSING_HANDSHAKE);
}
- virtual ChannelState OnFailChannel(const std::string& message) override {
+ ChannelState OnFailChannel(const std::string& message) override {
return fixture_->DeleteIfDeleting(EVENT_ON_FAIL_CHANNEL);
}
- virtual ChannelState OnDropChannel(bool was_clean,
- uint16 code,
- const std::string& reason) override {
+ ChannelState OnDropChannel(bool was_clean,
+ uint16 code,
+ const std::string& reason) override {
return fixture_->DeleteIfDeleting(EVENT_ON_DROP_CHANNEL);
}
- virtual ChannelState OnStartOpeningHandshake(
+ ChannelState OnStartOpeningHandshake(
scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
return fixture_->DeleteIfDeleting(EVENT_ON_START_OPENING_HANDSHAKE);
}
- virtual ChannelState OnFinishOpeningHandshake(
+ ChannelState OnFinishOpeningHandshake(
scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
return fixture_->DeleteIfDeleting(EVENT_ON_FINISH_OPENING_HANDSHAKE);
}
- virtual ChannelState OnSSLCertificateError(
+ ChannelState OnSSLCertificateError(
scoped_ptr<SSLErrorCallbacks> ssl_error_callbacks,
const GURL& url,
const SSLInfo& ssl_info,
@@ -946,7 +942,7 @@
// object before calling CreateChannelAndConnect() or
// CreateChannelAndConnectSuccessfully(). This will only work once per test
// case, but once should be enough.
- virtual scoped_ptr<WebSocketEventInterface> CreateEventInterface() override {
+ scoped_ptr<WebSocketEventInterface> CreateEventInterface() override {
return scoped_ptr<WebSocketEventInterface>(event_interface_.release());
}
@@ -960,7 +956,7 @@
WebSocketChannelStreamTest()
: mock_stream_(new StrictMock<MockWebSocketStream>) {}
- virtual void CreateChannelAndConnectSuccessfully() override {
+ void CreateChannelAndConnectSuccessfully() override {
set_stream(mock_stream_.Pass());
WebSocketChannelTest::CreateChannelAndConnectSuccessfully();
}
@@ -3314,7 +3310,7 @@
protected:
WebSocketChannelStreamTimeoutTest() {}
- virtual void CreateChannelAndConnectSuccessfully() override {
+ void CreateChannelAndConnectSuccessfully() override {
set_stream(mock_stream_.Pass());
CreateChannelAndConnect();
channel_->SendFlowControl(kPlentyOfQuota);
diff --git a/net/websockets/websocket_deflate_predictor_impl.h b/net/websockets/websocket_deflate_predictor_impl.h
index d6b52c4..680ec56 100644
--- a/net/websockets/websocket_deflate_predictor_impl.h
+++ b/net/websockets/websocket_deflate_predictor_impl.h
@@ -18,12 +18,12 @@
class NET_EXPORT_PRIVATE WebSocketDeflatePredictorImpl
: public WebSocketDeflatePredictor {
public:
- virtual ~WebSocketDeflatePredictorImpl() {}
+ ~WebSocketDeflatePredictorImpl() override {}
- virtual Result Predict(const ScopedVector<WebSocketFrame>& frames,
- size_t frame_index) override;
- virtual void RecordInputDataFrame(const WebSocketFrame* frame) override;
- virtual void RecordWrittenDataFrame(const WebSocketFrame* frame) override;
+ Result Predict(const ScopedVector<WebSocketFrame>& frames,
+ size_t frame_index) override;
+ void RecordInputDataFrame(const WebSocketFrame* frame) override;
+ void RecordWrittenDataFrame(const WebSocketFrame* frame) override;
};
} // namespace net
diff --git a/net/websockets/websocket_deflate_stream.h b/net/websockets/websocket_deflate_stream.h
index 8f939ec..1426bfc 100644
--- a/net/websockets/websocket_deflate_stream.h
+++ b/net/websockets/websocket_deflate_stream.h
@@ -43,16 +43,16 @@
WebSocketDeflater::ContextTakeOverMode mode,
int client_window_bits,
scoped_ptr<WebSocketDeflatePredictor> predictor);
- virtual ~WebSocketDeflateStream();
+ ~WebSocketDeflateStream() override;
// WebSocketStream functions.
- virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override;
- virtual int WriteFrames(ScopedVector<WebSocketFrame>* frames,
- const CompletionCallback& callback) override;
- virtual void Close() override;
- virtual std::string GetSubProtocol() const override;
- virtual std::string GetExtensions() const override;
+ int ReadFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override;
+ int WriteFrames(ScopedVector<WebSocketFrame>* frames,
+ const CompletionCallback& callback) override;
+ void Close() override;
+ std::string GetSubProtocol() const override;
+ std::string GetExtensions() const override;
private:
enum ReadingState {
diff --git a/net/websockets/websocket_deflate_stream_test.cc b/net/websockets/websocket_deflate_stream_test.cc
index 4f1c418..1b0d123 100644
--- a/net/websockets/websocket_deflate_stream_test.cc
+++ b/net/websockets/websocket_deflate_stream_test.cc
@@ -111,7 +111,7 @@
class WebSocketDeflatePredictorMock : public WebSocketDeflatePredictor {
public:
WebSocketDeflatePredictorMock() : result_(DEFLATE) {}
- virtual ~WebSocketDeflatePredictorMock() {
+ ~WebSocketDeflatePredictorMock() override {
// Verify whether all expectaions are consumed.
if (!frames_to_be_input_.empty()) {
ADD_FAILURE() << "There are missing frames to be input.";
@@ -124,11 +124,11 @@
}
// WebSocketDeflatePredictor functions.
- virtual Result Predict(const ScopedVector<WebSocketFrame>& frames,
- size_t frame_index) override {
+ Result Predict(const ScopedVector<WebSocketFrame>& frames,
+ size_t frame_index) override {
return result_;
}
- virtual void RecordInputDataFrame(const WebSocketFrame* frame) override {
+ void RecordInputDataFrame(const WebSocketFrame* frame) override {
if (!WebSocketFrameHeader::IsKnownDataOpCode(frame->header.opcode)) {
ADD_FAILURE() << "Control frames should not be recorded.";
return;
@@ -147,7 +147,7 @@
}
frames_to_be_input_.pop_front();
}
- virtual void RecordWrittenDataFrame(const WebSocketFrame* frame) override {
+ void RecordWrittenDataFrame(const WebSocketFrame* frame) override {
if (!WebSocketFrameHeader::IsKnownDataOpCode(frame->header.opcode)) {
ADD_FAILURE() << "Control frames should not be recorded.";
return;
diff --git a/net/websockets/websocket_handshake_stream_base.h b/net/websockets/websocket_handshake_stream_base.h
index 8208c0e..6ad0f6b 100644
--- a/net/websockets/websocket_handshake_stream_base.h
+++ b/net/websockets/websocket_handshake_stream_base.h
@@ -40,7 +40,7 @@
// URLRequest::SetUserData().
static const void* DataKey() { return kWebSocketHandshakeUserDataKey; }
- virtual ~CreateHelper() {}
+ ~CreateHelper() override {}
// Create a WebSocketBasicHandshakeStream. This is called after the
// underlying connection has been established but before any handshake data
@@ -58,7 +58,7 @@
// This has to have an inline implementation so that the net/url_request/
// tests do not fail on iOS.
- virtual ~WebSocketHandshakeStreamBase() {}
+ ~WebSocketHandshakeStreamBase() override {}
// After the handshake has completed, this method creates a WebSocketStream
// (of the appropriate type) from the WebSocketHandshakeStreamBase object.
diff --git a/net/websockets/websocket_handshake_stream_create_helper.h b/net/websockets/websocket_handshake_stream_create_helper.h
index aad2644..83bb1ac 100644
--- a/net/websockets/websocket_handshake_stream_create_helper.h
+++ b/net/websockets/websocket_handshake_stream_create_helper.h
@@ -31,17 +31,17 @@
WebSocketStream::ConnectDelegate* connect_delegate,
const std::vector<std::string>& requested_subprotocols);
- virtual ~WebSocketHandshakeStreamCreateHelper();
+ ~WebSocketHandshakeStreamCreateHelper() override;
// WebSocketHandshakeStreamBase::CreateHelper methods
// Create a WebSocketBasicHandshakeStream.
- virtual WebSocketHandshakeStreamBase* CreateBasicStream(
+ WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
bool using_proxy) override;
// Unimplemented as of November 2013.
- virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
+ WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& session,
bool use_relative_url) override;
diff --git a/net/websockets/websocket_handshake_stream_create_helper_test.cc b/net/websockets/websocket_handshake_stream_create_helper_test.cc
index a776acd..5dff5cf 100644
--- a/net/websockets/websocket_handshake_stream_create_helper_test.cc
+++ b/net/websockets/websocket_handshake_stream_create_helper_test.cc
@@ -59,15 +59,15 @@
class TestConnectDelegate : public WebSocketStream::ConnectDelegate {
public:
- virtual ~TestConnectDelegate() {}
+ ~TestConnectDelegate() override {}
- virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override {}
- virtual void OnFailure(const std::string& failure_message) override {}
- virtual void OnStartOpeningHandshake(
+ void OnSuccess(scoped_ptr<WebSocketStream> stream) override {}
+ void OnFailure(const std::string& failure_message) override {}
+ void OnStartOpeningHandshake(
scoped_ptr<WebSocketHandshakeRequestInfo> request) override {}
- virtual void OnFinishOpeningHandshake(
+ void OnFinishOpeningHandshake(
scoped_ptr<WebSocketHandshakeResponseInfo> response) override {}
- virtual void OnSSLCertificateError(
+ void OnSSLCertificateError(
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
ssl_error_callbacks,
const SSLInfo& ssl_info,
diff --git a/net/websockets/websocket_inflater.cc b/net/websockets/websocket_inflater.cc
index 6f46822..1d6122b 100644
--- a/net/websockets/websocket_inflater.cc
+++ b/net/websockets/websocket_inflater.cc
@@ -27,7 +27,7 @@
}
private:
- virtual ~ShrinkableIOBufferWithSize() {}
+ ~ShrinkableIOBufferWithSize() override {}
};
} // namespace
diff --git a/net/websockets/websocket_job.h b/net/websockets/websocket_job.h
index 924fdd0..bad06cf 100644
--- a/net/websockets/websocket_job.h
+++ b/net/websockets/websocket_job.h
@@ -50,42 +50,39 @@
static void EnsureInit();
State state() const { return state_; }
- virtual void Connect() override;
- virtual bool SendData(const char* data, int len) override;
- virtual void Close() override;
- virtual void RestartWithAuth(const AuthCredentials& credentials) override;
- virtual void DetachDelegate() override;
+ void Connect() override;
+ bool SendData(const char* data, int len) override;
+ void Close() override;
+ void RestartWithAuth(const AuthCredentials& credentials) override;
+ void DetachDelegate() override;
// SocketStream::Delegate methods.
- virtual int OnStartOpenConnection(
- SocketStream* socket, const CompletionCallback& callback) override;
- virtual void OnConnected(SocketStream* socket,
- int max_pending_send_allowed) override;
- virtual void OnSentData(SocketStream* socket, int amount_sent) override;
- virtual void OnReceivedData(SocketStream* socket,
- const char* data,
- int len) override;
- virtual void OnClose(SocketStream* socket) override;
- virtual void OnAuthRequired(
- SocketStream* socket, AuthChallengeInfo* auth_info) override;
- virtual void OnSSLCertificateError(SocketStream* socket,
- const SSLInfo& ssl_info,
- bool fatal) override;
- virtual void OnError(const SocketStream* socket, int error) override;
+ int OnStartOpenConnection(SocketStream* socket,
+ const CompletionCallback& callback) override;
+ void OnConnected(SocketStream* socket, int max_pending_send_allowed) override;
+ void OnSentData(SocketStream* socket, int amount_sent) override;
+ void OnReceivedData(SocketStream* socket, const char* data, int len) override;
+ void OnClose(SocketStream* socket) override;
+ void OnAuthRequired(SocketStream* socket,
+ AuthChallengeInfo* auth_info) override;
+ void OnSSLCertificateError(SocketStream* socket,
+ const SSLInfo& ssl_info,
+ bool fatal) override;
+ void OnError(const SocketStream* socket, int error) override;
// SpdyWebSocketStream::Delegate methods.
- virtual void OnCreatedSpdyStream(int status) override;
- virtual void OnSentSpdyHeaders() override;
- virtual void OnSpdyResponseHeadersUpdated(
+ void OnCreatedSpdyStream(int status) override;
+ void OnSentSpdyHeaders() override;
+ void OnSpdyResponseHeadersUpdated(
const SpdyHeaderBlock& response_headers) override;
- virtual void OnSentSpdyData(size_t bytes_sent) override;
- virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override;
- virtual void OnCloseSpdyStream() override;
+ void OnSentSpdyData(size_t bytes_sent) override;
+ void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override;
+ void OnCloseSpdyStream() override;
private:
friend class WebSocketThrottle;
friend class WebSocketJobTest;
- virtual ~WebSocketJob();
+ ~WebSocketJob() override;
bool SendHandshakeRequest(const char* data, int len);
void AddCookieHeaderAndSend();
diff --git a/net/websockets/websocket_job_test.cc b/net/websockets/websocket_job_test.cc
index 9cf3144..3faf809 100644
--- a/net/websockets/websocket_job_test.cc
+++ b/net/websockets/websocket_job_test.cc
@@ -45,27 +45,23 @@
URLRequestContext* context, CookieStore* cookie_store)
: SocketStream(url, delegate, context, cookie_store) {}
- virtual void Connect() override {}
- virtual bool SendData(const char* data, int len) override {
+ void Connect() override {}
+ bool SendData(const char* data, int len) override {
sent_data_ += std::string(data, len);
return true;
}
- virtual void Close() override {}
- virtual void RestartWithAuth(
- const AuthCredentials& credentials) override {
- }
+ void Close() override {}
+ void RestartWithAuth(const AuthCredentials& credentials) override {}
- virtual void DetachDelegate() override {
- delegate_ = NULL;
- }
+ void DetachDelegate() override { delegate_ = NULL; }
const std::string& sent_data() const {
return sent_data_;
}
protected:
- virtual ~MockSocketStream() {}
+ ~MockSocketStream() override {}
private:
std::string sent_data_;
@@ -78,7 +74,7 @@
void set_allow_all_cookies(bool allow_all_cookies) {
allow_all_cookies_ = allow_all_cookies;
}
- virtual ~MockSocketStreamDelegate() {}
+ ~MockSocketStreamDelegate() override {}
void SetOnStartOpenConnection(const base::Closure& callback) {
on_start_open_connection_ = callback;
@@ -96,42 +92,40 @@
on_close_ = callback;
}
- virtual int OnStartOpenConnection(
- SocketStream* socket,
- const CompletionCallback& callback) override {
+ int OnStartOpenConnection(SocketStream* socket,
+ const CompletionCallback& callback) override {
if (!on_start_open_connection_.is_null())
on_start_open_connection_.Run();
return OK;
}
- virtual void OnConnected(SocketStream* socket,
- int max_pending_send_allowed) override {
+ void OnConnected(SocketStream* socket,
+ int max_pending_send_allowed) override {
if (!on_connected_.is_null())
on_connected_.Run();
}
- virtual void OnSentData(SocketStream* socket,
- int amount_sent) override {
+ void OnSentData(SocketStream* socket, int amount_sent) override {
amount_sent_ += amount_sent;
if (!on_sent_data_.is_null())
on_sent_data_.Run();
}
- virtual void OnReceivedData(SocketStream* socket,
- const char* data, int len) override {
+ void OnReceivedData(SocketStream* socket,
+ const char* data,
+ int len) override {
received_data_ += std::string(data, len);
if (!on_received_data_.is_null())
on_received_data_.Run();
}
- virtual void OnClose(SocketStream* socket) override {
+ void OnClose(SocketStream* socket) override {
if (!on_close_.is_null())
on_close_.Run();
}
- virtual bool CanGetCookies(SocketStream* socket,
- const GURL& url) override {
+ bool CanGetCookies(SocketStream* socket, const GURL& url) override {
return allow_all_cookies_;
}
- virtual bool CanSetCookie(SocketStream* request,
- const GURL& url,
- const std::string& cookie_line,
- CookieOptions* options) override {
+ bool CanSetCookie(SocketStream* request,
+ const GURL& url,
+ const std::string& cookie_line,
+ CookieOptions* options) override {
return allow_all_cookies_;
}
@@ -186,44 +180,41 @@
}
// CookieStore:
- virtual void SetCookieWithOptionsAsync(
- const GURL& url,
- const std::string& cookie_line,
- const CookieOptions& options,
- const SetCookiesCallback& callback) override {
+ void SetCookieWithOptionsAsync(const GURL& url,
+ const std::string& cookie_line,
+ const CookieOptions& options,
+ const SetCookiesCallback& callback) override {
bool result = SetCookieWithOptions(url, cookie_line, options);
if (!callback.is_null())
callback.Run(result);
}
- virtual void GetCookiesWithOptionsAsync(
- const GURL& url,
- const CookieOptions& options,
- const GetCookiesCallback& callback) override {
+ void GetCookiesWithOptionsAsync(const GURL& url,
+ const CookieOptions& options,
+ const GetCookiesCallback& callback) override {
if (!callback.is_null())
callback.Run(GetCookiesWithOptions(url, options));
}
- virtual void GetAllCookiesForURLAsync(
+ void GetAllCookiesForURLAsync(
const GURL& url,
const GetCookieListCallback& callback) override {
ADD_FAILURE();
}
- virtual void DeleteCookieAsync(const GURL& url,
- const std::string& cookie_name,
- const base::Closure& callback) override {
+ void DeleteCookieAsync(const GURL& url,
+ const std::string& cookie_name,
+ const base::Closure& callback) override {
ADD_FAILURE();
}
- virtual void DeleteAllCreatedBetweenAsync(
- const base::Time& delete_begin,
- const base::Time& delete_end,
- const DeleteCallback& callback) override {
+ void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) override {
ADD_FAILURE();
}
- virtual void DeleteAllCreatedBetweenForHostAsync(
+ void DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
@@ -231,27 +222,27 @@
ADD_FAILURE();
}
- virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override {
+ void DeleteSessionCookiesAsync(const DeleteCallback&) override {
ADD_FAILURE();
}
- virtual CookieMonster* GetCookieMonster() override { return NULL; }
+ CookieMonster* GetCookieMonster() override { return NULL; }
const std::vector<Entry>& entries() const { return entries_; }
private:
friend class base::RefCountedThreadSafe<MockCookieStore>;
- virtual ~MockCookieStore() {}
+ ~MockCookieStore() override {}
std::vector<Entry> entries_;
};
class MockSSLConfigService : public SSLConfigService {
public:
- virtual void GetSSLConfig(SSLConfig* config) override {}
+ void GetSSLConfig(SSLConfig* config) override {}
protected:
- virtual ~MockSSLConfigService() {}
+ ~MockSSLConfigService() override {}
};
class MockURLRequestContext : public URLRequestContext {
@@ -266,9 +257,7 @@
include_subdomains);
}
- virtual ~MockURLRequestContext() {
- AssertNoURLRequests();
- }
+ ~MockURLRequestContext() override { AssertNoURLRequests(); }
private:
TransportSecurityState transport_security_state_;
@@ -296,21 +285,18 @@
http_session_, spdy_session_key_, BoundNetLog());
}
- virtual int CreateTransaction(
- RequestPriority priority,
- scoped_ptr<HttpTransaction>* trans) override {
+ int CreateTransaction(RequestPriority priority,
+ scoped_ptr<HttpTransaction>* trans) override {
NOTREACHED();
return ERR_UNEXPECTED;
}
- virtual HttpCache* GetCache() override {
+ HttpCache* GetCache() override {
NOTREACHED();
return NULL;
}
- virtual HttpNetworkSession* GetSession() override {
- return http_session_.get();
- }
+ HttpNetworkSession* GetSession() override { return http_session_.get(); }
private:
OrderedSocketData* data_;
@@ -349,35 +335,35 @@
// OnStartOpenConnection() is not implemented by SocketStreamDispatcherHost
- virtual void OnConnected(SocketStream* socket,
- int max_pending_send_allowed) override {
+ void OnConnected(SocketStream* socket,
+ int max_pending_send_allowed) override {
DeleteJobMaybe();
}
- virtual void OnSentData(SocketStream* socket, int amount_sent) override {
+ void OnSentData(SocketStream* socket, int amount_sent) override {
DeleteJobMaybe();
}
- virtual void OnReceivedData(SocketStream* socket,
- const char* data,
- int len) override {
+ void OnReceivedData(SocketStream* socket,
+ const char* data,
+ int len) override {
DeleteJobMaybe();
}
- virtual void OnClose(SocketStream* socket) override { DeleteJobMaybe(); }
+ void OnClose(SocketStream* socket) override { DeleteJobMaybe(); }
- virtual void OnAuthRequired(SocketStream* socket,
- AuthChallengeInfo* auth_info) override {
+ void OnAuthRequired(SocketStream* socket,
+ AuthChallengeInfo* auth_info) override {
DeleteJobMaybe();
}
- virtual void OnSSLCertificateError(SocketStream* socket,
- const SSLInfo& ssl_info,
- bool fatal) override {
+ void OnSSLCertificateError(SocketStream* socket,
+ const SSLInfo& ssl_info,
+ bool fatal) override {
DeleteJobMaybe();
}
- virtual void OnError(const SocketStream* socket, int error) override {
+ void OnError(const SocketStream* socket, int error) override {
DeleteJobMaybe();
}
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc
index 04beb26..005b6c5 100644
--- a/net/websockets/websocket_stream.cc
+++ b/net/websockets/websocket_stream.cc
@@ -48,15 +48,15 @@
explicit Delegate(StreamRequestImpl* owner)
: owner_(owner), result_(INCOMPLETE) {}
- virtual ~Delegate() {
+ ~Delegate() override {
UMA_HISTOGRAM_ENUMERATION(
"Net.WebSocket.HandshakeResult", result_, NUM_HANDSHAKE_RESULT_TYPES);
}
// Implementation of URLRequest::Delegate methods.
- 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 {
// HTTP status codes returned by HttpStreamParser are filtered by
// WebSocketBasicHandshakeStream, and only 101, 401 and 407 are permitted
// back up the stack to HttpNetworkTransaction. In particular, redirect
@@ -65,20 +65,19 @@
NOTREACHED();
}
- virtual void OnResponseStarted(URLRequest* request) override;
+ void OnResponseStarted(URLRequest* request) override;
- virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) override;
+ void OnAuthRequired(URLRequest* request,
+ AuthChallengeInfo* auth_info) override;
- virtual void OnCertificateRequested(URLRequest* request,
- SSLCertRequestInfo* cert_request_info)
- override;
+ void OnCertificateRequested(URLRequest* request,
+ SSLCertRequestInfo* cert_request_info) override;
- virtual void OnSSLCertificateError(URLRequest* request,
- const SSLInfo& ssl_info,
- bool fatal) override;
+ void OnSSLCertificateError(URLRequest* request,
+ const SSLInfo& ssl_info,
+ bool fatal) override;
- virtual void OnReadCompleted(URLRequest* request, int bytes_read) override;
+ void OnReadCompleted(URLRequest* request, int bytes_read) override;
private:
StreamRequestImpl* owner_;
@@ -118,7 +117,7 @@
// Destroying this object destroys the URLRequest, which cancels the request
// and so terminates the handshake if it is incomplete.
- virtual ~StreamRequestImpl() {}
+ ~StreamRequestImpl() override {}
void Start(scoped_ptr<base::Timer> timer) {
DCHECK(timer);
@@ -206,7 +205,7 @@
explicit SSLErrorCallbacks(URLRequest* url_request)
: url_request_(url_request) {}
- virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) override {
+ void CancelSSLRequest(int error, const SSLInfo* ssl_info) override {
if (ssl_info) {
url_request_->CancelWithSSLError(error, *ssl_info);
} else {
@@ -214,7 +213,7 @@
}
}
- virtual void ContinueSSLRequest() override {
+ void ContinueSSLRequest() override {
url_request_->ContinueDespiteLastError();
}
diff --git a/net/websockets/websocket_stream_test.cc b/net/websockets/websocket_stream_test.cc
index 2fd9891..5ce3331 100644
--- a/net/websockets/websocket_stream_test.cc
+++ b/net/websockets/websocket_stream_test.cc
@@ -99,7 +99,7 @@
: WebSocketHandshakeStreamCreateHelper(connect_delegate,
requested_subprotocols) {}
- virtual void OnStreamCreated(WebSocketBasicHandshakeStream* stream) override {
+ void OnStreamCreated(WebSocketBasicHandshakeStream* stream) override {
stream->SetWebSocketKeyForTesting("dGhlIHNhbXBsZSBub25jZQ==");
}
};
@@ -201,28 +201,28 @@
explicit TestConnectDelegate(WebSocketStreamCreateTest* owner)
: owner_(owner) {}
- virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
+ void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
stream.swap(owner_->stream_);
}
- virtual void OnFailure(const std::string& message) override {
+ void OnFailure(const std::string& message) override {
owner_->has_failed_ = true;
owner_->failure_message_ = message;
}
- virtual void OnStartOpeningHandshake(
+ void OnStartOpeningHandshake(
scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
// Can be called multiple times (in the case of HTTP auth). Last call
// wins.
owner_->request_info_ = request.Pass();
}
- virtual void OnFinishOpeningHandshake(
+ void OnFinishOpeningHandshake(
scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
if (owner_->response_info_)
ADD_FAILURE();
owner_->response_info_ = response.Pass();
}
- virtual void OnSSLCertificateError(
+ void OnSSLCertificateError(
scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
ssl_error_callbacks,
const SSLInfo& ssl_info,
diff --git a/net/websockets/websocket_throttle_test.cc b/net/websockets/websocket_throttle_test.cc
index a743e93..4e27c83 100644
--- a/net/websockets/websocket_throttle_test.cc
+++ b/net/websockets/websocket_throttle_test.cc
@@ -23,14 +23,14 @@
class DummySocketStreamDelegate : public SocketStream::Delegate {
public:
DummySocketStreamDelegate() {}
- virtual ~DummySocketStreamDelegate() {}
- virtual void OnConnected(
- SocketStream* socket, int max_pending_send_allowed) override {}
- virtual void OnSentData(SocketStream* socket,
- int amount_sent) override {}
- virtual void OnReceivedData(SocketStream* socket,
- const char* data, int len) override {}
- virtual void OnClose(SocketStream* socket) override {}
+ ~DummySocketStreamDelegate() override {}
+ void OnConnected(SocketStream* socket,
+ int max_pending_send_allowed) override {}
+ void OnSentData(SocketStream* socket, int amount_sent) override {}
+ void OnReceivedData(SocketStream* socket,
+ const char* data,
+ int len) override {}
+ void OnClose(SocketStream* socket) override {}
};
class WebSocketThrottleTestContext : public TestURLRequestContext {