Index: Source/WebCore/bindings/v8/V8Proxy.h |
=================================================================== |
--- Source/WebCore/bindings/v8/V8Proxy.h (revision 89246) |
+++ Source/WebCore/bindings/v8/V8Proxy.h (working copy) |
@@ -416,10 +416,18 @@ |
return v8::Undefined(); |
} |
- template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder) |
+ enum IndependentMode { |
+ MarkIndependent, |
+ DoNotMarkIndependent |
+ }; |
+ |
+ template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder, IndependentMode independent = DoNotMarkIndependent) |
{ |
object->ref(); |
- V8DOMWrapper::setJSWrapperForDOMObject(object.get(), v8::Persistent<v8::Object>::New(holder)); |
+ v8::Persistent<v8::Object> handle = v8::Persistent<v8::Object>::New(holder); |
+ if (independent == MarkIndependent) |
+ handle.MarkIndependent(); |
+ V8DOMWrapper::setJSWrapperForDOMObject(object.get(), handle); |
return holder; |
} |