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

Unified Diff: third_party/WebKit/Source/core/page/NetworkStateNotifier.cpp

Issue 1276143002: Defer media loading while on cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup. Created 5 years, 3 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/core/page/NetworkStateNotifier.cpp
diff --git a/third_party/WebKit/Source/core/page/NetworkStateNotifier.cpp b/third_party/WebKit/Source/core/page/NetworkStateNotifier.cpp
index 74a6124771ef1daadb8a28fde97b00f77cebe9f6..69508f46f6e60641c8f828d7d872376003c573e3 100644
--- a/third_party/WebKit/Source/core/page/NetworkStateNotifier.cpp
+++ b/third_party/WebKit/Source/core/page/NetworkStateNotifier.cpp
@@ -104,6 +104,14 @@ void NetworkStateNotifier::removeObserver(NetworkStateObserver* observer, Execut
void NetworkStateNotifier::setTestUpdatesOnly(bool updatesOnly)
{
ASSERT(isMainThread());
+
+ // Reset state to default when entering or leaving test mode.
+ if (updatesOnly || m_testUpdatesOnly) {
+ m_isOnLine = true;
+ m_type = WebConnectionTypeOther;
+ m_maxBandwidthMbps = std::numeric_limits<double>::infinity();
+ }
+
m_testUpdatesOnly = updatesOnly;
}

Powered by Google App Engine
This is Rietveld 408576698