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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp

Issue 2666943003: WIP: Fix WebIDL spec violation: prototype names end with "Prototype". (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698