Bug 1016875 - Part7: Imports should have their own LoadGroup. r=mrbkap

This commit is contained in:
Gabor Krizsanits 2014-07-16 14:31:59 +02:00
Родитель eaf43bdaca
Коммит a322404740
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -360,11 +360,15 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
nsCOMPtr<nsIDocument> master = mImportParent->MasterDocument();
mDocument->SetMasterDocument(master);
// We have to connect the blank document we created with the channel we opened.
// We have to connect the blank document we created with the channel we opened,
// and create its own LoadGroup for it.
nsCOMPtr<nsIStreamListener> listener;
nsCOMPtr<nsILoadGroup> loadGroup;
channel->GetLoadGroup(getter_AddRefs(loadGroup));
rv = mDocument->StartDocumentLoad("import", channel, loadGroup,
nsCOMPtr<nsILoadGroup> newLoadGroup = do_CreateInstance(NS_LOADGROUP_CONTRACTID);
NS_ENSURE_TRUE(newLoadGroup, NS_ERROR_OUT_OF_MEMORY);
newLoadGroup->SetLoadGroup(loadGroup);
rv = mDocument->StartDocumentLoad("import", channel, newLoadGroup,
nullptr, getter_AddRefs(listener),
true);
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR);