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..6cfce85d6e8ebbbd185806261a33bbb9850837e4 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| @@ -33,6 +33,8 @@ |
| #include "bindings/core/v8/V8PerContextData.h" |
| #include "platform/instrumentation/tracing/TraceEvent.h" |
| +#include <string> |
| + |
| namespace blink { |
| namespace { |
| @@ -615,13 +617,19 @@ void V8DOMConfiguration::initializeDOMInterfaceTemplate( |
| interfaceTemplate->InstanceTemplate(); |
| 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 |
| + // TODO(mgiuca): Setting the class string for |instanceTemplate| prevents |
| + // minor GC from collecting unreachable DOM objects (a layout test |
| // fast/dom/minor-dom-gc.html fails if we set the class string). |
|
haraken
2017/02/01 03:57:12
yukishiino@: Is this still true? We've made a lot
Matt Giuca
2017/02/01 03:59:47
I just tried it and it fails under this CL.
|
| // See also http://heycam.github.io/webidl/#es-platform-objects |
| - setClassString(isolate, prototypeTemplate, interfaceName); |
| + // However, *not* setting this means that setting the class string for |
| + // |prototypeTemplate| below causes instances to also be named "Prototype". |
| + // See https://crbug.com/687431. |
| + // DO NOT SUBMIT. |
| + setClassString(isolate, instanceTemplate, interfaceName); |
| + instanceTemplate->SetInternalFieldCount(v8InternalFieldCount); |
| + std::string prototypeName(interfaceName); |
| + prototypeName += "Prototype"; |
| + setClassString(isolate, prototypeTemplate, prototypeName.c_str()); |
| if (!parentInterfaceTemplate.IsEmpty()) { |
| interfaceTemplate->Inherit(parentInterfaceTemplate); |
| // Marks the prototype object as one of native-backed objects. |