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

Unified Diff: Source/modules/crypto/CryptoResultImpl.h

Issue 133253002: [webcrypto] Fix TODO regarding asynchronous completion of crypto operations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | « Source/core/platform/CryptoResult.h ('k') | Source/modules/crypto/CryptoResultImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/CryptoResultImpl.h
diff --git a/Source/modules/crypto/CryptoResultImpl.h b/Source/modules/crypto/CryptoResultImpl.h
index a0f39ed8f35e04455a66ace1e4feeebec2d78b7f..39ae66fcd84b615ab91517480347230d583ae837 100644
--- a/Source/modules/crypto/CryptoResultImpl.h
+++ b/Source/modules/crypto/CryptoResultImpl.h
@@ -34,11 +34,14 @@
#include "bindings/v8/ScriptPromise.h"
#include "core/platform/CryptoResult.h"
#include "public/platform/WebCrypto.h"
+#include "wtf/Assertions.h"
#include "wtf/Forward.h"
+#include "wtf/Threading.h"
namespace WebCore {
class ScriptPromiseResolver;
+class ScriptState;
// Wrapper around a Promise to notify completion of the crypto operation.
// Platform cannot know about Promises which are declared in bindings.
@@ -57,9 +60,18 @@ public:
private:
explicit CryptoResultImpl(ScriptPromise);
void finish();
+ void CheckValidThread() const;
RefPtr<ScriptPromiseResolver> m_promiseResolver;
+
+ // This ScriptState should outlive m_promiseResolver, as it is kept alive by
eroman 2014/01/10 05:21:13 Please confirm whether this interpretation is corr
abarth-chromium 2014/01/10 15:25:03 This looks wrong. Why should ScriptValue keep the
eroman 2014/01/10 19:10:26 Thanks abarth! I modeled this after FontFaceSet.c
abarth-chromium 2014/01/14 04:01:06 You shouldn't need to keep a ScriptState. Take a
eroman 2014/01/14 20:40:09 Would it be appropriate to make CryptoResultImpl i
+ // a ScriptValue held by the resolver.
+ ScriptState* m_scriptState;
+
+#if !ASSERT_DISABLED
+ ThreadIdentifier m_owningThread;
bool m_finished;
+#endif
};
} // namespace WebCore
« no previous file with comments | « Source/core/platform/CryptoResult.h ('k') | Source/modules/crypto/CryptoResultImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698