Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/IDLExtendedAttributes.md |
| diff --git a/third_party/WebKit/Source/bindings/IDLExtendedAttributes.md b/third_party/WebKit/Source/bindings/IDLExtendedAttributes.md |
| index 28d0e014aa7c2de5df2fe60f776eebde00878828..ddbce2eb0bdc7646f0170447cc1a020c610c866d 100644 |
| --- a/third_party/WebKit/Source/bindings/IDLExtendedAttributes.md |
| +++ b/third_party/WebKit/Source/bindings/IDLExtendedAttributes.md |
| @@ -1269,6 +1269,32 @@ The code generates a function called `YYY::visitDOMWrapper` which is called by ` |
| The `[SetWrapperReferenceTo]` extended attribute takes a value, which is the method name to call to get the target object. For example, with the above declaration a call will be made to `YYY::targetMethod()` to get the target of the reference. |
| +### [TraceWrapperReferences=(list)] _(i)_ |
| + |
| +Summary: This generates code that traces script-wrappable references (which are used to keep wrappers alive during V8 GC). |
| + |
| +Usage: `[TraceWrapperReferences=(list)]` can be specified on an interface. |
| + |
| +```webidl |
| +[ |
| + TraceWrapperReferences=(element1, element2) |
| +] interface XXX : YYY { ... }; |
| +``` |
| + |
| +The generator generates a functions called `XXX::traceWrappers` which is called by `ScriptWrappableHeapTracer` during V8 GC. The function adds references from the XXX instance to this object's element1() and element2() children. |
|
haraken
2016/04/18 04:35:41
functions => function
Marcel Hlopko
2016/04/18 11:45:34
Done.
|
| + |
| +The generated code is then: |
| + |
| +```c++ |
| +DEFINE_TRACE_WRAPPERS(XXX) |
| +{ |
| + visitor->traceWrappers(element1()); |
| + visitor->traceWrappers(element2()); |
| + |
| + YYY::traceWrappers(visitor); |
| +} |
| +``` |
| + |
| ## Rare Blink-specific IDL Extended Attributes |
| These extended attributes are rarely used, generally only in one or two places. These are often replacements for `[Custom]` bindings, and may be candidates for deprecation and removal. |