Update Crypto.webidl to recent interface changes

RESOLVED FIXED in Firefox 38

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ttaubert, Assigned: ttaubert)

Tracking

Trunk
mozilla38
Points:
---

Firefox Tracking Flags

(firefox38 fixed)

Details

(URL)

Attachments

(2 attachments)

(Assignee)

Description

3 years ago
The interface was updated a few months ago:

https://dvcs.w3.org/hg/webcrypto-api/rev/810285715051
(Assignee)

Comment 1

3 years ago
Created attachment 8557883 [details] [diff] [review]
0001-Bug-1128479-Update-Crypto.webidl-to-recent-interface.patch
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Attachment #8557883 - Flags: review?(bugs)
Comment on attachment 8557883 [details] [diff] [review]
0001-Bug-1128479-Update-Crypto.webidl-to-recent-interface.patch

>+interface GlobalCrypto {
>+  //[Throws] readonly attribute Crypto crypto;
>+  [Throws] readonly attribute nsIDOMCrypto crypto;
You want Crypto as the type.

> 
> // https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html
>-partial interface Window {
>-  //[Throws] readonly attribute Crypto crypto;
>-  [Throws] readonly attribute nsIDOMCrypto crypto;
>-};

... but I guess since it is nsIDOMCrypto here, fine.
But that really should be fixed. no nsIDOM* in .webidl, please.
Currently nsIDOMCrypto seems to be the only nsIDOM* in any .webidl file.
Attachment #8557883 - Flags: review?(bugs) → review+
(Assignee)

Comment 3

3 years ago
Created attachment 8557915 [details] [diff] [review]
0002-Bug-1128479-Don-t-use-nsIDOMCrypto-in-Crypto.webidl.patch
Attachment #8557915 - Flags: review?(bugs)
Comment on attachment 8557915 [details] [diff] [review]
0002-Bug-1128479-Don-t-use-nsIDOMCrypto-in-Crypto.webidl.patch


>+Crypto*
> nsGlobalWindow::GetCrypto(ErrorResult& aError)
> {
>   FORWARD_TO_INNER_OR_THROW(GetCrypto, (aError), aError, nullptr);
> 
>   if (!mCrypto) {
>     mCrypto = new Crypto();
>-    mCrypto->Init(this);
>+    nsCOMPtr<nsIDOMCrypto> domCrypto(mCrypto);
>+    domCrypto->Init(this);

Why you need domCrypto?
Init doesn't do anything which might change mCrypto to point some other object, so
mCrypto->Init(this); should work.



Thanks.
Attachment #8557915 - Flags: review?(bugs) → review+
(Assignee)

Comment 5

3 years ago
(In reply to Olli Pettay [:smaug] from comment #4)
> >     mCrypto = new Crypto();
> >-    mCrypto->Init(this);
> >+    nsCOMPtr<nsIDOMCrypto> domCrypto(mCrypto);
> >+    domCrypto->Init(this);
> 
> Why you need domCrypto?
> Init doesn't do anything which might change mCrypto to point some other
> object, so
> mCrypto->Init(this); should work.

Yeah, you're right. Got confused it seems. Thanks!
(Assignee)

Comment 6

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/ea48f65afe64
https://hg.mozilla.org/integration/mozilla-inbound/rev/d02b6575d969
https://hg.mozilla.org/mozilla-central/rev/ea48f65afe64
https://hg.mozilla.org/mozilla-central/rev/d02b6575d969
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox38: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.