Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| index 5fc33c7fbad0940f02745ce596eb3c93264c50bb..79aceb59f7ce83e074b5981136fe5dff7ca6c4f9 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| @@ -616,12 +616,19 @@ void V8DOMConfiguration::initializeDOMInterfaceTemplate( |
| v8::Local<v8::ObjectTemplate> prototypeTemplate = |
| interfaceTemplate->PrototypeTemplate(); |
| instanceTemplate->SetInternalFieldCount(v8InternalFieldCount); |
| - // TODO(yukishiino): We should set the class string to the platform object |
| - // (|instanceTemplate|), too. The reason that we don't set it is that |
| - // it prevents minor GC to collect unreachable DOM objects (a layout test |
| - // fast/dom/minor-dom-gc.html fails if we set the class string). |
| - // See also http://heycam.github.io/webidl/#es-platform-objects |
| + |
| + // We intentionally don't set the class string to the platform object |
| + // (|instanceTemplate|), and set the class string "InterfaceName", without |
| + // "Prototype", to the prototype object (|prototypeTemplate|), because we |
|
Matt Giuca
2017/02/05 23:18:08
It seems a bit strange out of context to be saying
Yuki
2017/02/14 12:58:46
Done.
|
| + // think it's more consistent with ECMAScript 2016. |
| + // See also https://crbug.com/643712 |
| + // |
| + // Note that V8 minor GC does not collect an object which has an own property. |
| + // So, if we set the class string to the platform object as an own property, |
| + // it prevents V8 minor GC to collect the object (V8 minor GC only collects |
| + // an empty object). If set, a layout test fast/dom/minor-dom-gc.html fails. |
| setClassString(isolate, prototypeTemplate, interfaceName); |
| + |
| if (!parentInterfaceTemplate.IsEmpty()) { |
| interfaceTemplate->Inherit(parentInterfaceTemplate); |
| // Marks the prototype object as one of native-backed objects. |