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

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

Issue 2863973003: Expose RTT and downlink bandwidth using experimental Javascript API (Closed)
Patch Set: Rebased 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
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/test/data/net_info.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 double max_bandwidth_mbps) { 2131 double max_bandwidth_mbps) {
2132 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; 2132 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE;
2133 WebNetworkStateNotifier::SetOnLine(online); 2133 WebNetworkStateNotifier::SetOnLine(online);
2134 for (auto& observer : observers_) 2134 for (auto& observer : observers_)
2135 observer.NetworkStateChanged(online); 2135 observer.NetworkStateChanged(online);
2136 WebNetworkStateNotifier::SetWebConnection( 2136 WebNetworkStateNotifier::SetWebConnection(
2137 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps); 2137 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps);
2138 } 2138 }
2139 2139
2140 void RenderThreadImpl::OnNetworkQualityChanged( 2140 void RenderThreadImpl::OnNetworkQualityChanged(
2141 double http_rtt_msec, 2141 base::TimeDelta http_rtt,
2142 double transport_rtt_msec, 2142 base::TimeDelta transport_rtt,
2143 double downlink_throughput_kbps) { 2143 double downlink_throughput_kbps) {
2144 UMA_HISTOGRAM_BOOLEAN("NQE.RenderThreadNotified", true); 2144 UMA_HISTOGRAM_BOOLEAN("NQE.RenderThreadNotified", true);
2145 // TODO(tbansal): https://crbug.com/719108. Notify WebNetworkStateNotifier of 2145 WebNetworkStateNotifier::SetNetworkQuality(http_rtt, transport_rtt,
2146 // the change in the network quality. 2146 downlink_throughput_kbps);
2147 } 2147 }
2148 2148
2149 void RenderThreadImpl::SetWebKitSharedTimersSuspended(bool suspend) { 2149 void RenderThreadImpl::SetWebKitSharedTimersSuspended(bool suspend) {
2150 #if defined(OS_ANDROID) 2150 #if defined(OS_ANDROID)
2151 if (suspend) { 2151 if (suspend) {
2152 renderer_scheduler_->SuspendTimerQueue(); 2152 renderer_scheduler_->SuspendTimerQueue();
2153 } else { 2153 } else {
2154 renderer_scheduler_->ResumeTimerQueue(); 2154 renderer_scheduler_->ResumeTimerQueue();
2155 } 2155 }
2156 webkit_shared_timer_suspended_ = suspend; 2156 webkit_shared_timer_suspended_ = suspend;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 } 2458 }
2459 } 2459 }
2460 2460
2461 void RenderThreadImpl::OnRendererInterfaceRequest( 2461 void RenderThreadImpl::OnRendererInterfaceRequest(
2462 mojom::RendererAssociatedRequest request) { 2462 mojom::RendererAssociatedRequest request) {
2463 DCHECK(!renderer_binding_.is_bound()); 2463 DCHECK(!renderer_binding_.is_bound());
2464 renderer_binding_.Bind(std::move(request)); 2464 renderer_binding_.Bind(std::move(request));
2465 } 2465 }
2466 2466
2467 } // namespace content 2467 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/test/data/net_info.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698