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

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..af105e3fe071ccda7419a21967890108730f6c44 100644
--- a/Source/modules/crypto/CryptoResultImpl.h
+++ b/Source/modules/crypto/CryptoResultImpl.h
@@ -72,12 +72,18 @@ public:
ScriptPromise promise();
private:
- class WeakResolver;
+ class Resolver;
explicit CryptoResultImpl(ScriptState*);
+ void clearResolver();
void cancel();
- WeakPtr<ScriptPromiseResolver> m_resolver;
+ // Since ScriptPromiseResolver destroys itself, we should not use RefPtr
haraken 2014/12/12 08:49:31 I still don't fully understand why we cannot make
eroman 2014/12/12 23:32:54 I had some concerns on this explained in earlier c
haraken 2014/12/15 01:34:59 Thanks, makes sense. tasak@: Let's update a comme
+ // here. So to avoid using stale pointer, m_resolver should be cleared
haraken 2014/12/12 08:49:31 a stale pointer
+ // after resolving.
haraken 2014/12/12 08:49:31 after resolving => when getting resolved
tasak 2014/12/15 05:26:46 Updated the comment.
+ // FIXME: ScriptPromiseResolver should not be exported.
+ // Instead, use ScriptPromise.
+ ScriptPromiseResolver* m_resolver;
haraken 2014/12/12 08:49:31 Shall we change ScriptPromiseResolver* to CryptoRe
volatile int m_cancelled;
};
« 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