Provide a C++ friendly version of LoadInfo on nsIChannel

RESOLVED FIXED in Firefox 42

Status

()

Core
DOM: Security
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ckerschb, Assigned: ckerschb)

Tracking

unspecified
mozilla42
Points:
---

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Updated

3 years ago
Assignee: nobody → mozilla
Blocks: 1143922
(Assignee)

Comment 1

3 years ago
Created attachment 8630540 [details] [diff] [review]
bug_1180964_loadinfo_getter.patch

Jonas, what do you think? If you are fine with that change I would ask a necko peer to review. I think it would make C++ a whole lot nicer instead of having to use the outgoing argument for loadInfo on the channel all the time.
Attachment #8630540 - Flags: review?(jonas)
Comment on attachment 8630540 [details] [diff] [review]
bug_1180964_loadinfo_getter.patch

Review of attachment 8630540 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/base/nsIChannel.idl
@@ +318,5 @@
> +  inline already_AddRefed<nsILoadInfo> GetLoadInfo()
> +  {
> +    nsCOMPtr<nsILoadInfo> result;
> +    nsresult rv = GetLoadInfo(getter_AddRefs(result));
> +    NS_ENSURE_SUCCESS(rv, nullptr);

Just do MOZ_ASSERT(NS_SUCCEEDED(rv) || !result). Per XPCOM rules that should always pass. That way the release code is simpler.
Attachment #8630540 - Flags: review?(jonas) → review+
(Assignee)

Comment 3

3 years ago
Created attachment 8630611 [details] [diff] [review]
bug_1180964_loadinfo_getter.patch

Thanks Jonas. Steve, are you fine with that?
Attachment #8630540 - Attachment is obsolete: true
Attachment #8630611 - Flags: review?(sworkman)
Comment on attachment 8630611 [details] [diff] [review]
bug_1180964_loadinfo_getter.patch

Review of attachment 8630611 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM - Thanks Chris!
Attachment #8630611 - Flags: review?(sworkman) → review+
https://hg.mozilla.org/mozilla-central/rev/57055f96a040
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox42: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.