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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceGarbageCollected.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/V8TestInterfaceGarbageCollected.h
diff --git a/Source/bindings/tests/results/V8TestInterfaceGarbageCollected.h b/Source/bindings/tests/results/V8TestInterfaceGarbageCollected.h
index fd98cc2dec4e89cebaf0e79b1548eacbc564fd60..144f733115e6e4945dc5e00e2e10198ec61a3ff6 100644
--- a/Source/bindings/tests/results/V8TestInterfaceGarbageCollected.h
+++ b/Source/bindings/tests/results/V8TestInterfaceGarbageCollected.h
@@ -7,6 +7,7 @@
#ifndef V8TestInterfaceGarbageCollected_h
#define V8TestInterfaceGarbageCollected_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"
@@ -23,24 +24,24 @@ public:
static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
static TestInterfaceGarbageCollected* toNative(v8::Handle<v8::Object> object)
{
- return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+ return fromInternalPointer(blink::toInternalPointer(object));
}
static TestInterfaceGarbageCollected* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
static const WrapperTypeInfo wrapperTypeInfo;
- static void derefObject(void*);
+ static void derefObject(ScriptWrappableBase* internalPointer);
static EventTarget* toEventTarget(v8::Handle<v8::Object>);
static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCount + 0;
static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + 1;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1 + 1;
- static inline void* toInternalPointer(TestInterfaceGarbageCollected* impl)
+ static inline ScriptWrappableBase* toInternalPointer(TestInterfaceGarbageCollected* impl)
{
return V8EventTarget::toInternalPointer(impl);
}
- static inline TestInterfaceGarbageCollected* fromInternalPointer(void* object)
+ static inline TestInterfaceGarbageCollected* fromInternalPointer(ScriptWrappableBase* internalPointer)
{
- return static_cast<TestInterfaceGarbageCollected*>(V8EventTarget::fromInternalPointer(object));
+ return static_cast<TestInterfaceGarbageCollected*>(V8EventTarget::fromInternalPointer(internalPointer));
}
static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceGarbageCollected*, v8::Isolate*) { }
static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }

Powered by Google App Engine
This is Rietveld 408576698