Bug 1473217 - Part 2: dom: Fix misc-unused-raii warnings. r=baku

nsPrintfCString creates a formatted string, but doesn't print it.

ExtractOriginData is called for its constructor's scope and origin out parameters. This ExtractOriginData object doesn't really need a name because it is unused after we have scope and origin,  but this change makes clang-tidy happy and makes the code clear that ExtractOriginData is an object and not a funcion being called.

MozReview-Commit-ID: nxUBwzL4Uq

--HG--
extra : rebase_source : 5fd3a592ac628b14b8221bf2df4fc442fb407106
extra : source : 1dfaf199d2ede7a445b40ec7585c66010f5a1a6b
This commit is contained in:
Chris Peterson 2018-07-03 22:09:54 -07:00
parent 3eed00fc26
commit 06a7d5c549
2 changed files with 5 additions and 4 deletions

View File

@ -25727,9 +25727,10 @@ NormalTransactionOp::SendSuccessResult()
GetResponse(response, &responseSize);
if (responseSize >= kMaxMessageSize) {
nsPrintfCString("The serialized value is too large"
" (size=%zu bytes, max=%zu bytes).",
responseSize, kMaxMessageSize);
nsPrintfCString warning("The serialized value is too large"
" (size=%zu bytes, max=%zu bytes).",
responseSize, kMaxMessageSize);
NS_WARNING(warning.get());
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}

View File

@ -178,7 +178,7 @@ GetOriginParticular::OnFunctionCall(
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString suffix, origin;
ExtractOriginData(scope, suffix, origin);
ExtractOriginData extractor(scope, suffix, origin);
nsCOMPtr<nsIWritableVariant> outVar(new nsVariant());