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

Unified Diff: net/nqe/network_quality_estimator_params.h

Issue 2421063002: NQE: Separate out params to a different file (Closed)
Patch Set: ps Created 4 years, 2 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
Index: net/nqe/network_quality_estimator_params.h
diff --git a/net/nqe/network_quality_estimator_params.h b/net/nqe/network_quality_estimator_params.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f84e47931d6cec43623a5154f881d09949757b3
--- /dev/null
+++ b/net/nqe/network_quality_estimator_params.h
@@ -0,0 +1,68 @@
+// Copyright 2016 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_PARAMS_H_
+#define NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_
+
+#include <map>
+#include <string>
+
+#include "net/base/network_change_notifier.h"
+#include "net/nqe/effective_connection_type.h"
+#include "net/nqe/network_quality.h"
+
+namespace net {
+
+namespace nqe {
+
+namespace internal {
+
+// Returns the algorithm that should be used for computing effective connection
+// type based on field trial params. Returns an empty string if a valid
+// algorithm paramter is not present in the field trial params.
+std::string GetEffectiveConnectionTypeAlgorithm(
+ const std::map<std::string, std::string>& variation_params);
+
+// Computes and returns the weight multiplier per second.
+// |variation_params| is the map containing all field trial parameters
+// related to NetworkQualityEstimator field trial.
+double GetWeightMultiplierPerSecond(
+ const std::map<std::string, std::string>& variation_params);
+
+// Returns a descriptive name corresponding to |connection_type|.
+const char* GetNameForConnectionType(
+ net::NetworkChangeNotifier::ConnectionType connection_type);
+
+// Sets the default observation for different connection types in
+// |default_observations|.
+void ObtainDefaultObservations(
+ const std::map<std::string, std::string>& variation_params,
+ nqe::internal::NetworkQuality default_observations[]);
+
+// Parses the variation paramaters and sets the thresholds for different
+// effective connection types in |connection_thresholds|.
+void ObtainEffectiveConnectionTypeModelParams(
+ const std::map<std::string, std::string>& variation_params,
+ nqe::internal::NetworkQuality connection_thresholds[]);
+
+// Returns the probability at which the correlation UMA should be recorded.
+double correlation_uma_logging_probability(
+ const std::map<std::string, std::string>& variation_params);
+
+// Returns true if effective connection type value has been forced via variation
+// parameters.
+bool forced_effective_connection_type_set(
+ const std::map<std::string, std::string>& variation_params);
+
+// Returns the effective connection type set via variation parameters.
+EffectiveConnectionType forced_effective_connection_type(
+ const std::map<std::string, std::string>& variation_params);
+
+} // namespace internal
+
+} // namespace nqe
+
+} // namespace net
+
+#endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_

Powered by Google App Engine
This is Rietveld 408576698