From 3b785b7ae2d28dca2447c3c6f3c4d449a294e52f Mon Sep 17 00:00:00 2001 From: Nicholas Hurley Date: Fri, 25 Oct 2013 14:56:58 -0700 Subject: [PATCH] Bug 881804 (part 5) - Plumb image loader into predictive network actions. r=seth --- image/src/imgLoader.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index 59c2f6349320..6dade7df6a47 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -29,6 +29,7 @@ #include "nsIFileURL.h" #include "nsCRT.h" #include "nsIDocument.h" +#include "nsINetworkSeer.h" #include "nsIApplicationCache.h" #include "nsIApplicationCacheContainer.h" @@ -1238,6 +1239,9 @@ bool imgLoader::ValidateRequestWithNewChannel(imgRequest *request, // Add the proxy without notifying hvc->AddProxy(proxy); + mozilla::net::SeerLearn(aURI, aInitialDocumentURI, + nsINetworkSeer::LEARN_LOAD_SUBRESOURCE, aLoadGroup); + rv = newChannel->AsyncOpen(listener, nullptr); if (NS_SUCCEEDED(rv)) NS_ADDREF(*aProxyRequest = req.get()); @@ -1735,6 +1739,9 @@ nsresult imgLoader::LoadImage(nsIURI *aURI, PR_LOG(GetImgLog(), PR_LOG_DEBUG, ("[this=%p] imgLoader::LoadImage -- Calling channel->AsyncOpen()\n", this)); + mozilla::net::SeerLearn(aURI, aInitialDocumentURI, + nsINetworkSeer::LEARN_LOAD_SUBRESOURCE, aLoadGroup); + nsresult openRes = newChannel->AsyncOpen(listener, nullptr); if (NS_FAILED(openRes)) {