New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 800610 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 6
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-08-10
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Remove the need to pass origins through MediaMetricsProvider

Project Member Reported by dcheng@chromium.org, Jan 10 2018

Issue description

Right now, MediaMetricsProvider has an Initialize() method to pass the top frame origin through. This shouldn't be needed, because MediaMetricsProvider::Create is registered with the RenderFrameHost's interface factory: we should be able to take advantage of the fact by passing in the origin at construction time.
 
Does this correspond to frame_tree_node_->IsMainFrame()and GetLastCommittedOrigin? Are those available at the time of RegisterMojoInterfaces?
+1 to Dale's questions. 

This bug is perhaps a dup of Issue 787209?

Reminder that this whole approach of setting the URL (regardless of process) is intended to be short lived. Our past discussion here:
https://chromium-review.googlesource.com/c/chromium/src/+/760056/2/media/mojo/interfaces/video_decode_stats_recorder.mojom#18
ping dcheng@ for c#1/c#2.
@dcheng, 3rd ping for more information :)
Cc: hbengali@chromium.org holte@chromium.org
Per chat discussion with dcheng@, I'll add pass in a callback which returns ukm::SourceIds to MediaMetricsProvider which can be given to the created WatchTimeRecorders.

The callback (living in content/) will look up the WebContents using the RenderFrameHost and then use ukm::GetSourceIdForWebContentsDocument() to return a SourceId that can be used for recording.

This might also resolve the issues we're having with seemingly okay media top frame URLs getting blacklisted from recording (an issue holte@ is looking into).
(callback may not be necessary if top_frame and sourceId can be passed in at construction time) -- will experiment.
Per chat, looks like is_top_frame can be bound in as RFH::IsMainFrame(), but we probably still need a callback to query the SourceId at some later time since it won't be available until commit.
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc970771e565195a537664c30b2c7bd79b23cd3c

commit bc970771e565195a537664c30b2c7bd79b23cd3c
Author: Dale Curtis <dalecurtis@chromium.org>
Date: Mon Aug 06 17:31:04 2018

Use source of truth for ukm::SourceId and is_top_frame for media UKM.

This removes passing of the origin and is_top_frame values from the
(untrusted) renderer. Instead we retrieve them from the render frame
host at the time the MediaMetricsProvider is created.

BUG= 800610 
TEST=updated test still pass.

Change-Id: I70abbd5a98b574d0bbbc0d64d9fd194c4fb82e90
Reviewed-on: https://chromium-review.googlesource.com/1161186
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580906}
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/content/browser/frame_host/render_frame_host_delegate.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/content/browser/frame_host/render_frame_host_delegate.h
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/content/browser/renderer_host/render_widget_host_delegate.h
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/blink/watch_time_reporter_unittest.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/interfaces/media_metrics_provider.mojom
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/media_metrics_provider.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/media_metrics_provider.h
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/media_metrics_provider_unittest.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/video_decode_perf_history.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/video_decode_perf_history.h
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/video_decode_perf_history_unittest.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/video_decode_stats_recorder.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/video_decode_stats_recorder.h
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/watch_time_recorder.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/watch_time_recorder.h
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/media/mojo/services/watch_time_recorder_unittest.cc
[modify] https://crrev.com/bc970771e565195a537664c30b2c7bd79b23cd3c/services/metrics/public/cpp/ukm_recorder.h

NextAction: 2018-08-10
Status: Fixed (was: Assigned)
Should be fixed, and if  issue 800610  doesn't resolve UKM count oddities, hopefully this will. Setting next action to monitor reject counts:

https://uma.googleplex.com/p/chrome/timeline_v2/?sid=5e5ea9a15279aeaf02eaeec44fb03ac7
Err  issue 870407  that is.
The NextAction date has arrived: 2018-08-10
Definitely a fall off in rejected sources from 17mil to 12mil.

Sign in to add a comment