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

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

Issue 780793002: Make CryptoResultImpl not to use WeakPtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 3ea352cb662d7b5bb8d5a35704e30b9bfeaeb49d..1ff25603150293c60440812529b059a0ede7cda3 100644
--- a/Source/modules/crypto/CryptoResultImpl.h
+++ b/Source/modules/crypto/CryptoResultImpl.h
@@ -72,13 +72,20 @@ public:
ScriptPromise promise();
private:
yhirano 2014/12/11 12:28:41 By making Resolver this class's inner class and ha
tasak 2014/12/12 07:56:51 Done.
- class WeakResolver;
explicit CryptoResultImpl(ScriptState*);
+ void clearResolver();
void cancel();
- WeakPtr<ScriptPromiseResolver> m_resolver;
+ // Since ScriptPromiseResolver destroys itself, we should not use RefPtr
haraken 2014/12/12 00:04:11 Just help me understand: Where is the ScriptPromis
tasak 2014/12/12 07:56:51 ScriptPromiseResolver destorys itself. So basicall
+ // here. So to avoid using stale pointer, m_resolver should be cleared
+ // after resolving.
+ // FIXME: ScriptPromiseResolver should not be exported.
+ // Instead, use ScriptPromise.
+ RawPtr<ScriptPromiseResolver> m_resolver;
haraken 2014/12/12 00:04:10 RawPtr<ScriptPromiseResolver> => ScriptPromiseReso
tasak 2014/12/12 07:56:51 Done.
volatile int m_cancelled;
+
+ friend class CryptoResultResolver;
};
} // namespace blink
« 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