Use MOZ_MUST_USE in netwerk/protocol/res

RESOLVED FIXED in Firefox 53

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: wcpan, Assigned: wcpan)

Tracking

(Blocks 1 bug)

unspecified
mozilla53
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox53 fixed)

Details

(Whiteboard: [necko-would-take])

Attachments

(1 attachment)

Assignee: nobody → wpan
Blocks: 1303701
Whiteboard: [necko-would-take]
Comment on attachment 8820575 [details]
Bug 1323946 - Use MOZ_MUST_USE for netwerk/protocol/res

https://reviewboard.mozilla.org/r/100058/#review100688

::: chrome/nsChromeRegistryChrome.cpp:991
(Diff revision 1)
>                            uri);
>      return;
>    }
>  
> -  rph->SetSubstitution(host, resolved);
> +  rv = rph->SetSubstitution(host, resolved);
> +  MOZ_ASSERT(NS_SUCCEEDED(rv));

Similar to above, if NS_FAILED call LogMessageWithContext

::: layout/style/nsLayoutStylesheetCache.cpp:603
(Diff revision 1)
>      if (!handler) {
>        annotation.AppendLiteral("(ResolveURI failed)\n");
>      } else {
>        nsAutoCString resolvedSpec;
> -      handler->ResolveURI(aURI, resolvedSpec);
> +      DebugOnly<nsresult> rv = handler->ResolveURI(aURI, resolvedSpec);
> +      MOZ_ASSERT(NS_SUCCEEDED(rv));

This may fail. I think this would be more appropriate:
```
if (NS_FAILED(rv)) {
annotation.AppendLiteral("(ResolveURI failed rv=)");
annotation.AppendInt(rv);
annotation.AppendLiteral("\n");
}
```
Attachment #8820575 - Flags: review?(valentin.gosu) → review+
Pushed by wpan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c28b3afaa5cd
Use MOZ_MUST_USE for netwerk/protocol/res r=valentin
https://hg.mozilla.org/mozilla-central/rev/c28b3afaa5cd
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.