Skip to content

Commit

Permalink
Backed out changeset 3e42f84996ea (bug 1359092) for causing assertion…
Browse files Browse the repository at this point in the history
… failures
  • Loading branch information
BavarianTomcat committed Apr 25, 2017
1 parent 2877b0d commit e709291
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 55 deletions.
5 changes: 1 addition & 4 deletions docshell/base/nsDSURIContentListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "nsIScriptError.h"
#include "nsDocShellLoadTypes.h"
#include "nsIMultiPartChannel.h"
#include "NullPrincipal.h"

using namespace mozilla;

Expand Down Expand Up @@ -449,10 +448,8 @@ nsDSURIContentListener::CheckFrameOptions(nsIRequest* aRequest)
if (mDocShell) {
nsCOMPtr<nsIWebNavigation> webNav(do_QueryObject(mDocShell));
if (webNav) {
RefPtr<NullPrincipal> nullPrincipal = NullPrincipal::Create();
webNav->LoadURI(u"about:blank",
0, nullptr, nullptr, nullptr,
nullPrincipal);
0, nullptr, nullptr, nullptr);
}
}
return false;
Expand Down
20 changes: 7 additions & 13 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4746,12 +4746,11 @@ nsDocShell::LoadURI(const char16_t* aURI,
uint32_t aLoadFlags,
nsIURI* aReferringURI,
nsIInputStream* aPostStream,
nsIInputStream* aHeaderStream,
nsIPrincipal* aTriggeringPrincipal)
nsIInputStream* aHeaderStream)
{
return LoadURIWithOptions(aURI, aLoadFlags, aReferringURI,
mozilla::net::RP_Unset, aPostStream,
aHeaderStream, nullptr, aTriggeringPrincipal);
aHeaderStream, nullptr, nullptr);
}

NS_IMETHODIMP
Expand Down Expand Up @@ -7927,16 +7926,11 @@ nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
// can increment counts from the search engine
MaybeNotifyKeywordSearchLoading(keywordProviderName, keywordAsSent);

nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
nsCOMPtr<nsIPrincipal> triggeringPrincipal = loadInfo
? loadInfo->TriggeringPrincipal()
: nsContentUtils::GetSystemPrincipal();
return LoadURI(newSpecW.get(), // URI string
LOAD_FLAGS_NONE, // Load flags
nullptr, // Referring URI
newPostData, // Post data stream
nullptr, // Headers stream
triggeringPrincipal); // TriggeringPrincipal
return LoadURI(newSpecW.get(), // URI string
LOAD_FLAGS_NONE, // Load flags
nullptr, // Referring URI
newPostData, // Post data stream
nullptr); // Headers stream
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions docshell/base/nsDocShellTreeOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "nsWebBrowser.h"

// Helper Classes
#include "nsContentUtils.h"
#include "nsStyleCoord.h"
#include "nsSize.h"
#include "mozilla/ReflowInput.h"
Expand Down Expand Up @@ -1005,8 +1004,7 @@ nsDocShellTreeOwner::HandleEvent(nsIDOMEvent* aEvent)
nsAutoString url;
if (NS_SUCCEEDED(links[0]->GetUrl(url))) {
if (!url.IsEmpty()) {
webnav->LoadURI(url.get(), 0, nullptr, nullptr, nullptr,
nsContentUtils::GetSystemPrincipal());
webnav->LoadURI(url.get(), 0, nullptr, nullptr, nullptr);
}
}

Expand Down
16 changes: 5 additions & 11 deletions docshell/base/nsIWebNavigation.idl
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,12 @@ interface nsIWebNavigation : nsISupports
* header stream is formatted as:
* ( HEADER "\r\n" )*
* This parameter is optional and may be null.
* @param aTriggeringPrincipal
* The principal that initiated the load of aURI. If omitted docShell
* tries to create a codeBasePrincipal from aReferrer if not null. If
* aReferrer is also null docShell peforms a load using the
* SystemPrincipal as the triggeringPrincipal.
*/
void loadURI(in wstring aURI,
in unsigned long aLoadFlags,
in nsIURI aReferrer,
in nsIInputStream aPostData,
in nsIInputStream aHeaders,
[optional] in nsIPrincipal aTriggeringPrincipal);
void loadURI(in wstring aURI,
in unsigned long aLoadFlags,
in nsIURI aReferrer,
in nsIInputStream aPostData,
in nsIInputStream aHeaders);

/**
* Loads a given URI. This will give priority to loading the requested URI
Expand Down
3 changes: 1 addition & 2 deletions docshell/shistory/nsSHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,7 @@ nsSHistory::LoadURI(const char16_t* aURI,
uint32_t aLoadFlags,
nsIURI* aReferringURI,
nsIInputStream* aPostStream,
nsIInputStream* aExtraHeaderStream,
nsIPrincipal* aTriggeringPrincipal)
nsIInputStream* aExtraHeaderStream)
{
return NS_OK;
}
Expand Down
9 changes: 4 additions & 5 deletions dom/base/nsGlobalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7832,7 +7832,7 @@ nsGlobalWindow::Forward(ErrorResult& aError)
}

void
nsGlobalWindow::HomeOuter(nsIPrincipal& aSubjectPrincipal, ErrorResult& aError)
nsGlobalWindow::HomeOuter(ErrorResult& aError)
{
MOZ_RELEASE_ASSERT(IsOuterWindow());

Expand Down Expand Up @@ -7880,14 +7880,13 @@ nsGlobalWindow::HomeOuter(nsIPrincipal& aSubjectPrincipal, ErrorResult& aError)
nsIWebNavigation::LOAD_FLAGS_NONE,
nullptr,
nullptr,
nullptr,
&aSubjectPrincipal);
nullptr);
}

void
nsGlobalWindow::Home(nsIPrincipal& aSubjectPrincipal, ErrorResult& aError)
nsGlobalWindow::Home(ErrorResult& aError)
{
FORWARD_TO_OUTER_OR_THROW(HomeOuter, (aSubjectPrincipal, aError), aError, );
FORWARD_TO_OUTER_OR_THROW(HomeOuter, (aError), aError, );
}

void
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsGlobalWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,8 @@ class nsGlobalWindow : public mozilla::dom::EventTarget,
void Back(mozilla::ErrorResult& aError);
void ForwardOuter(mozilla::ErrorResult& aError);
void Forward(mozilla::ErrorResult& aError);
void HomeOuter(nsIPrincipal& aSubjectPrincipal, mozilla::ErrorResult& aError);
void Home(nsIPrincipal& aSubjectPrincipal, mozilla::ErrorResult& aError);
void HomeOuter(mozilla::ErrorResult& aError);
void Home(mozilla::ErrorResult& aError);
bool FindOuter(const nsAString& aString, bool aCaseSensitive, bool aBackwards,
bool aWrapAround, bool aWholeWord, bool aSearchInFrames,
bool aShowDialog, mozilla::ErrorResult& aError);
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/TabChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ TabChild::RecvLoadURL(const nsCString& aURI,
WebNavigation()->LoadURI(NS_ConvertUTF8toUTF16(aURI).get(),
nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL,
nullptr, nullptr, nullptr, nsContentUtils::GetSystemPrincipal());
nullptr, nullptr, nullptr);
if (NS_FAILED(rv)) {
NS_WARNING("WebNavigation()->LoadURI failed. Eating exception, what else can I do?");
}
Expand Down
8 changes: 4 additions & 4 deletions dom/webidl/Window.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ partial interface Window {
[Replaceable, Throws] readonly attribute long scrollMaxX;
[Replaceable, Throws] readonly attribute long scrollMaxY;

[Throws, UnsafeInPrerendering] attribute boolean fullScreen;
[Throws, UnsafeInPrerendering] attribute boolean fullScreen;

[Throws, ChromeOnly, UnsafeInPrerendering] void back();
[Throws, ChromeOnly, UnsafeInPrerendering] void forward();
[Throws, ChromeOnly, UnsafeInPrerendering, NeedsSubjectPrincipal] void home();
[Throws, ChromeOnly, UnsafeInPrerendering] void back();
[Throws, ChromeOnly, UnsafeInPrerendering] void forward();
[Throws, ChromeOnly, UnsafeInPrerendering] void home();

// XXX Should this be in nsIDOMChromeWindow?
void updateCommands(DOMString action,
Expand Down
4 changes: 1 addition & 3 deletions editor/composer/nsEditingSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "nsAString.h"
#include "nsComponentManagerUtils.h" // for do_CreateInstance
#include "nsComposerCommandsUpdater.h" // for nsComposerCommandsUpdater
#include "nsContentUtils.h"
#include "nsDebug.h" // for NS_ENSURE_SUCCESS, etc
#include "nsEditingSession.h"
#include "nsError.h" // for NS_ERROR_FAILURE, NS_OK, etc
Expand Down Expand Up @@ -993,8 +992,7 @@ nsEditingSession::TimerCallback(nsITimer* aTimer, void* aClosure)
if (docShell) {
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
if (webNav) {
webNav->LoadURI(u"about:blank", 0, nullptr, nullptr, nullptr,
nsContentUtils::GetSystemPrincipal());
webNav->LoadURI(u"about:blank", 0, nullptr, nullptr, nullptr);
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions toolkit/components/browser/nsWebBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,12 @@ NS_IMETHODIMP
nsWebBrowser::LoadURI(const char16_t* aURI, uint32_t aLoadFlags,
nsIURI* aReferringURI,
nsIInputStream* aPostDataStream,
nsIInputStream* aExtraHeaderStream,
nsIPrincipal* aTriggeringPrincipal)
nsIInputStream* aExtraHeaderStream)
{
NS_ENSURE_STATE(mDocShell);

return mDocShellAsNav->LoadURI(aURI, aLoadFlags, aReferringURI,
aPostDataStream, aExtraHeaderStream,
aTriggeringPrincipal);
return mDocShellAsNav->LoadURI(
aURI, aLoadFlags, aReferringURI, aPostDataStream, aExtraHeaderStream);
}

NS_IMETHODIMP
Expand Down
3 changes: 1 addition & 2 deletions xpfe/appshell/nsWebShellWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
nsIWebNavigation::LOAD_FLAGS_NONE,
nullptr,
nullptr,
nullptr,
nsContentUtils::GetSystemPrincipal());
nullptr);
NS_ENSURE_SUCCESS(rv, rv);
}

Expand Down

0 comments on commit e709291

Please sign in to comment.