Chromium Code Reviews| 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. |