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/ScriptWrappable.h

Issue 537403002: bindings: Renames from/toInternalPointer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 3 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
« no previous file with comments | « Source/bindings/core/v8/ScriptProfiler.cpp ('k') | Source/bindings/core/v8/ScriptWrappable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptWrappable.h
diff --git a/Source/bindings/core/v8/ScriptWrappable.h b/Source/bindings/core/v8/ScriptWrappable.h
index 60216284c1e71313c08b82c8b30ed0e9b01854d0..b3b1b9e601dfab79f1d413c29ef8eb6d342f5314 100644
--- a/Source/bindings/core/v8/ScriptWrappable.h
+++ b/Source/bindings/core/v8/ScriptWrappable.h
@@ -78,18 +78,18 @@ __declspec(align(4))
class ScriptWrappableBase {
public:
template<typename T>
- static T* fromInternalPointer(ScriptWrappableBase* internalPointer)
+ T* toImpl()
{
// Check if T* is castable to ScriptWrappableBase*, which means T
// doesn't have two or more ScriptWrappableBase as superclasses.
// If T has two ScriptWrappableBase as superclasses, conversions
// from T* to ScriptWrappableBase* are ambiguous.
- ASSERT(static_cast<ScriptWrappableBase*>(static_cast<T*>(internalPointer)));
+ ASSERT(static_cast<ScriptWrappableBase*>(static_cast<T*>(this)));
// The internal pointers must be aligned to at least 4 byte alignment.
- ASSERT((reinterpret_cast<intptr_t>(internalPointer) & 0x3) == 0);
- return static_cast<T*>(internalPointer);
+ ASSERT((reinterpret_cast<intptr_t>(this) & 0x3) == 0);
+ return static_cast<T*>(this);
}
- ScriptWrappableBase* toInternalPointer()
+ ScriptWrappableBase* toScriptWrappableBase()
{
// The internal pointers must be aligned to at least 4 byte alignment.
ASSERT((reinterpret_cast<intptr_t>(this) & 0x3) == 0);
@@ -99,7 +99,7 @@ public:
void assertWrapperSanity(v8::Local<v8::Object> object)
{
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(object.IsEmpty()
- || object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == toInternalPointer());
+ || object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == toScriptWrappableBase());
}
};
@@ -250,7 +250,7 @@ public:
{
ASSERT(objectAsT);
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(object.IsEmpty()
- || object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == V8T::toInternalPointer(objectAsT));
+ || object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == V8T::toScriptWrappableBase(objectAsT));
}
template<typename V8T, typename T>
@@ -266,7 +266,7 @@ public:
ASSERT(objectAsT);
v8::Object* value = object->getRawValue();
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(value == 0
- || value->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == V8T::toInternalPointer(objectAsT));
+ || value->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == V8T::toScriptWrappableBase(objectAsT));
}
using ScriptWrappableBase::assertWrapperSanity;
« no previous file with comments | « Source/bindings/core/v8/ScriptProfiler.cpp ('k') | Source/bindings/core/v8/ScriptWrappable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698