Chromium Code Reviews| Index: Source/modules/crypto/CryptoResultImpl.h |
| diff --git a/Source/modules/crypto/CryptoResultImpl.h b/Source/modules/crypto/CryptoResultImpl.h |
| index e8a1f5c87bbf26b5e2780ad686a05a7b24e36c9c..f23b044680857fd6e1d2f5ac893058eca4a198f2 100644 |
| --- a/Source/modules/crypto/CryptoResultImpl.h |
| +++ b/Source/modules/crypto/CryptoResultImpl.h |
| @@ -31,18 +31,23 @@ |
| #ifndef CryptoResultImpl_h |
| #define CryptoResultImpl_h |
| +#include "bindings/v8/DOMRequestState.h" |
| #include "bindings/v8/ScriptPromise.h" |
| +#include "core/dom/ContextLifecycleObserver.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; |
|
abarth-chromium
2014/01/18 09:03:48
This looks unused now.
|
| // Wrapper around a Promise to notify completion of the crypto operation. |
| // Platform cannot know about Promises which are declared in bindings. |
| -class CryptoResultImpl FINAL : public CryptoResult { |
| +class CryptoResultImpl FINAL : public CryptoResult, public ContextLifecycleObserver { |
| public: |
| ~CryptoResultImpl(); |
| @@ -55,11 +60,25 @@ public: |
| virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const blink::WebCryptoKey& privateKey) OVERRIDE; |
| private: |
| - explicit CryptoResultImpl(ScriptPromise); |
| + CryptoResultImpl(ExecutionContext*, ScriptPromise); |
| void finish(); |
| + void CheckValidThread() const; |
| + |
| + // Override from ContextLifecycleObserver |
| + virtual void contextDestroyed() OVERRIDE; |
| + |
| + // Returns true if the ExecutionContext is still alive and running. |
| + bool canCompletePromise() const; |
| + |
| + void clearPromiseResolver(); |
| RefPtr<ScriptPromiseResolver> m_promiseResolver; |
| + DOMRequestState m_requestState; |
| + |
| +#if !ASSERT_DISABLED |
| + ThreadIdentifier m_owningThread; |
| bool m_finished; |
| +#endif |
| }; |
| } // namespace WebCore |