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

Unified Diff: content/child/blink_platform_impl.cc

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/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 78f648ed3152b6a438b100c619e273857f1cbbfe..bb433f40611e9e941fc2a12476171966790371ec 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -32,7 +32,6 @@
#include "content/child/web_discardable_memory_impl.h"
#include "content/child/web_socket_stream_handle_impl.h"
#include "content/child/web_url_loader_impl.h"
-#include "content/child/webcrypto/webcrypto_impl.h"
#include "content/child/websocket_bridge.h"
#include "content/child/webthread_impl.h"
#include "content/child/worker_task_runner.h"
@@ -907,9 +906,8 @@ void BlinkPlatformImpl::didStopWorkerRunLoop(
}
blink::WebCrypto* BlinkPlatformImpl::crypto() {
- if (!web_crypto_)
- web_crypto_.reset(new WebCryptoImpl());
- return web_crypto_.get();
+ webcrypto_impl_.EnsureInit();
+ return &web_crypto_;
}

Powered by Google App Engine
This is Rietveld 408576698