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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IndexedDBClient.cpp

Issue 1869013002: Avoid IndexedDBClient::create() read race. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/indexeddb/IndexedDBClient.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IndexedDBClient.cpp b/third_party/WebKit/Source/modules/indexeddb/IndexedDBClient.cpp
index 54f9f5eba241df40b4cf95ba9bff6c4cf9c0d317..ddbe4cd3a088f29fdb4fd10eed1cf2db736ede51 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IndexedDBClient.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IndexedDBClient.cpp
@@ -20,10 +20,11 @@ void setIndexedDBClientCreateFunction(CreateIndexedDBClient createFunction)
IndexedDBClient* IndexedDBClient::create()
{
- ASSERT(idbClientCreateFunction);
+ CreateIndexedDBClient* createFunction = reinterpret_cast<CreateIndexedDBClient*>(acquireLoad(&idbClientCreateFunction));
+ ASSERT(createFunction);
// There's no reason why we need to allocate a new proxy each time, but
// there's also no strong reason not to.
- return reinterpret_cast<CreateIndexedDBClient*>(idbClientCreateFunction)();
+ return createFunction();
}
} // namespace blink
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698