Closed Bug 1323946 Opened 8 years ago Closed 7 years ago

Use MOZ_MUST_USE in netwerk/protocol/res

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: wcpan, Assigned: wcpan)

References

Details

(Whiteboard: [necko-would-take])

Attachments

(1 file)

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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: