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

Unified Diff: third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp

Issue 2903493002: NetInfo network quality extension: Add callbacks and Layout tests (Closed)
Patch Set: ps Created 3 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
Index: third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
diff --git a/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp b/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
index 46d6824a532edc1fb752bf0acf1708e31ab9f588..6aedb982960bb7d365d2ede825577ae35c9d5d4c 100644
--- a/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
+++ b/third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp
@@ -146,9 +146,10 @@ void NetworkStateNotifier::RemoveOnLineObserver(
RemoveObserver(on_line_state_observers_, observer, std::move(task_runner));
}
-void NetworkStateNotifier::SetOverride(bool on_line,
- WebConnectionType type,
- double max_bandwidth_mbps) {
+void NetworkStateNotifier::SetNetworkConnectionInfoOverride(
+ bool on_line,
+ WebConnectionType type,
+ double max_bandwidth_mbps) {
DCHECK(IsMainThread());
ScopedNotifier notifier(*this);
{
@@ -162,6 +163,26 @@ void NetworkStateNotifier::SetOverride(bool on_line,
}
}
+void NetworkStateNotifier::SetNetworkQualityInfoOverride(
dcheng 2017/05/27 08:47:47 I think the layering here may not be quite right:
tbansal1 2017/05/28 04:32:16 I think the problem here is that on actual test de
dcheng 2017/05/29 08:06:14 The browser-side network change/quality notifier s
kinuko 2017/05/30 02:38:22 By the way existing SetOverride is also used for d
tbansal1 2017/05/30 21:57:20 filed https://crbug.com/727911 for changing the va
+ WebEffectiveConnectionType effective_type,
+ unsigned long transport_rtt_msec,
+ double downlink_throughput_mbps) {
+ DCHECK(IsMainThread());
+ ScopedNotifier notifier(*this);
+ {
+ MutexLocker locker(mutex_);
+ has_override_ = true;
+ override_.on_line_initialized = true;
+ override_.connection_initialized = true;
+ override_.effective_type = effective_type;
+ override_.transport_rtt =
+ base::TimeDelta::FromMilliseconds(transport_rtt_msec);
+ override_.downlink_throughput_mbps = base::nullopt;
+ if (downlink_throughput_mbps >= 0)
+ override_.downlink_throughput_mbps = downlink_throughput_mbps;
+ }
+}
+
void NetworkStateNotifier::ClearOverride() {
DCHECK(IsMainThread());
ScopedNotifier notifier(*this);

Powered by Google App Engine
This is Rietveld 408576698