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

Unified Diff: third_party/WebKit/Source/platform/heap/BlinkGCAPIReference.md

Issue 1458403002: Oilpan: Mention pre-finalizer registration in the documentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/BlinkGCAPIReference.md
diff --git a/third_party/WebKit/Source/platform/heap/BlinkGCAPIReference.md b/third_party/WebKit/Source/platform/heap/BlinkGCAPIReference.md
index c8febf225703afe852f3664c1049484291c6a0a1..0dc0c66326c6767d678670043ba1edf62ed81c04 100644
--- a/third_party/WebKit/Source/platform/heap/BlinkGCAPIReference.md
+++ b/third_party/WebKit/Source/platform/heap/BlinkGCAPIReference.md
@@ -98,10 +98,17 @@ with a destructor.
A pre-finalizer must have the following function signature: `void preFinalizer()`. You can change the function name.
+A pre-finalizer must be registered in the constructor by using the following statement:
+"`ThreadState::current()->registerPreFinalizer(this, preFinalizerName);`".
+
```c++
class YourClass : public GarbageCollectedFinalized<YourClass> {
USING_PRE_FINALIZER(YourClass, dispose);
public:
+ YourClass()
+ {
+ ThreadState::current()->registerPreFinalizer(this, dispose);
sof 2015/11/21 16:11:36 ThreadState::registerPreFinalizer() doesn't take t
Yuta Kitamura 2015/11/24 07:07:59 Whoops, thanks. I'll follow-up with this. (Commen
+ }
void dispose()
{
m_other->dispose(); // OK; you can touch other on-heap objects in a pre-finalizer.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698