diff options
Diffstat (limited to 'WebCore/bindings/js/ScriptWrappable.h')
-rw-r--r-- | WebCore/bindings/js/ScriptWrappable.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/WebCore/bindings/js/ScriptWrappable.h b/WebCore/bindings/js/ScriptWrappable.h index d70cab7..5e99c1c 100644 --- a/WebCore/bindings/js/ScriptWrappable.h +++ b/WebCore/bindings/js/ScriptWrappable.h @@ -31,11 +31,33 @@ #ifndef ScriptWrappable_h #define ScriptWrappable_h +#include "JSDOMWrapper.h" +#include <runtime/WeakGCPtr.h> + namespace WebCore { class ScriptWrappable { public: - ScriptWrappable() { } + ScriptWrappable() : m_wrapper(0) { } + + DOMObject* wrapper() const + { + return m_wrapper.get(); + } + + void setWrapper(DOMObject* wrapper) + { + ASSERT(wrapper); + m_wrapper = wrapper; + } + + void clearWrapper(DOMObject* wrapper) + { + m_wrapper.clear(wrapper); + } + +private: + JSC::WeakGCPtr<DOMObject> m_wrapper; }; } // namespace WebCore |