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

Unified Diff: Source/bindings/tests/results/V8TestExtendedEvent.h

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 5 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/tests/results/V8TestExtendedEvent.h
diff --git a/Source/bindings/tests/results/V8TestExtendedEvent.h b/Source/bindings/tests/results/V8TestExtendedEvent.h
index 0982d9ee70bc4e3165b82518fe7c82b5c8cbece1..92cc7a119aebad2123d0474ae70d7cdb5071eaa9 100644
--- a/Source/bindings/tests/results/V8TestExtendedEvent.h
+++ b/Source/bindings/tests/results/V8TestExtendedEvent.h
@@ -37,11 +37,20 @@ public:
static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
static Event* toNative(v8::Handle<v8::Object> object)
{
- return reinterpret_cast<Event*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+ return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
}
static void derefObject(void*);
static WrapperTypeInfo info;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+ static inline void* toInternalPointer(Event* impl)
+ {
+ return V8TestEvent::toInternalPointer(impl);
+ }
+
+ static inline Event* fromInternalPointer(void* object)
+ {
+ return static_cast<Event*>(V8TestEvent::fromInternalPointer(object));
+ }
static void installPerContextProperties(v8::Handle<v8::Object>, Event*, v8::Isolate*) { }
static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
private:
@@ -59,7 +68,7 @@ public:
inline v8::Handle<v8::Object> wrap(Event* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
- ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty());
+ ASSERT(DOMDataStore::getWrapper<V8TestExtendedEvent>(impl, isolate).IsEmpty());
if (ScriptWrappable::wrapperCanBeStoredInObject(impl)) {
const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl);
// Might be a XXXConstructor::info instead of an XXX::info. These will both have
@@ -73,7 +82,7 @@ inline v8::Handle<v8::Value> toV8(Event* impl, v8::Handle<v8::Object> creationCo
{
if (UNLIKELY(!impl))
return v8NullWithCheck(isolate);
- v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate);
+ v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestExtendedEvent>(impl, isolate);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, creationContext, isolate);
@@ -84,7 +93,7 @@ inline v8::Handle<v8::Value> toV8ForMainWorld(Event* impl, v8::Handle<v8::Object
ASSERT(worldType(isolate) == MainWorld);
if (UNLIKELY(!impl))
return v8NullWithCheck(isolate);
- v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld(impl);
+ v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestExtendedEvent>(impl);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, creationContext, isolate);
@@ -95,7 +104,7 @@ inline v8::Handle<v8::Value> toV8Fast(Event* impl, const HolderContainer& contai
{
if (UNLIKELY(!impl))
return v8::Null(container.GetIsolate());
- v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast(impl, container, wrappable);
+ v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<V8TestExtendedEvent>(impl, container, wrappable);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, container.Holder(), container.GetIsolate());
@@ -107,7 +116,7 @@ inline v8::Handle<v8::Value> toV8FastForMainWorld(Event* impl, const HolderConta
ASSERT(worldType(container.GetIsolate()) == MainWorld);
if (UNLIKELY(!impl))
return v8::Null(container.GetIsolate());
- v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(impl);
+ v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<V8TestExtendedEvent>(impl);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, container.Holder(), container.GetIsolate());
« no previous file with comments | « Source/bindings/tests/results/V8TestException.cpp ('k') | Source/bindings/tests/results/V8TestExtendedEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698