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

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

Issue 1228373006: Reliably cancel in-progress CryptoResult(Impl) upon shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: non-oilpan compile fix Created 5 years, 5 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: Source/modules/crypto/CryptoResultImpl.h
diff --git a/Source/modules/crypto/CryptoResultImpl.h b/Source/modules/crypto/CryptoResultImpl.h
index b6cb6e90126c8290fdfbbd3a2172afc230868247..4b632c218552db944c08257f4dafeab36d8a91ca 100644
--- a/Source/modules/crypto/CryptoResultImpl.h
+++ b/Source/modules/crypto/CryptoResultImpl.h
@@ -40,7 +40,6 @@
namespace blink {
-class ScriptPromiseResolver;
MODULES_EXPORT ExceptionCode webCryptoErrorToExceptionCode(WebCryptoErrorType);
// Wrapper around a Promise to notify completion of the crypto operation.
@@ -55,10 +54,10 @@ MODULES_EXPORT ExceptionCode webCryptoErrorToExceptionCode(WebCryptoErrorType);
// m_resolver will be leaked until the ExecutionContext is destroyed.
class CryptoResultImpl final : public CryptoResult {
public:
- ~CryptoResultImpl();
-
static PassRefPtrWillBeRawPtr<CryptoResultImpl> create(ScriptState*);
+ ~CryptoResultImpl();
+
void completeWithError(WebCryptoErrorType, const WebString&) override;
void completeWithBuffer(const void* bytes, unsigned bytesSize) override;
void completeWithJson(const char* utf8Data, unsigned length) override;
@@ -71,6 +70,8 @@ public:
// ScriptPromise.
ScriptPromise promise();
+ DECLARE_VIRTUAL_TRACE();
+
private:
class Resolver;
explicit CryptoResultImpl(ScriptState*);
@@ -78,12 +79,10 @@ private:
void clearResolver();
void cancel();
- // FIXME: ScriptPromiseResolver should not be exported.
- // Instead, use ScriptPromise.
- ScriptPromiseResolver* m_resolver;
+ RawPtrWillBeMember<Resolver> m_resolver;
volatile int m_cancelled;
};
} // namespace blink
-#endif
+#endif // CryptoResultImpl_h
« no previous file with comments | « no previous file | Source/modules/crypto/CryptoResultImpl.cpp » ('j') | Source/modules/crypto/CryptoResultImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698