Commit 213268ef authored by Kinuko Yasuda's avatar Kinuko Yasuda Committed by Commit Bot

Report traffic usage from ResourceLoadScheduler only on the main thread.

* The current histogram code assumes single-threaded usage (hits
  thread kassertion if resource loading from workers frun).
* Currently we classify all non-main-resource requests as subframes, but
  it's not really true if we include non-main-thread traffic.

(This could be a temporary work-around fix)

Bug: 789354
Change-Id: I321cc6a3cbc39cb10c2b4ad8c110760f839a282f
Reviewed-on: https://chromium-review.googlesource.com/805674
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarTsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521314}
parent 2bea97c4
...@@ -136,6 +136,9 @@ void ResourceLoadScheduler::TrafficMonitor::OnThrottlingStateChanged( ...@@ -136,6 +136,9 @@ void ResourceLoadScheduler::TrafficMonitor::OnThrottlingStateChanged(
void ResourceLoadScheduler::TrafficMonitor::Report( void ResourceLoadScheduler::TrafficMonitor::Report(
const ResourceLoadScheduler::TrafficReportHints& hints) { const ResourceLoadScheduler::TrafficReportHints& hints) {
// Currently we only care about stats from frames.
if (!IsMainThread())
return;
if (!hints.IsValid()) if (!hints.IsValid())
return; return;
...@@ -220,6 +223,9 @@ void ResourceLoadScheduler::TrafficMonitor::Report( ...@@ -220,6 +223,9 @@ void ResourceLoadScheduler::TrafficMonitor::Report(
} }
void ResourceLoadScheduler::TrafficMonitor::ReportAll() { void ResourceLoadScheduler::TrafficMonitor::ReportAll() {
// Currently we only care about stats from frames.
if (!IsMainThread())
return;
if (report_all_is_called_) if (report_all_is_called_)
return; return;
report_all_is_called_ = true; report_all_is_called_ = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment