Index: Source/bindings/core/v8/ScriptWrappable.h |
diff --git a/Source/bindings/core/v8/ScriptWrappable.h b/Source/bindings/core/v8/ScriptWrappable.h |
index 3e9c59da767b8a940eb82bab891aabdbe612ef60..ecd07a494f3c84b465463c430613bd06655cc475 100644 |
--- a/Source/bindings/core/v8/ScriptWrappable.h |
+++ b/Source/bindings/core/v8/ScriptWrappable.h |
@@ -85,7 +85,7 @@ public: |
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(toScriptWrappable(wrapper) == this); |
m_wrapper.Reset(isolate, wrapper); |
wrapperTypeInfo->configureWrapper(&m_wrapper); |
- m_wrapper.SetWeak(this, &setWeakCallback); |
+ m_wrapper.SetPhantom(&setWeakCallback, v8DOMWrapperTypeIndex, v8DOMWrapperObjectIndex); |
ASSERT(containsWrapper()); |
} |
@@ -159,21 +159,15 @@ protected: |
// already broken), we must not hit the RELEASE_ASSERT. |
private: |
- void disposeWrapper(v8::Local<v8::Object> wrapper) |
+ static void setWeakCallback(const v8::InternalFieldsCallbackData<WrapperTypeInfo, ScriptWrappable>& data) |
haraken
2014/12/15 15:49:37
setWeakCallback => wealCallback?
It is not settin
|
{ |
- ASSERT(containsWrapper()); |
- ASSERT(wrapper == m_wrapper); |
- m_wrapper.Reset(); |
- } |
- |
- static void setWeakCallback(const v8::WeakCallbackData<v8::Object, ScriptWrappable>& data) |
- { |
- data.GetParameter()->disposeWrapper(data.GetValue()); |
- |
// FIXME: I noticed that 50%~ of minor GC cycle times can be consumed |
// inside data.GetParameter()->deref(), which causes Node destructions. We should |
// make Node destructions incremental. |
- releaseObject(data.GetValue()); |
+ WrapperTypeInfo* wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalField1()); |
+ ScriptWrappable* scriptWrappable = reinterpret_cast<ScriptWrappable*>(data.GetInternalField2()); |
+ scriptWrappable->m_wrapper.Empty(); |
haraken
2014/12/15 15:49:37
Shall we rename Empty to Reset or Clear, for consi
|
+ wrapperTypeInfo->derefObject(scriptWrappable); |
} |
v8::Persistent<v8::Object> m_wrapper; |