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

Unified Diff: sky/engine/bindings/core/v8/WrapperTypeInfo.h

Issue 683593002: Remove GarbageCollected support from the bindings (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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: sky/engine/bindings/core/v8/WrapperTypeInfo.h
diff --git a/sky/engine/bindings/core/v8/WrapperTypeInfo.h b/sky/engine/bindings/core/v8/WrapperTypeInfo.h
index b1ca7b6847717d81a581ebb2853e83eb830b8fe1..32d499b84933eef9d49ee8a9917d78bde662d340 100644
--- a/sky/engine/bindings/core/v8/WrapperTypeInfo.h
+++ b/sky/engine/bindings/core/v8/WrapperTypeInfo.h
@@ -52,7 +52,6 @@ static const int v8PrototypeInternalFieldcount = 1;
typedef v8::Handle<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*);
typedef void (*RefObjectFunction)(ScriptWrappableBase* internalPointer);
typedef void (*DerefObjectFunction)(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*);
@@ -83,12 +82,6 @@ struct WrapperTypeInfo {
Independent,
};
- enum GCType {
- GarbageCollectedObject,
- WillBeGarbageCollectedObject,
- RefCountedObject,
- };
-
static const WrapperTypeInfo* unwrap(v8::Handle<v8::Value> typeInfoWrapper)
{
return reinterpret_cast<const WrapperTypeInfo*>(v8::External::Cast(*typeInfoWrapper)->Value());
@@ -134,12 +127,6 @@ struct WrapperTypeInfo {
derefObjectFunction(internalPointer);
}
- WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer) const
- {
- ASSERT(createPersistentHandleFunction);
- return createPersistentHandleFunction(internalPointer);
- }
-
void installConditionallyEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate) const
{
if (installConditionallyEnabledMethodsFunction)
@@ -180,7 +167,6 @@ struct WrapperTypeInfo {
const DomTemplateFunction domTemplateFunction;
const RefObjectFunction refObjectFunction;
const DerefObjectFunction derefObjectFunction;
- const CreatePersistentHandleFunction createPersistentHandleFunction;
const ToActiveDOMObjectFunction toActiveDOMObjectFunction;
const ToEventTargetFunction toEventTargetFunction;
const ResolveWrapperReachabilityFunction visitDOMWrapperFunction;
@@ -190,7 +176,6 @@ struct WrapperTypeInfo {
const WrapperTypePrototype wrapperTypePrototype;
const WrapperClassId wrapperClassId;
const Lifetime lifetime;
- const GCType gcType;
};
COMPILE_ASSERT(offsetof(struct WrapperTypeInfo, ginEmbedder) == offsetof(struct gin::WrapperInfo, embedder), wrapper_type_info_compatible_to_gin);
@@ -226,34 +211,11 @@ inline const WrapperTypeInfo* toWrapperTypeInfo(v8::Handle<v8::Object> wrapper)
return getInternalField<WrapperTypeInfo, v8DOMWrapperTypeIndex>(wrapper);
}
-inline const WrapperPersistentNode* toPersistentHandle(const v8::Handle<v8::Object>& wrapper)
-{
- // Persistent handle is stored in the last internal field.
- 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 WrapperPersistentNode* handle = toPersistentHandle(wrapper);
- // This will be null iff a wrapper for a hidden wrapper object,
- // see V8DOMWrapper::setNativeInfoForHiddenWrapper().
- delete handle;
- } else if (typeInfo->gcType == WrapperTypeInfo::WillBeGarbageCollectedObject) {
-#if ENABLE(OILPAN)
- const WrapperPersistentNode* handle = toPersistentHandle(wrapper);
- // This will be null iff a wrapper for a hidden wrapper object,
- // see V8DOMWrapper::setNativeInfoForHiddenWrapper().
- delete handle;
-#else
- ASSERT(typeInfo->derefObjectFunction);
- typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper));
-#endif
- } else {
- ASSERT(typeInfo->derefObjectFunction);
- typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper));
- }
+ ASSERT(typeInfo->derefObjectFunction);
+ typeInfo->derefObjectFunction(toScriptWrappableBase(wrapper));
}
} // namespace blink
« no previous file with comments | « sky/engine/bindings/core/v8/V8DOMWrapper.h ('k') | sky/engine/bindings/core/v8/custom/V8ArrayBufferCustom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698