Bug 1384162 part 1 - DeCOMtaminate nsContentDLF::CreateBlankDocument. r=bz

MozReview-Commit-ID: 1KNNSIqrmZh

--HG--
extra : rebase_source : 8429bdd18f2c55acde245c4b4381735aff635042
This commit is contained in:
Xidorn Quan 2017-07-26 19:32:45 +10:00
parent e3018d572d
commit 1358c75c5d
5 changed files with 15 additions and 22 deletions

View File

@ -47,6 +47,7 @@
#include "nsIContentViewer.h"
#include "nsIDocumentLoaderFactory.h"
#include "nsCURILoader.h"
#include "nsContentDLF.h"
#include "nsDocShellCID.h"
#include "nsDOMCID.h"
#include "nsNetCID.h"
@ -8186,8 +8187,8 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
principal = aPrincipal;
}
// generate (about:blank) document to load
docFactory->CreateBlankDocument(mLoadGroup, principal,
getter_AddRefs(blankDoc));
nsContentDLF::CreateBlankDocument(mLoadGroup, principal,
getter_AddRefs(blankDoc));
if (blankDoc) {
// Hack: set the base URI manually, since this document never
// got Reset() with a channel.

View File

@ -35,12 +35,4 @@ interface nsIDocumentLoaderFactory : nsISupports {
nsIContentViewer createInstanceForDocument(in nsISupports aContainer,
in nsIDocument aDocument,
in string aCommand);
/**
* Create a blank document using the given loadgroup and given
* principal. aPrincipal is allowed to be null, in which case the
* new document will get the about:blank codebase principal.
*/
nsIDocument createBlankDocument(in nsILoadGroup aLoadGroup,
in nsIPrincipal aPrincipal);
};

View File

@ -263,10 +263,10 @@ nsContentDLF::CreateInstanceForDocument(nsISupports* aContainer,
return NS_OK;
}
NS_IMETHODIMP
nsContentDLF::CreateBlankDocument(nsILoadGroup *aLoadGroup,
/* static */ nsresult
nsContentDLF::CreateBlankDocument(nsILoadGroup* aLoadGroup,
nsIPrincipal* aPrincipal,
nsIDocument **aDocument)
nsIDocument** aDocument)
{
*aDocument = nullptr;

View File

@ -46,6 +46,15 @@ public:
nsIStreamListener** aDocListener,
nsIContentViewer** aContentViewer);
/**
* Create a blank document using the given loadgroup and given
* principal. aPrincipal is allowed to be null, in which case the
* new document will get the about:blank codebase principal.
*/
static nsresult CreateBlankDocument(nsILoadGroup* aLoadGroup,
nsIPrincipal* aPrincipal,
nsIDocument** aDocument);
private:
static nsresult EnsureUAStyleSheet();
static bool IsImageContentType(const char* aContentType);

View File

@ -1392,12 +1392,3 @@ nsDirectoryViewerFactory::CreateInstanceForDocument(nsISupports* aContainer,
NS_NOTYETIMPLEMENTED("didn't expect to get here");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDirectoryViewerFactory::CreateBlankDocument(nsILoadGroup *aLoadGroup,
nsIPrincipal *aPrincipal,
nsIDocument **_retval) {
NS_NOTYETIMPLEMENTED("didn't expect to get here");
return NS_ERROR_NOT_IMPLEMENTED;
}