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

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

Issue 2863973003: Expose RTT and downlink bandwidth using experimental Javascript API (Closed)
Patch Set: kinuko comments 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 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 double max_bandwidth_mbps) { 2115 double max_bandwidth_mbps) {
2116 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; 2116 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE;
2117 WebNetworkStateNotifier::SetOnLine(online); 2117 WebNetworkStateNotifier::SetOnLine(online);
2118 for (auto& observer : observers_) 2118 for (auto& observer : observers_)
2119 observer.NetworkStateChanged(online); 2119 observer.NetworkStateChanged(online);
2120 WebNetworkStateNotifier::SetWebConnection( 2120 WebNetworkStateNotifier::SetWebConnection(
2121 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps); 2121 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps);
2122 } 2122 }
2123 2123
2124 void RenderThreadImpl::OnNetworkQualityChanged( 2124 void RenderThreadImpl::OnNetworkQualityChanged(
2125 double http_rtt_msec, 2125 base::TimeDelta http_rtt,
2126 double transport_rtt_msec, 2126 base::TimeDelta transport_rtt,
2127 double downlink_throughput_kbps) { 2127 double downlink_throughput_kbps) {
2128 UMA_HISTOGRAM_BOOLEAN("NQE.RenderThreadNotified", true); 2128 UMA_HISTOGRAM_BOOLEAN("NQE.RenderThreadNotified", true);
2129 // TODO(tbansal): https://crbug.com/719108. Notify WebNetworkStateNotifier of 2129 WebNetworkStateNotifier::SetNetworkQuality(http_rtt, transport_rtt,
2130 // the change in the network quality. 2130 downlink_throughput_kbps);
2131 } 2131 }
2132 2132
2133 void RenderThreadImpl::SetWebKitSharedTimersSuspended(bool suspend) { 2133 void RenderThreadImpl::SetWebKitSharedTimersSuspended(bool suspend) {
2134 #if defined(OS_ANDROID) 2134 #if defined(OS_ANDROID)
2135 if (suspend) { 2135 if (suspend) {
2136 renderer_scheduler_->SuspendTimerQueue(); 2136 renderer_scheduler_->SuspendTimerQueue();
2137 } else { 2137 } else {
2138 renderer_scheduler_->ResumeTimerQueue(); 2138 renderer_scheduler_->ResumeTimerQueue();
2139 } 2139 }
2140 webkit_shared_timer_suspended_ = suspend; 2140 webkit_shared_timer_suspended_ = suspend;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 } 2442 }
2443 } 2443 }
2444 2444
2445 void RenderThreadImpl::OnRendererInterfaceRequest( 2445 void RenderThreadImpl::OnRendererInterfaceRequest(
2446 mojom::RendererAssociatedRequest request) { 2446 mojom::RendererAssociatedRequest request) {
2447 DCHECK(!renderer_binding_.is_bound()); 2447 DCHECK(!renderer_binding_.is_bound());
2448 renderer_binding_.Bind(std::move(request)); 2448 renderer_binding_.Bind(std::move(request));
2449 } 2449 }
2450 2450
2451 } // namespace content 2451 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698