Bug 1193552 - Remove baseURI from LoadInfo (r=sicking,jkitch)

This commit is contained in:
Christoph Kerschbaumer
2015-08-19 10:43:30 -07:00
parent 0c8fdd6a30
commit 8ab48ef209
15 changed files with 162 additions and 110 deletions

View File

@@ -29,7 +29,7 @@
#include "nsIScriptContext.h"
#include "mozilla/Preferences.h"
#include "nsIHTMLDocument.h"
#include "nsILoadInfo.h"
#include "nsIViewSourceChannel.h"
using namespace mozilla;
@@ -803,15 +803,12 @@ nsHtml5TreeOpExecutor::GetViewSourceBaseURI()
// We query the channel for the baseURI because in certain situations it
// cannot otherwise be determined. If this process fails, fall back to the
// standard method.
nsCOMPtr<nsIChannel> channel = mDocument->GetChannel();
if (channel) {
nsCOMPtr<nsILoadInfo> loadInfo;
nsresult rv = channel->GetLoadInfo(getter_AddRefs(loadInfo));
if (NS_SUCCEEDED(rv) && loadInfo) {
rv = loadInfo->GetBaseURI(getter_AddRefs(mViewSourceBaseURI));
if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) {
return mViewSourceBaseURI;
}
nsCOMPtr<nsIViewSourceChannel> vsc =
do_QueryInterface(mDocument->GetChannel());
if (vsc) {
nsresult rv = vsc->GetBaseURI(getter_AddRefs(mViewSourceBaseURI));
if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) {
return mViewSourceBaseURI;
}
}