Bug 881804 (part 4) - Plumb layout into predictive network actions. r=bz

This commit is contained in:
Nicholas Hurley 2013-10-25 14:56:56 -07:00
Родитель a1a01b6606
Коммит d45e44771a
2 изменённых файлов: 17 добавлений и 0 удалений

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

@ -47,6 +47,7 @@
#include "nsGkAtoms.h"
#include "nsIThreadInternal.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsINetworkSeer.h"
#ifdef MOZ_XUL
#include "nsXULPrototypeCache.h"
@ -1433,6 +1434,12 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState)
return rv;
}
if (mDocument) {
mozilla::net::SeerLearn(aLoadData->mURI, mDocument->GetDocumentURI(),
nsINetworkSeer::LEARN_LOAD_SUBRESOURCE,
mDocument);
}
// Just load it
nsCOMPtr<nsIInputStream> stream;
nsCOMPtr<nsIChannel> channel;
@ -1606,6 +1613,11 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState)
channelListener = streamLoader;
}
if (mDocument) {
mozilla::net::SeerLearn(aLoadData->mURI, mDocument->GetDocumentURI(),
nsINetworkSeer::LEARN_LOAD_SUBRESOURCE, mDocument);
}
rv = channel->AsyncOpen(channelListener, nullptr);
#ifdef DEBUG

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

@ -29,6 +29,7 @@
#include "nsIContentSecurityPolicy.h"
#include "nsIDocShell.h"
#include "nsIWebNavigation.h"
#include "nsINetworkSeer.h"
#include "nsIConsoleService.h"
@ -375,6 +376,10 @@ nsUserFontSet::StartLoad(gfxMixedFontFamily* aFamily,
rv = NS_NewStreamLoader(getter_AddRefs(streamLoader), fontLoader);
NS_ENSURE_SUCCESS(rv, rv);
nsIDocument *document = ps->GetDocument();
mozilla::net::SeerLearn(aFontFaceSrc->mURI, document->GetDocumentURI(),
nsINetworkSeer::LEARN_LOAD_SUBRESOURCE, loadGroup);
bool inherits = false;
rv = NS_URIChainHasFlags(aFontFaceSrc->mURI,
nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT,