W3C home > Mailing lists > Public > public-webcrypto@w3.org > October 2012

Re: Web Workers!

From: Ryan Sleevi <sleevi@google.com>
Date: Sun, 21 Oct 2012 20:36:53 -0700
Message-ID: <CACvaWvbYizx7vT57S-w4sxOrS78xrGXehc7NvyN01WVN-T2ksg@mail.gmail.com>
To: Nadim Kobeissi <nadim@nadim.cc>
Cc: public-webcrypto@w3.org
The namespace has nothing to do with Workers. In the current draft, it
isn't even specified that there is a partial interface on Window that
exposes a readonly attribute crypto that implements the Crypto interface.
This is an underspecification fixed in the next draft.

I recently proposed a change on the list to expose getRandom via
WorkerGlobalScope, which will be incorporated into the next draft I am
publishing shortly.

Note that, because this API is currently async, there is absolutely *no*
reason to suggest that it is unsuitable for expensive operations. Those
operations can still be moved off the main thread by implementations
without any spec concerns. The benefit of Workers is in fact the opposite -
exposing a *blocking* API to make it easier to program *for authors*.

This is raised as ISSUE-24, and I am sure the WG would welcome a concrete
proposal on the semantics of a synchronous API that also deals with the
inherent need to describe the "thread safety" of keys. But we should be
clear of the benefits, and it is not CPU.
On Oct 21, 2012 8:05 PM, "Nadim Kobeissi" <nadim@nadim.cc> wrote:

> I just went through the Editor's Draft and I realized that all functions
> under window.crypto would be inaccessible from within Web Workers! I'm
> sorry if this has been discussed before, but this could be a serious
> problem and really limit the capacity of using web workers for CPU-intense
> crypto operations. Perhaps we should move to a different namespace?
> Let me know what you think,
> NK
Received on Monday, 22 October 2012 03:37:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 22 October 2012 03:37:21 GMT