Bug 112979 - [Chromium] Allow AssosicatedURLLoader to set the initiator field
Summary: [Chromium] Allow AssosicatedURLLoader to set the initiator field
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: James Simonsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-21 16:37 PDT by James Simonsen
Modified: 2013-04-08 17:00 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.74 KB, patch)
2013-03-21 16:37 PDT, James Simonsen
no flags Details | Formatted Diff | Diff
Patch (2.95 KB, patch)
2013-03-21 16:39 PDT, James Simonsen
no flags Details | Formatted Diff | Diff
Patch (3.03 KB, patch)
2013-03-25 16:54 PDT, James Simonsen
benjamin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Simonsen 2013-03-21 16:37:04 PDT
[Chromium] Allow AssosicatedURLLoader to set the initiator field
Comment 1 James Simonsen 2013-03-21 16:37:18 PDT
Created attachment 194380 [details]
Patch
Comment 2 James Simonsen 2013-03-21 16:39:36 PDT
Created attachment 194382 [details]
Patch
Comment 3 WebKit Review Bot 2013-03-21 16:48:39 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 4 Darin Fisher (:fishd, Google) 2013-03-21 22:59:48 PDT
Comment on attachment 194382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=194382&action=review

> Source/WebKit/chromium/public/WebURLLoaderOptions.h:61
> +    WebString initiator; // Name of the element that initiated this request. Intended to match the 'initiator' definition in the Resource Timing API.

nit: might it be helpful to give this a more descriptive name?  e.g., nameOfInitiatingElement?  I assume this is meant to convey the tag-name of the element, so "video" or "audio", right?  You should probably say that this value can be optionally left empty / null.  should we be concerned that folks might mistakenly set values here that are not valid tag-names?  for NaCl, should we say "embed"?
Comment 5 James Simonsen 2013-03-25 16:54:45 PDT
Created attachment 194949 [details]
Patch
Comment 6 James Simonsen 2013-03-25 17:09:15 PDT
(In reply to comment #4)
> (From update of attachment 194382 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=194382&action=review
> 
> > Source/WebKit/chromium/public/WebURLLoaderOptions.h:61
> > +    WebString initiator; // Name of the element that initiated this request. Intended to match the 'initiator' definition in the Resource Timing API.
> 
> nit: might it be helpful to give this a more descriptive name?  e.g., nameOfInitiatingElement?

Done.

> I assume this is meant to convey the tag-name of the element, so "video" or "audio", right?

Yep.

> You should probably say that this value can be optionally left empty / null.

Done.

> should we be concerned that folks might mistakenly set values here that are not valid tag-names?

Not super worried. For now, the spec mostly lists elements as initiators with the one exception being xmlhttprequest. I could imagine there being more non-element initiators spec'd in the future. I wouldn't want to prevent it.

If someone uses a non-standard value, then we're not compliant with the spec. I don't know a great way to police this, other than trying to have extensive test coverage.

> for NaCl, should we say "embed"?

If the resource were specified in the <embed> tag, yes.

If that NaCl code decided to load something, then the initiator should be the default ("resource"). Basically, anything that's not specifically spec'd should use the default value.