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

Issue 848916 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: 10
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Not tagging images loaded by ad scripts

Project Member Reported by jkarlin@chromium.org, Jun 1 2018

Issue description

Images are loaded in a microtask after the script runs. Therefore, the ad script isn't in the stack when probe::WillSendRequest is received in the AdTracker. We'll need to check the stack earlier on.

The stack when we do receive the image looks like this:

#0 0x7faacc218c2c base::debug::StackTrace::StackTrace()
#1 0x7faac6f1f194 blink::AdTracker::WillSendRequest()
#2 0x7faac76b87ae blink::probe::willSendRequestImpl()
#3 0x7faac7518704 blink::FrameFetchContext::DispatchWillSendRequest()
#4 0x7faac5883596 blink::ResourceFetcher::StartLoad()
#5 0x7faac588203a blink::ResourceFetcher::RequestResource()
#6 0x7faac7547fd1 blink::ImageResource::Fetch()
#7 0x7faac754bea9 blink::ImageResourceContent::Fetch()
#8 0x7faac752900c blink::ImageLoader::DoUpdateFromElement()
#9 0x7faac752b23a blink::ImageLoader::Task::Run()

How to reproduce: Make a test like AdTrackerSimTest.ResourceLoadedWhileExecutingAdScript but load an image instead of a script from the ad script.



 
We also need to test/verify that other resource types are detected properly.
Note that AdTrackerSimTest.ResourceLoadedWhileExecutingAdScript (mentioned in the original comment) is in CL: https://crrev.com/c/1071729
EstimatedDays: 10
Owner: ericrobinson@chromium.org
Status: Assigned (was: Available)
There's been mention that this issue may be resolved with the completion of the Async Stack Adtracker (see https://bugs.chromium.org/p/chromium/issues/detail?id=851531).

Right now, I've adapted the mentioned test and it fails as expected when an image instead of a script is loaded.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 2

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

commit fd0a8309e4a39ddcd2598a617d99488cbb0e7998
Author: Eric Robinson <ericrobinson@chromium.org>
Date: Thu Aug 02 15:26:26 2018

AdTracker tests of resource marking for images, frames.

This CL adds tests to the AdTracker to verify that resources loaded
by an ad script are marked properly ad ads during loaded.  This
does not work properly for images currently due to crbug.com/848916.

Bug: 848916, 863446
Change-Id: I6643ec24c16ec7dceb9c60fd150046b86cb008ac
Reviewed-on: https://chromium-review.googlesource.com/1140196
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Eric Robinson <ericrobinson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580192}
[modify] https://crrev.com/fd0a8309e4a39ddcd2598a617d99488cbb0e7998/third_party/blink/renderer/core/frame/ad_tracker_test.cc

Sign in to add a comment