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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2857093002: Expose changes in the network quality to the renderers (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 net::NetworkChangeNotifier::ConnectionType type, 2122 net::NetworkChangeNotifier::ConnectionType type,
2123 double max_bandwidth_mbps) { 2123 double max_bandwidth_mbps) {
2124 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; 2124 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE;
2125 WebNetworkStateNotifier::SetOnLine(online); 2125 WebNetworkStateNotifier::SetOnLine(online);
2126 for (auto& observer : observers_) 2126 for (auto& observer : observers_)
2127 observer.NetworkStateChanged(online); 2127 observer.NetworkStateChanged(online);
2128 WebNetworkStateNotifier::SetWebConnection( 2128 WebNetworkStateNotifier::SetWebConnection(
2129 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps); 2129 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps);
2130 } 2130 }
2131 2131
2132 void RenderThreadImpl::OnNetworkQualityChanged(
2133 double http_rtt_msec,
2134 double transport_rtt_msec,
2135 double downlink_throughput_kbps) {
2136 UMA_HISTOGRAM_EXACT_LINEAR("NQE.RenderThreadNotified", 1, 2);
2137 // TODO(tbansal): https://crbug.com/719108. Notify WebNetworkStateNotifier of
2138 // the change in the network quality.
nasko 2017/05/08 18:27:45 Is there a reason why this code is not included in
tbansal1 2017/05/08 19:50:19 I can include that but I thought it would make the
2139 }
2140
2132 void RenderThreadImpl::SetWebKitSharedTimersSuspended(bool suspend) { 2141 void RenderThreadImpl::SetWebKitSharedTimersSuspended(bool suspend) {
2133 #if defined(OS_ANDROID) 2142 #if defined(OS_ANDROID)
2134 if (suspend) { 2143 if (suspend) {
2135 renderer_scheduler_->SuspendTimerQueue(); 2144 renderer_scheduler_->SuspendTimerQueue();
2136 } else { 2145 } else {
2137 renderer_scheduler_->ResumeTimerQueue(); 2146 renderer_scheduler_->ResumeTimerQueue();
2138 } 2147 }
2139 webkit_shared_timer_suspended_ = suspend; 2148 webkit_shared_timer_suspended_ = suspend;
2140 #else 2149 #else
2141 NOTREACHED(); 2150 NOTREACHED();
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2441 } 2450 }
2442 } 2451 }
2443 2452
2444 void RenderThreadImpl::OnRendererInterfaceRequest( 2453 void RenderThreadImpl::OnRendererInterfaceRequest(
2445 mojom::RendererAssociatedRequest request) { 2454 mojom::RendererAssociatedRequest request) {
2446 DCHECK(!renderer_binding_.is_bound()); 2455 DCHECK(!renderer_binding_.is_bound());
2447 renderer_binding_.Bind(std::move(request)); 2456 renderer_binding_.Bind(std::move(request));
2448 } 2457 }
2449 2458
2450 } // namespace content 2459 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698