summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/ScriptState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/ScriptState.cpp')
-rw-r--r--WebCore/bindings/v8/ScriptState.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/WebCore/bindings/v8/ScriptState.cpp b/WebCore/bindings/v8/ScriptState.cpp
index b9e240c..99557b5 100644
--- a/WebCore/bindings/v8/ScriptState.cpp
+++ b/WebCore/bindings/v8/ScriptState.cpp
@@ -42,9 +42,22 @@ namespace WebCore {
ScriptState::ScriptState(Frame* frame)
: m_frame(frame)
+ , m_context(v8::Persistent<v8::Context>::New(V8Proxy::mainWorldContext(frame)))
{
}
+ScriptState::ScriptState(Frame* frame, v8::Handle<v8::Context> context)
+ : m_frame(frame)
+ , m_context(v8::Persistent<v8::Context>::New(context))
+{
+}
+
+ScriptState::~ScriptState()
+{
+ m_context.Dispose();
+ m_context.Clear();
+}
+
ScriptState* scriptStateFromNode(Node* node)
{
// This should be never reached with V8 bindings (WebKit only uses it
@@ -55,7 +68,9 @@ ScriptState* scriptStateFromNode(Node* node)
ScriptState* scriptStateFromPage(Page* page)
{
- return page->mainFrame()->script()->state();
+ // This should be never reached with V8 bindings.
+ ASSERT_NOT_REACHED();
+ return 0;
}
}