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 |