[Chromium] Allow AssosicatedURLLoader to set the initiator field
Created attachment 194380 [details] Patch
Created attachment 194382 [details] Patch
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 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"?
Created attachment 194949 [details] Patch
(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.