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

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

Issue 556823003: Revert "Revert of [oilpan]: optimize the way we allocate persistent handles in wrappers. (patchset … (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review feedback 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/V8DOMWrapper.h ('k') | Source/bindings/core/v8/custom/V8ArrayBufferCustom.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/WrapperTypeInfo.h
diff --git a/Source/bindings/core/v8/WrapperTypeInfo.h b/Source/bindings/core/v8/WrapperTypeInfo.h
index fa640e0d800d32f94fa15ba1686df9a9ce5dae78..cd921f08fb7e23d0c9a30ea219e4ee6aefe8b20b 100644
--- a/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -52,7 +52,7 @@ static const int v8PrototypeInternalFieldcount = 1;
typedef v8::Handle<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*);
typedef void (*RefObjectFunction)(ScriptWrappableBase* internalPointer);
typedef void (*DerefObjectFunction)(ScriptWrappableBase* internalPointer);
-typedef PersistentNode* (*CreatePersistentHandleFunction)(ScriptWrappableBase* internalPointer);
+typedef WrapperPersistentNode* (*CreatePersistentHandleFunction)(ScriptWrappableBase* internalPointer);
typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
typedef EventTarget* (*ToEventTargetFunction)(v8::Handle<v8::Object>);
typedef void (*ResolveWrapperReachabilityFunction)(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>&, v8::Isolate*);
@@ -128,7 +128,7 @@ struct WrapperTypeInfo {
refObjectFunction(internalPointer);
}
- PersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer) const
+ WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer) const
{
ASSERT(createPersistentHandleFunction);
return createPersistentHandleFunction(internalPointer);
@@ -220,26 +220,26 @@ inline const WrapperTypeInfo* toWrapperTypeInfo(v8::Handle<v8::Object> wrapper)
return getInternalField<WrapperTypeInfo, v8DOMWrapperTypeIndex>(wrapper);
}
-inline const PersistentNode* toPersistentHandle(const v8::Handle<v8::Object>& wrapper)
+inline const WrapperPersistentNode* toPersistentHandle(const v8::Handle<v8::Object>& wrapper)
{
// Persistent handle is stored in the last internal field.
- return static_cast<PersistentNode*>(wrapper->GetAlignedPointerFromInternalField(wrapper->InternalFieldCount() - 1));
+ return static_cast<WrapperPersistentNode*>(wrapper->GetAlignedPointerFromInternalField(wrapper->InternalFieldCount() - 1));
}
inline void releaseObject(v8::Handle<v8::Object> wrapper)
{
const WrapperTypeInfo* typeInfo = toWrapperTypeInfo(wrapper);
if (typeInfo->gcType == WrapperTypeInfo::GarbageCollectedObject) {
- const PersistentNode* handle = toPersistentHandle(wrapper);
+ const WrapperPersistentNode* handle = toPersistentHandle(wrapper);
// This will be null iff a wrapper for a hidden wrapper object,
// see V8DOMWrapper::setNativeInfoForHiddenWrapper().
- delete handle;
+ WrapperPersistentNode::destroy(handle);
} else if (typeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject) {
#if ENABLE(OILPAN)
- const PersistentNode* handle = toPersistentHandle(wrapper);
+ const WrapperPersistentNode* handle = toPersistentHandle(wrapper);
// This will be null iff a wrapper for a hidden wrapper object,
// see V8DOMWrapper::setNativeInfoForHiddenWrapper().
- delete handle;
+ WrapperPersistentNode::destroy(handle);
#else
ASSERT(typeInfo->derefObjectFunction);
typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper));
« no previous file with comments | « Source/bindings/core/v8/V8DOMWrapper.h ('k') | Source/bindings/core/v8/custom/V8ArrayBufferCustom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698