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 6399a5b5f905e718c0ff2e5b7ebd55c4dca60163..380e9409b55660dcb30ec4599a76c52d700b2988 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| @@ -313,6 +313,12 @@ v8::Local<v8::Signature> V8DOMConfiguration::installDOMClassTemplate(v8::Isolate |
| v8::Local<v8::ObjectTemplate> instanceTemplate = functionDescriptor->InstanceTemplate(); |
| v8::Local<v8::ObjectTemplate> prototypeTemplate = functionDescriptor->PrototypeTemplate(); |
| instanceTemplate->SetInternalFieldCount(fieldCount); |
| + // TODO(yukishiino): We should set the class string to the platform object |
| + // (|instanceTemplate|), too. The reason that we don't set it is that |
|
adamk
2016/02/12 18:31:33
Can you say more about exactly what this patch doe
|
| + // 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 |
|
caitp (gmail)
2016/02/12 14:44:46
Has there been more discussion about this since ht
|
| + setClassString(isolate, prototypeTemplate, interfaceName); |
| if (!parentClass.IsEmpty()) { |
| functionDescriptor->Inherit(parentClass); |
| // Marks the prototype object as one of native-backed objects. |
| @@ -345,4 +351,9 @@ v8::Local<v8::FunctionTemplate> V8DOMConfiguration::domClassTemplate(v8::Isolate |
| return result; |
| } |
| +void V8DOMConfiguration::setClassString(v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> objectTemplate, const char* classString) |
| +{ |
| + objectTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, classString), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); |
| +} |
| + |
| } // namespace blink |