Closed Bug 1128479 Opened 9 years ago Closed 9 years ago

Update Crypto.webidl to recent interface changes

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: ttaubert, Assigned: ttaubert)

References

()

Details

Attachments

(2 files)

The interface was updated a few months ago:

https://dvcs.w3.org/hg/webcrypto-api/rev/810285715051
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+
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+
(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!
https://hg.mozilla.org/mozilla-central/rev/ea48f65afe64
https://hg.mozilla.org/mozilla-central/rev/d02b6575d969
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: