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

Unified Diff: Source/bindings/core/v8/DOMWrapperMap.h

Issue 456683002: bindings: Introduces type-check for the internal pointers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Finally fixed hidden misconversions to internal pointers. 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/core/v8/DOMWrapperMap.h
diff --git a/Source/bindings/core/v8/DOMWrapperMap.h b/Source/bindings/core/v8/DOMWrapperMap.h
index 2b6e10b8ada260d241d9df0200876c463b3d41fa..5f78ba9d01380848150777b673dfdba10f3dcd75 100644
--- a/Source/bindings/core/v8/DOMWrapperMap.h
+++ b/Source/bindings/core/v8/DOMWrapperMap.h
@@ -70,7 +70,7 @@ public:
void set(KeyType* key, v8::Handle<v8::Object> wrapper, const WrapperConfiguration& configuration)
{
- ASSERT(static_cast<KeyType*>(toNative(wrapper)) == key);
+ ASSERT(reinterpret_cast<KeyType*>(toInternalPointer(wrapper)) == key);
RELEASE_ASSERT(!containsKey(key)); // See crbug.com/368095
v8::UniquePersistent<v8::Object> unique(m_isolate, wrapper);
configuration.configureWrapper(&unique);
@@ -142,7 +142,7 @@ private:
static KeyType* KeyFromWeakCallbackData(
const v8::WeakCallbackData<v8::Object, WeakCallbackDataType>& data)
{
- return static_cast<KeyType*>(toNative(data.GetValue()));
+ return reinterpret_cast<KeyType*>(toInternalPointer(data.GetValue()));
}
// Dispose traits:

Powered by Google App Engine
This is Rietveld 408576698