Bug 881804 (part 5) - Plumb image loader into predictive network actions. r=seth

This commit is contained in:
Nicholas Hurley 2013-10-25 14:56:58 -07:00
parent d45e44771a
commit 3b785b7ae2

View File

@ -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)) {