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

Unified Diff: third_party/WebKit/Source/bindings/IDLExtendedAttributes.md

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix var used only in assert Created 4 years, 8 months 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 | third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..65b85b1676df4ede1f40c41efd8e8d616a171ee6 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.
+### [TraceWrappers=(list)] _(i)_
+
+Summary: This generates code that traces script-wrappable references (which are used to keep wrappers alive during V8 GC).
+
+Usage: `[TraceWrappers=(list)]` can be specified on an interface.
+
+```webidl
+[
+ TraceWrappers=(element1, element2)
+] interface XXX : YYY { ... };
+```
+
+The generator generates a function called `XXX::traceWrappers` which is called by `ScriptWrappableVisitor` during V8 GC. The function adds references from the XXX instance to this object's element1() and element2() children.
+
+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.
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698