Bug 1021221 - resourceTiming initiatorType is empty/other when images are loaded from cache r=seth

Setting the initiatorType to img in ProxyListener::OnStartRequest for resources that don't already have it set.
This commit is contained in:
Valentin Gosu 2014-10-29 17:35:05 +02:00
Родитель 1b7e164233
Коммит 47907c06e3
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -2431,6 +2431,16 @@ NS_IMETHODIMP ProxyListener::OnStartRequest(nsIRequest *aRequest, nsISupports *c
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
if (channel) {
// We need to set the initiator type for the image load
nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(channel);
if (timedChannel) {
nsAutoString type;
timedChannel->GetInitiatorType(type);
if (type.IsEmpty()) {
timedChannel->SetInitiatorType(NS_LITERAL_STRING("img"));
}
}
nsAutoCString contentType;
nsresult rv = channel->GetContentType(contentType);