Skip to content

Commit

Permalink
Backed out changeset 7cbab9ec76d5 (bug 1254689) for browser_dbg_addon…
Browse files Browse the repository at this point in the history
…-sources.js failures

MozReview-Commit-ID: 3zPliH7mmPj

--HG--
extra : rebase_source : 90a6c96c2106ec23043160ed93041cd7e15b1640
  • Loading branch information
KWierso committed Mar 9, 2016
1 parent 0926cc2 commit 817d882
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 26 deletions.
4 changes: 1 addition & 3 deletions dom/html/nsHTMLDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,11 +1223,9 @@ nsHTMLDocument::CreateDummyChannelForCookies(nsIURI* aCodebaseURI)
// FOR ANY OTHER PURPOSE.
MOZ_ASSERT(!mChannel);

// The following channel is never openend, so it does not matter what
// securityFlags we pass; let's follow the principle of least privilege.
nsCOMPtr<nsIChannel> channel;
NS_NewChannel(getter_AddRefs(channel), aCodebaseURI, this,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_INVALID);
nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel =
do_QueryInterface(channel);
Expand Down
4 changes: 1 addition & 3 deletions dom/jsurl/nsJSProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,11 @@ nsresult nsJSChannel::Init(nsIURI *aURI)

// If the resultant script evaluation actually does return a value, we
// treat it as html.
// The following channel is never openend, so it does not matter what
// securityFlags we pass; let's follow the principle of least privilege.
rv = NS_NewInputStreamChannel(getter_AddRefs(channel),
aURI,
mIOThunk,
nullPrincipal,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
NS_LITERAL_CSTRING("text/html"));
if (NS_FAILED(rv)) return rv;
Expand Down
4 changes: 1 addition & 3 deletions dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,10 @@ nsXULTemplateQueryProcessorStorage::GetDatasource(nsIArray* aDataSources,
nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsINode> node = do_QueryInterface(aRootNode);

// The following channel is never openend, so it does not matter what
// securityFlags we pass; let's follow the principle of least privilege.
rv = NS_NewChannel(getter_AddRefs(channel),
uri,
node,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER);
NS_ENSURE_SUCCESS(rv, rv);

Expand Down
2 changes: 1 addition & 1 deletion netwerk/base/nsIOService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ nsIOService::SpeculativeConnectInternal(nsIURI *aURI,
nullptr, // aLoadingNode,
systemPrincipal,
nullptr, //aTriggeringPrincipal,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
getter_AddRefs(channel));
NS_ENSURE_SUCCESS(rv, rv);
Expand Down
2 changes: 1 addition & 1 deletion netwerk/base/nsProtocolProxyService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ nsProtocolProxyService::AsyncResolve(nsISupports *channelOrURI, uint32_t flags,
rv = NS_NewChannel(getter_AddRefs(channel),
uri,
systemPrincipal,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER);
NS_ENSURE_SUCCESS(rv, rv);
}
Expand Down
5 changes: 1 addition & 4 deletions netwerk/cookie/CookieServiceParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@ CreateDummyChannel(nsIURI* aHostURI, NeckoOriginAttributes& aAttrs, bool aIsPriv
return;
}

// The following channel is never openend, so it does not matter what
// securityFlags we pass; let's follow the principle of least privilege.
nsCOMPtr<nsIChannel> dummyChannel;
NS_NewChannel(getter_AddRefs(dummyChannel), dummyURI, principal,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsIContentPolicy::TYPE_INVALID);
nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_INVALID);
nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(dummyChannel);
if (!pbChannel) {
return;
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/file/nsFileChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ nsFileChannel::OpenContentStream(bool async, nsIInputStream **result,
rv = NS_NewChannel(getter_AddRefs(newChannel),
newURI,
nsContentUtils::GetSystemPrincipal(),
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER);

if (NS_FAILED(rv))
Expand Down
5 changes: 2 additions & 3 deletions netwerk/protocol/viewsource/nsViewSourceChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ nsViewSourceChannel::Init(nsIURI* uri)
// This function is called from within nsViewSourceHandler::NewChannel2
// and sets the right loadInfo right after returning from this function.
// Until then we follow the principal of least privilege and use
// nullPrincipal as the loadingPrincipal and the least permissive
// securityflag.
// nullPrincipal as the loadingPrincipal.
nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
NS_ENSURE_TRUE(nullPrincipal, NS_ERROR_FAILURE);

Expand All @@ -76,7 +75,7 @@ nsViewSourceChannel::Init(nsIURI* uri)
nullptr, // aLoadingNode
nullPrincipal,
nullptr, // aTriggeringPrincipal
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
getter_AddRefs(mChannel));
NS_ENSURE_SUCCESS(rv, rv);
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ WyciwygChannelChild::Init(nsIURI* uri)
&requestingPrincipalInfo);
mozilla::ipc::PrincipalToPrincipalInfo(nsContentUtils::GetSystemPrincipal(),
&triggeringPrincipalInfo);
securityFlags = nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL;
securityFlags = nsILoadInfo::SEC_NORMAL;
policyType = nsIContentPolicy::TYPE_OTHER;
}

Expand Down
4 changes: 1 addition & 3 deletions parser/xml/nsSAXXMLReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,12 @@ nsSAXXMLReader::ParseFromStream(nsIInputStream *aStream,
nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
NS_ENSURE_TRUE(nullPrincipal, NS_ERROR_FAILURE);

// The following channel is never openend, so it does not matter what
// securityFlags we pass; let's follow the principle of least privilege.
nsCOMPtr<nsIChannel> parserChannel;
rv = NS_NewInputStreamChannel(getter_AddRefs(parserChannel),
mBaseURI,
aStream,
nullPrincipal,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
nsDependentCString(aContentType));
if (!parserChannel || NS_FAILED(rv))
Expand Down
4 changes: 1 addition & 3 deletions rdf/base/nsRDFXMLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ nsRDFXMLParser::ParseString(nsIRDFDataSource* aSink, nsIURI* aBaseURI, const nsA
nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
NS_ENSURE_TRUE(nullPrincipal, NS_ERROR_FAILURE);

// The following channel is never openend, so it does not matter what
// securityFlags we pass; let's follow the principle of least privilege.
nsCOMPtr<nsIChannel> channel;
rv = NS_NewInputStreamChannel(getter_AddRefs(channel),
aBaseURI,
stream,
nullPrincipal,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
NS_LITERAL_CSTRING("text/xml"));
if (NS_FAILED(rv)) return rv;
Expand Down

0 comments on commit 817d882

Please sign in to comment.