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

Unified Diff: Source/bindings/tests/results/V8TestCustomAccessors.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/V8TestCustomAccessors.h
diff --git a/Source/bindings/tests/results/V8TestCustomAccessors.h b/Source/bindings/tests/results/V8TestCustomAccessors.h
index 25b9db6e2fe9e13127ea48f11efb361f831a0bc7..b5d1f8d43c6cb90a127b2d307d0a670a4841637c 100644
--- a/Source/bindings/tests/results/V8TestCustomAccessors.h
+++ b/Source/bindings/tests/results/V8TestCustomAccessors.h
@@ -35,7 +35,7 @@ public:
static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
static TestCustomAccessors* toNative(v8::Handle<v8::Object> object)
{
- return reinterpret_cast<TestCustomAccessors*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+ return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
}
static void derefObject(void*);
static WrapperTypeInfo info;
@@ -48,6 +48,15 @@ public:
static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer>&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+ static inline void* toInternalPointer(TestCustomAccessors* impl)
+ {
+ return impl;
+ }
+
+ static inline TestCustomAccessors* fromInternalPointer(void* object)
+ {
+ return static_cast<TestCustomAccessors*>(object);
+ }
static void installPerContextProperties(v8::Handle<v8::Object>, TestCustomAccessors*, v8::Isolate*) { }
static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
private:
@@ -65,7 +74,7 @@ public:
inline v8::Handle<v8::Object> wrap(TestCustomAccessors* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
- ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty());
+ ASSERT(DOMDataStore::getWrapper<V8TestCustomAccessors>(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
@@ -79,7 +88,7 @@ inline v8::Handle<v8::Value> toV8(TestCustomAccessors* impl, v8::Handle<v8::Obje
{
if (UNLIKELY(!impl))
return v8NullWithCheck(isolate);
- v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate);
+ v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomAccessors>(impl, isolate);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, creationContext, isolate);
@@ -90,7 +99,7 @@ inline v8::Handle<v8::Value> toV8ForMainWorld(TestCustomAccessors* impl, v8::Han
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<V8TestCustomAccessors>(impl);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, creationContext, isolate);
@@ -101,7 +110,7 @@ inline v8::Handle<v8::Value> toV8Fast(TestCustomAccessors* impl, const HolderCon
{
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<V8TestCustomAccessors>(impl, container, wrappable);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, container.Holder(), container.GetIsolate());
@@ -113,7 +122,7 @@ inline v8::Handle<v8::Value> toV8FastForMainWorld(TestCustomAccessors* impl, con
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<V8TestCustomAccessors>(impl);
if (!wrapper.IsEmpty())
return wrapper;
return wrap(impl, container.Holder(), container.GetIsolate());
« no previous file with comments | « Source/bindings/tests/results/V8TestActiveDOMObject.cpp ('k') | Source/bindings/tests/results/V8TestCustomAccessors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698