Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: content/child/webcrypto/webcrypto_impl.h

Issue 278513004: [webcrypto] Fix a race in BlinkPlatformImpl::crypto(), by using eager initilization of WebCryptoImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address sleevi comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/webcrypto/shared_crypto.h ('k') | content/child/webcrypto/webcrypto_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/webcrypto_impl.h
diff --git a/content/child/webcrypto/webcrypto_impl.h b/content/child/webcrypto/webcrypto_impl.h
index 179de041cb5c7a1f0963ec0fb9b34a9d385674c4..485beb9698d382bb3f28da3ea4f8a39615d82c68 100644
--- a/content/child/webcrypto/webcrypto_impl.h
+++ b/content/child/webcrypto/webcrypto_impl.h
@@ -14,14 +14,19 @@
namespace content {
// Wrapper around the Blink WebCrypto asynchronous interface, which forwards to
-// the synchronous platfrom (NSS or OpenSSL) implementation.
+// the synchronous platform (NSS or OpenSSL) implementation.
//
-// TODO(eroman): Post the synchronous work to a background thread.
+// WebCryptoImpl is threadsafe.
+//
+// EnsureInit() must be called prior to using methods on WebCryptoImpl().
class WebCryptoImpl : public blink::WebCrypto {
public:
WebCryptoImpl();
+
virtual ~WebCryptoImpl();
+ static void EnsureInit();
+
virtual void encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key,
const unsigned char* data,
« no previous file with comments | « content/child/webcrypto/shared_crypto.h ('k') | content/child/webcrypto/webcrypto_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698