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

Unified Diff: Source/bindings/core/v8/CustomElementWrapper.cpp

Issue 531183003: bindings: Retires manual dispatching in createV8{HTML,SVG}Wrapper, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed bindings/modules/v8/custom/custom.gni Created 6 years, 3 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
Index: Source/bindings/core/v8/CustomElementWrapper.cpp
diff --git a/Source/bindings/core/v8/CustomElementWrapper.cpp b/Source/bindings/core/v8/CustomElementWrapper.cpp
index 745eb6de541d8723aabb3524f5ffd8e774d6456f..a40769f310dcec58879fe9418c0d783f13b86300 100644
--- a/Source/bindings/core/v8/CustomElementWrapper.cpp
+++ b/Source/bindings/core/v8/CustomElementWrapper.cpp
@@ -36,53 +36,20 @@
#include "bindings/core/v8/V8HTMLElement.h"
#include "bindings/core/v8/V8PerContextData.h"
#include "bindings/core/v8/V8SVGElement.h"
-#include "core/V8HTMLElementWrapperFactory.h" // FIXME: should be bindings/core/v8
-#include "core/V8SVGElementWrapperFactory.h" // FIXME: should be bindings/core/v8
#include "core/dom/custom/CustomElement.h"
#include "core/html/HTMLElement.h"
-#include "core/html/HTMLUnknownElement.h"
#include "core/svg/SVGElement.h"
namespace blink {
template<typename ElementType>
-v8::Handle<v8::Object> createDirectWrapper(ElementType*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-
-template<>
-v8::Handle<v8::Object> createDirectWrapper<HTMLElement>(HTMLElement* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- return createV8HTMLDirectWrapper(element, creationContext, isolate);
-}
-
-template<>
-v8::Handle<v8::Object> createDirectWrapper<SVGElement>(SVGElement* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- return createV8SVGDirectWrapper(element, creationContext, isolate);
-}
-
-template<typename ElementType>
-v8::Handle<v8::Object> createFallbackWrapper(ElementType*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-
-template<>
-v8::Handle<v8::Object> createFallbackWrapper<HTMLElement>(HTMLElement* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- return createV8HTMLFallbackWrapper(toHTMLUnknownElement(element), creationContext, isolate);
-}
-
-template<>
-v8::Handle<v8::Object> createFallbackWrapper<SVGElement>(SVGElement* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- return createV8SVGFallbackWrapper(element, creationContext, isolate);
-}
-
-template<typename ElementType>
v8::Handle<v8::Object> createUpgradeCandidateWrapper(ElementType* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate, v8::Handle<v8::Object> (*createSpecificWrapper)(ElementType* element, v8::Handle<v8::Object> creationContext, v8::Isolate*))
{
if (CustomElement::isValidName(element->localName()))
- return createDirectWrapper(element, creationContext, isolate);
+ return element->wrap(creationContext, isolate);
if (createSpecificWrapper)
return createSpecificWrapper(element, creationContext, isolate);
- return createFallbackWrapper(element, creationContext, isolate);
+ return element->wrap(creationContext, isolate);
}
template<typename ElementType, typename WrapperType>

Powered by Google App Engine
This is Rietveld 408576698