Bug 1323947 - Use Use MOZ_MUST_USE in netwerk/protocol/viewsource r=valentin

MozReview-Commit-ID: 5JAkF53s42X

--HG--
extra : rebase_source : 5e3d82f3b15b25c610086e26e941cb6064acf975
This commit is contained in:
Wei-Cheng Pan 2016-11-23 17:21:17 +08:00
Родитель 05755370a0
Коммит 19fc36c981
6 изменённых файлов: 20 добавлений и 17 удалений

Просмотреть файл

@ -10952,7 +10952,8 @@ nsDocShell::DoURILoad(nsIURI* aURI,
if (aBaseURI) {
nsCOMPtr<nsIViewSourceChannel> vsc = do_QueryInterface(channel);
if (vsc) {
vsc->SetBaseURI(aBaseURI);
rv = vsc->SetBaseURI(aBaseURI);
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
}
} else {

Просмотреть файл

@ -155,7 +155,7 @@ nsContentDLF::CreateInstance(const char* aCommand,
// type of the data. If it's known, use it; otherwise use
// text/plain.
nsAutoCString type;
viewSourceChannel->GetOriginalContentType(type);
mozilla::Unused << viewSourceChannel->GetOriginalContentType(type);
bool knownType =
(!type.EqualsLiteral(VIEWSOURCE_CONTENT_TYPE) &&
IsTypeInList(type, gHTMLTypes)) ||

Просмотреть файл

@ -2161,8 +2161,10 @@ NS_IsSrcdocChannel(nsIChannel *aChannel)
}
nsCOMPtr<nsIViewSourceChannel> vsc = do_QueryInterface(aChannel);
if (vsc) {
vsc->GetIsSrcdocChannel(&isSrcdoc);
return isSrcdoc;
nsresult rv = vsc->GetIsSrcdocChannel(&isSrcdoc);
if (NS_SUCCEEDED(rv)) {
return isSrcdoc;
}
}
return false;
}

Просмотреть файл

@ -18,12 +18,12 @@ interface nsIViewSourceChannel : nsIChannel
* However, callers interested in finding out or setting the
* actual content type can utilize this attribute.
*/
attribute ACString originalContentType;
[must_use] attribute ACString originalContentType;
/**
* Whether the channel was created to view the source of a srcdoc document.
*/
readonly attribute boolean isSrcdocChannel;
[must_use] readonly attribute boolean isSrcdocChannel;
/**
* Set to indicate the base URI. If this channel is a srcdoc channel, it
@ -32,7 +32,7 @@ interface nsIViewSourceChannel : nsIChannel
* otherwise recoverable. Returns null when it isn't set and isn't a
* srcdoc channel.
*/
attribute nsIURI baseURI;
[must_use] attribute nsIURI baseURI;
};

Просмотреть файл

@ -48,12 +48,12 @@ public:
: mIsDocument(false)
, mOpened(false) {}
nsresult Init(nsIURI* uri);
MOZ_MUST_USE nsresult Init(nsIURI* uri);
nsresult InitSrcdoc(nsIURI* aURI,
nsIURI* aBaseURI,
const nsAString &aSrcdoc,
nsILoadInfo* aLoadInfo);
MOZ_MUST_USE nsresult InitSrcdoc(nsIURI* aURI,
nsIURI* aBaseURI,
const nsAString &aSrcdoc,
nsILoadInfo* aLoadInfo);
protected:
~nsViewSourceChannel() {}

Просмотреть файл

@ -25,11 +25,11 @@ public:
// Creates a new nsViewSourceChannel to view the source of an about:srcdoc
// URI with contents specified by srcdoc.
nsresult NewSrcdocChannel(nsIURI *aURI,
nsIURI *aBaseURI,
const nsAString &aSrcdoc,
nsILoadInfo *aLoadInfo,
nsIChannel** outChannel);
MOZ_MUST_USE nsresult NewSrcdocChannel(nsIURI *aURI,
nsIURI *aBaseURI,
const nsAString &aSrcdoc,
nsILoadInfo *aLoadInfo,
nsIChannel** outChannel);
static nsViewSourceHandler* GetInstance();