Skip to content

Commit

Permalink
Bug 1533159: Add MOZ_RELEASE_ASSERT to all SetLoadInfo implementation…
Browse files Browse the repository at this point in the history
…s to ensure loadinfo is never null. r=valentin

Differential Revision: https://phabricator.services.mozilla.com/D23302

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Christoph Kerschbaumer committed Mar 14, 2019
1 parent 49a632b commit 459ec2f
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions dom/jsurl/nsJSProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ nsJSChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) {

NS_IMETHODIMP
nsJSChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
return mStreamChannel->SetLoadInfo(aLoadInfo);
}

Expand Down
1 change: 1 addition & 0 deletions image/decoders/icon/mac/nsIconChannelCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@

NS_IMETHODIMP
nsIconChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down
1 change: 1 addition & 0 deletions image/decoders/icon/win/nsIconChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ nsIconChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) {

NS_IMETHODIMP
nsIconChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down
1 change: 1 addition & 0 deletions modules/libjar/nsJARChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ nsJARChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {

NS_IMETHODIMP
nsJARChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down
1 change: 1 addition & 0 deletions netwerk/base/nsBaseChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ nsBaseChannel::SetOwner(nsISupports *aOwner) {

NS_IMETHODIMP
nsBaseChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;

// Need to update |mNeckoTarget| when load info has changed.
Expand Down
1 change: 1 addition & 0 deletions netwerk/protocol/http/HttpBaseChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ HttpBaseChannel::SetOwner(nsISupports* aOwner) {

NS_IMETHODIMP
HttpBaseChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down
1 change: 1 addition & 0 deletions netwerk/protocol/http/TrackingDummyChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ TrackingDummyChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) {

NS_IMETHODIMP
TrackingDummyChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/viewsource/nsViewSourceChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ nsViewSourceChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {
NS_IMETHODIMP
nsViewSourceChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE);

MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
return mChannel->SetLoadInfo(aLoadInfo);
}

Expand Down
1 change: 1 addition & 0 deletions netwerk/protocol/websocket/BaseWebSocketChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ BaseWebSocketChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) {

NS_IMETHODIMP
BaseWebSocketChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down
1 change: 1 addition & 0 deletions netwerk/streamconv/converters/nsMultiMixedConv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ nsPartChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {

NS_IMETHODIMP
nsPartChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
return mMultipartChannel->SetLoadInfo(aLoadInfo);
}

Expand Down
1 change: 1 addition & 0 deletions uriloader/exthandler/nsExternalProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ NS_IMETHODIMP nsExtProtocolChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {
}

NS_IMETHODIMP nsExtProtocolChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
mLoadInfo = aLoadInfo;
return NS_OK;
}
Expand Down

0 comments on commit 459ec2f

Please sign in to comment.