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

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: Do initialization as part of crypto() 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
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..9a75f0a617b54d50cf59d029043d8be0cdaea29b 100644
--- a/content/child/webcrypto/webcrypto_impl.h
+++ b/content/child/webcrypto/webcrypto_impl.h
@@ -14,14 +14,17 @@
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.
+// EnsureInit() must be called prior to using WebCryptoImpl().
class WebCryptoImpl : public blink::WebCrypto {
public:
WebCryptoImpl();
+
virtual ~WebCryptoImpl();
+ void EnsureInit();
Ryan Sleevi 2014/05/13 05:47:20 why a member instead of a static? Given that it's
eroman 2014/05/13 18:27:15 Good idea, done.
+
virtual void encrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key,
const unsigned char* data,

Powered by Google App Engine
This is Rietveld 408576698