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

Unified Diff: net/http/http_server_properties.h

Issue 1158823005: HttpServerProperties - Don't persist if SetServerNetworkStats is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_http_props
Patch Set: Always update memory cache Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_server_properties_impl.h » ('j') | net/http/http_server_properties_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties.h
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h
index b9abd0da98368e2a799ace4f37511bed9f30cca8..c5cd78b08d83595b34f0dbfe176bf10600e0c552 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -183,6 +183,14 @@ struct NET_EXPORT SupportsQuic {
struct NET_EXPORT ServerNetworkStats {
ServerNetworkStats() : bandwidth_estimate(QuicBandwidth::Zero()) {}
+ bool operator==(const ServerNetworkStats& other) const {
+ return srtt == other.srtt && bandwidth_estimate == other.bandwidth_estimate;
+ }
+
+ bool operator!=(const ServerNetworkStats& other) const {
+ return !this->operator==(other);
+ }
+
base::TimeDelta srtt;
QuicBandwidth bandwidth_estimate;
};
@@ -307,7 +315,9 @@ class NET_EXPORT HttpServerProperties {
virtual void SetSupportsQuic(bool used_quic,
const IPAddressNumber& last_address) = 0;
- virtual void SetServerNetworkStats(const HostPortPair& host_port_pair,
+ // Sets |stats| for |host_port_pair|. Returns true if |stats| is to be
+ // persisted.
+ virtual bool SetServerNetworkStats(const HostPortPair& host_port_pair,
ServerNetworkStats stats) = 0;
virtual const ServerNetworkStats* GetServerNetworkStats(
« no previous file with comments | « no previous file | net/http/http_server_properties_impl.h » ('j') | net/http/http_server_properties_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698