Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp |
index 81c24eb0711183bd03fff278169c039b4af53845..3534a4ebfb5d2b1cd83854203e91f08945483b90 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.cpp |
@@ -16,37 +16,10 @@ struct SameSizeAsScriptWrappable { |
static_assert(sizeof(ScriptWrappable) <= sizeof(SameSizeAsScriptWrappable), "ScriptWrappable should stay small"); |
-namespace { |
- |
-class ScriptWrappableProtector final { |
- WTF_MAKE_NONCOPYABLE(ScriptWrappableProtector); |
-public: |
- ScriptWrappableProtector(ScriptWrappable* scriptWrappable, const WrapperTypeInfo* wrapperTypeInfo) |
- : m_scriptWrappable(scriptWrappable), m_wrapperTypeInfo(wrapperTypeInfo) |
- { |
- m_wrapperTypeInfo->refObject(m_scriptWrappable); |
- } |
- ~ScriptWrappableProtector() |
- { |
- m_wrapperTypeInfo->derefObject(m_scriptWrappable); |
- } |
- |
-private: |
- ScriptWrappable* m_scriptWrappable; |
- const WrapperTypeInfo* m_wrapperTypeInfo; |
-}; |
- |
-} // namespace |
- |
v8::Local<v8::Object> ScriptWrappable::wrap(v8::Isolate* isolate, v8::Local<v8::Object> creationContext) |
{ |
const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo(); |
- // It's possible that no one except for the new wrapper owns this object at |
- // this moment, so we have to prevent GC to collect this object until the |
- // object gets associated with the wrapper. |
- ScriptWrappableProtector protect(this, wrapperTypeInfo); |
- |
ASSERT(!DOMDataStore::containsWrapper(this, isolate)); |
v8::Local<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creationContext, wrapperTypeInfo, this); |