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

Unified Diff: net/nqe/network_quality_estimator_util.h

Issue 2936823002: NQE: Exclude network observations from private networks (Closed)
Patch Set: bengr comments, rebased Created 3 years, 6 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 | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_estimator_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_util.h
diff --git a/net/nqe/network_quality_estimator_util.h b/net/nqe/network_quality_estimator_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..94289c1ec2a5d9338297903af2dac1087d9041f3
--- /dev/null
+++ b/net/nqe/network_quality_estimator_util.h
@@ -0,0 +1,40 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_UTIL_H_
+#define NET_NQE_NETWORK_QUALITY_ESTIMATOR_UTIL_H_
+
+#include "net/base/net_export.h"
+
+namespace net {
+
+class HostPortPair;
+class HostResolver;
+class NetLogWithSource;
+
+namespace nqe {
+
+namespace internal {
+
+// Returns true if the host contained in |host_port_pair| is a host in a
+// private Internet as defined by RFC 1918 or if the requests to
+// |host_port_pair| are not expected to generate useful network quality
+// information. This includes localhost, hosts on private subnets, and
+// hosts on subnets that are reserved for specific usage, and are unlikely
+// to be used by public web servers.
+// To make this determination, IsPrivateHost() makes the best
+// effort estimate including trying to resolve the host in the
+// |host_port_pair|. The method is synchronous.
+// |host_resolver| must not be null.
+NET_EXPORT_PRIVATE bool IsPrivateHost(HostResolver* host_resolver,
+ const HostPortPair& host_port_pair,
+ const NetLogWithSource& net_log);
+
+} // namespace internal
+
+} // namespace nqe
+
+} // namespace net
+
+#endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_UTIL_H_
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | net/nqe/network_quality_estimator_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698