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

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

Issue 456683002: bindings: Introduces type-check for the internal pointers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 4 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/V8TestInterface3.h
diff --git a/Source/bindings/tests/results/V8TestInterface3.h b/Source/bindings/tests/results/V8TestInterface3.h
index 456b4cf54e02a4469f5f2b2b52c18ad8de5e9120..a19ced958aaafd02bd7737cc6e92fc97ee0a7e88 100644
--- a/Source/bindings/tests/results/V8TestInterface3.h
+++ b/Source/bindings/tests/results/V8TestInterface3.h
@@ -7,6 +7,7 @@
#ifndef V8TestInterface3_h
#define V8TestInterface3_h
+#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8DOMWrapper.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
@@ -22,12 +23,12 @@ public:
static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
static TestInterface3* toNative(v8::Handle<v8::Object> object)
{
- return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+ return fromInternalPointer(blink::toInternalPointer(object));
}
static TestInterface3* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
static const WrapperTypeInfo wrapperTypeInfo;
- static void derefObject(void*);
- static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
+ static void derefObject(ScriptWrappableBase* internalPointer);
+ static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>&, v8::Isolate*);
static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&);
static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean>&);
@@ -37,14 +38,14 @@ public:
static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean>&);
static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
- static inline void* toInternalPointer(TestInterface3* impl)
+ static inline ScriptWrappableBase* toInternalPointer(TestInterface3* impl)
{
- return impl;
+ return reinterpret_cast<ScriptWrappableBase*>(static_cast<void*>(impl));
}
- static inline TestInterface3* fromInternalPointer(void* object)
+ static inline TestInterface3* fromInternalPointer(ScriptWrappableBase* internalPointer)
{
- return static_cast<TestInterface3*>(object);
+ return reinterpret_cast<TestInterface3*>(static_cast<void*>(internalPointer));
}
static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterface3*, v8::Isolate*) { }
static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface2.cpp ('k') | Source/bindings/tests/results/V8TestInterface3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698