[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

dglazkov at chromium.org dglazkov at chromium.org
Thu Feb 4 21:31:24 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit ae94e32309fd259bb0fd2c006212ab06856eceff
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 28 21:44:24 2010 +0000

    2010-01-28  Dimitri Glazkov  <dglazkov at chromium.org>
    
            No review, rolling out r54012.
            http://trac.webkit.org/changeset/54012
            https://bugs.webkit.org/show_bug.cgi?id=34266
    
            Introduced 33 crashes in V8 traversal/ tests.
    
            * bindings/js/ScriptController.cpp:
            (WebCore::ScriptController::mainWorldScriptState):
            * bindings/js/ScriptController.h:
            * bindings/js/ScriptState.cpp:
            * bindings/js/ScriptState.h:
            * bindings/v8/ScriptCallStack.cpp:
            (WebCore::ScriptCallStack::ScriptCallStack):
            * bindings/v8/ScriptController.cpp:
            (WebCore::ScriptController::mainWorldScriptState):
            (WebCore::ScriptController::currentScriptState):
            (WebCore::ScriptController::clearWindowShell):
            * bindings/v8/ScriptController.h:
            * bindings/v8/ScriptScope.cpp:
            (WebCore::ScriptScope::ScriptScope):
            (WebCore::ScriptScope::success):
            * bindings/v8/ScriptScope.h:
            * bindings/v8/ScriptState.cpp:
            (WebCore::ScriptState::ScriptState):
            (WebCore::scriptStateFromPage):
            * bindings/v8/ScriptState.h:
            (WebCore::ScriptState::ScriptState):
            (WebCore::ScriptState::frame):
            * bindings/v8/V8HiddenPropertyName.h:
            * bindings/v8/V8IsolatedContext.cpp:
            (WebCore::V8IsolatedContext::scriptState):
            * bindings/v8/V8IsolatedContext.h:
            * bindings/v8/V8Utilities.cpp:
            (WebCore::getScriptExecutionContext):
            (WebCore::reportException):
            * bindings/v8/custom/V8NodeIteratorCustom.cpp:
            (WebCore::V8NodeIterator::nextNodeCallback):
            (WebCore::V8NodeIterator::previousNodeCallback):
            * bindings/v8/custom/V8TreeWalkerCustom.cpp:
            (WebCore::V8TreeWalker::parentNodeCallback):
            (WebCore::V8TreeWalker::firstChildCallback):
            (WebCore::V8TreeWalker::lastChildCallback):
            (WebCore::V8TreeWalker::nextNodeCallback):
            (WebCore::V8TreeWalker::previousNodeCallback):
            (WebCore::V8TreeWalker::nextSiblingCallback):
            (WebCore::V8TreeWalker::previousSiblingCallback):
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::injectedScriptForNodeId):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54016 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1c1c18c..e01fbdb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,54 @@
+2010-01-28  Dimitri Glazkov  <dglazkov at chromium.org>
+
+        No review, rolling out r54012.
+        http://trac.webkit.org/changeset/54012
+        https://bugs.webkit.org/show_bug.cgi?id=34266
+
+        Introduced 33 crashes in V8 traversal/ tests.
+
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::mainWorldScriptState):
+        * bindings/js/ScriptController.h:
+        * bindings/js/ScriptState.cpp:
+        * bindings/js/ScriptState.h:
+        * bindings/v8/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::ScriptCallStack):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::mainWorldScriptState):
+        (WebCore::ScriptController::currentScriptState):
+        (WebCore::ScriptController::clearWindowShell):
+        * bindings/v8/ScriptController.h:
+        * bindings/v8/ScriptScope.cpp:
+        (WebCore::ScriptScope::ScriptScope):
+        (WebCore::ScriptScope::success):
+        * bindings/v8/ScriptScope.h:
+        * bindings/v8/ScriptState.cpp:
+        (WebCore::ScriptState::ScriptState):
+        (WebCore::scriptStateFromPage):
+        * bindings/v8/ScriptState.h:
+        (WebCore::ScriptState::ScriptState):
+        (WebCore::ScriptState::frame):
+        * bindings/v8/V8HiddenPropertyName.h:
+        * bindings/v8/V8IsolatedContext.cpp:
+        (WebCore::V8IsolatedContext::scriptState):
+        * bindings/v8/V8IsolatedContext.h:
+        * bindings/v8/V8Utilities.cpp:
+        (WebCore::getScriptExecutionContext):
+        (WebCore::reportException):
+        * bindings/v8/custom/V8NodeIteratorCustom.cpp:
+        (WebCore::V8NodeIterator::nextNodeCallback):
+        (WebCore::V8NodeIterator::previousNodeCallback):
+        * bindings/v8/custom/V8TreeWalkerCustom.cpp:
+        (WebCore::V8TreeWalker::parentNodeCallback):
+        (WebCore::V8TreeWalker::firstChildCallback):
+        (WebCore::V8TreeWalker::lastChildCallback):
+        (WebCore::V8TreeWalker::nextNodeCallback):
+        (WebCore::V8TreeWalker::previousNodeCallback):
+        (WebCore::V8TreeWalker::nextSiblingCallback):
+        (WebCore::V8TreeWalker::previousSiblingCallback):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::injectedScriptForNodeId):
+
 2010-01-28  Steve Block  <steveblock at google.com>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 083e931..ab1d3a6 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -380,6 +380,12 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
 
 #endif
 
+ScriptState* ScriptController::mainWorldScriptState()
+{
+    JSDOMWindowShell* shell = windowShell(mainThreadNormalWorld());
+    return shell->window()->globalExec();
+}
+
 JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create JSObjects when JavaScript is disabled
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index f3e5adf..f265ab5 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -24,6 +24,7 @@
 
 #include "JSDOMWindowShell.h"
 #include "ScriptInstance.h"
+#include "ScriptState.h"
 #include <runtime/Protect.h>
 #include <wtf/RefPtr.h>
 
@@ -159,6 +160,8 @@ public:
     
     XSSAuditor* xssAuditor() { return m_XSSAuditor.get(); }
 
+    ScriptState* mainWorldScriptState();
+
 private:
     JSDOMWindowShell* initScript(DOMWrapperWorld* world);
 
diff --git a/WebCore/bindings/js/ScriptState.cpp b/WebCore/bindings/js/ScriptState.cpp
index b9f334a..7a760ae 100644
--- a/WebCore/bindings/js/ScriptState.cpp
+++ b/WebCore/bindings/js/ScriptState.cpp
@@ -38,12 +38,6 @@
 
 namespace WebCore {
 
-ScriptState* mainWorldScriptState(Frame* frame)
-{
-    JSDOMWindowShell* shell = frame->script()->windowShell(mainThreadNormalWorld());
-    return shell->window()->globalExec();
-}
-
 ScriptState* scriptStateFromNode(DOMWrapperWorld* world, Node* node)
 {
     if (!node)
diff --git a/WebCore/bindings/js/ScriptState.h b/WebCore/bindings/js/ScriptState.h
index 0c7c575..6257929 100644
--- a/WebCore/bindings/js/ScriptState.h
+++ b/WebCore/bindings/js/ScriptState.h
@@ -36,7 +36,6 @@
 
 namespace WebCore {
     class DOMWrapperWorld;
-    class Frame;
     class Node;
     class Page;
 
@@ -46,8 +45,6 @@ namespace WebCore {
     // For now, the separation is purely by convention.
     typedef JSC::ExecState ScriptState;
 
-    ScriptState* mainWorldScriptState(Frame*);
-
     ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
     ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
 
diff --git a/WebCore/bindings/v8/ScriptCallStack.cpp b/WebCore/bindings/v8/ScriptCallStack.cpp
index 21063ed..a0eeccb 100644
--- a/WebCore/bindings/v8/ScriptCallStack.cpp
+++ b/WebCore/bindings/v8/ScriptCallStack.cpp
@@ -55,7 +55,7 @@ ScriptCallStack* ScriptCallStack::create(const v8::Arguments& arguments, unsigne
 
 ScriptCallStack::ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber)
     : m_lastCaller(String(), sourceName, sourceLineNumber, arguments, skipArgumentCount)
-    , m_scriptState(ScriptState::current())
+    , m_scriptState(ScriptController::currentScriptState())
 {
 }
 
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 86d54d6..5d3078d 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -47,6 +47,7 @@
 #include "npruntime_priv.h"
 #include "NPV8Object.h"
 #include "ScriptSourceCode.h"
+#include "ScriptState.h"
 #include "Settings.h"
 #include "V8Binding.h"
 #include "V8BindingState.h"
@@ -353,6 +354,24 @@ void ScriptController::getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
     worlds.append(mainThreadNormalWorld());
 }
 
+ScriptState* ScriptController::mainWorldScriptState()
+{
+    if (!m_mainWorldScriptState) {
+        v8::HandleScope handleScope;
+        m_mainWorldScriptState.set(new ScriptState(m_frame, V8Proxy::mainWorldContext(m_frame)));
+    }
+    return m_mainWorldScriptState.get();
+}
+
+ScriptState* ScriptController::currentScriptState()
+{
+    if (V8IsolatedContext* context = V8IsolatedContext::getEntered())
+        return context->scriptState();
+    Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+    ASSERT(frame);
+    return frame->script()->mainWorldScriptState();
+}
+
 static NPObject* createNoScriptObject()
 {
     notImplemented();
@@ -415,6 +434,8 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
 
 void ScriptController::clearWindowShell()
 {
+    m_mainWorldScriptState.clear();
+
     // V8 binding expects ScriptController::clearWindowShell only be called
     // when a frame is loading a new page. V8Proxy::clearForNavigation
     // creates a new context for the new page.
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index b45bdef..ea19d87 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -51,6 +51,7 @@ class Event;
 class Frame;
 class HTMLPlugInElement;
 class ScriptSourceCode;
+class ScriptState;
 class String;
 class Widget;
 class XSSAuditor;
@@ -168,6 +169,12 @@ public:
     void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*) { }
     static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
 
+    // Script state for the main world context.
+    ScriptState* mainWorldScriptState();
+
+    // Returns ScriptState for current context.
+    static ScriptState* currentScriptState();
+
 private:
     Frame* m_frame;
     const String* m_sourceURL;
@@ -190,6 +197,9 @@ private:
 #endif
     // The XSSAuditor associated with this ScriptController.
     OwnPtr<XSSAuditor> m_XSSAuditor;
+
+    // Script state for the main world context.
+    OwnPtr<ScriptState> m_mainWorldScriptState;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptScope.cpp b/WebCore/bindings/v8/ScriptScope.cpp
index a1b13a1..727ab25 100644
--- a/WebCore/bindings/v8/ScriptScope.cpp
+++ b/WebCore/bindings/v8/ScriptScope.cpp
@@ -33,6 +33,10 @@
 
 #include "ScriptState.h"
 
+#include "Document.h"
+#include "Frame.h"
+#include "V8Binding.h"
+
 #include <v8.h>
 
 namespace WebCore {
@@ -41,8 +45,8 @@ ScriptScope::ScriptScope(ScriptState* scriptState, bool reportExceptions)
     : m_context(scriptState->context())
     , m_scope(m_context)
     , m_scriptState(scriptState)
+    , m_reportExceptions(reportExceptions)
 {
-    m_exceptionCatcher.SetVerbose(reportExceptions);
     ASSERT(!m_context.IsEmpty());
 }
 
@@ -50,6 +54,11 @@ bool ScriptScope::success()
 {
     if (!m_exceptionCatcher.HasCaught())
         return true;
+
+    v8::Local<v8::Message> message = m_exceptionCatcher.Message();
+    if (m_reportExceptions)
+        m_scriptState->frame()->document()->reportException(toWebCoreString(message->Get()), message->GetLineNumber(), toWebCoreString(message->GetScriptResourceName()));
+
     m_exceptionCatcher.Reset();
     return false;
 }
diff --git a/WebCore/bindings/v8/ScriptScope.h b/WebCore/bindings/v8/ScriptScope.h
index 3f9a332..6fee458 100644
--- a/WebCore/bindings/v8/ScriptScope.h
+++ b/WebCore/bindings/v8/ScriptScope.h
@@ -49,6 +49,7 @@ namespace WebCore {
         v8::Context::Scope m_scope;
         v8::TryCatch m_exceptionCatcher;
         ScriptState* m_scriptState;
+        bool m_reportExceptions;
     };
 
 }
diff --git a/WebCore/bindings/v8/ScriptState.cpp b/WebCore/bindings/v8/ScriptState.cpp
index b38087c..085fd2b 100644
--- a/WebCore/bindings/v8/ScriptState.cpp
+++ b/WebCore/bindings/v8/ScriptState.cpp
@@ -35,23 +35,22 @@
 #include "Node.h"
 #include "Page.h"
 #include "ScriptController.h"
-#include "V8HiddenPropertyName.h"
 
-#include <v8.h>
 #include <wtf/Assertions.h>
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
-ScriptState::ScriptState(Frame*, v8::Handle<v8::Context> context)
-    : m_context(v8::Persistent<v8::Context>::New(context))
+ScriptState::ScriptState(Frame* frame)
+    : m_frame(frame)
+    , m_context(v8::Persistent<v8::Context>::New(V8Proxy::mainWorldContext(frame)))
 {
 }
 
-ScriptState::ScriptState(v8::Handle<v8::Context> context)
-    : m_context(v8::Persistent<v8::Context>::New(context))
+ScriptState::ScriptState(Frame* frame, v8::Handle<v8::Context> context)
+    : m_frame(frame)
+    , m_context(v8::Persistent<v8::Context>::New(context))
 {
-    m_context.MakeWeak(this, &ScriptState::weakReferenceCallback);
 }
 
 ScriptState::~ScriptState()
@@ -60,55 +59,6 @@ ScriptState::~ScriptState()
     m_context.Clear();
 }
 
-ScriptState* ScriptState::forContext(v8::Local<v8::Context> context)
-{
-    v8::Context::Scope contextScope(context);
-
-    v8::Local<v8::Object> global = context->Global();
-    // Skip proxy object. The proxy object will survive page navigation while we need
-    // an object whose lifetime consides with that of the inspected context.
-    global = v8::Local<v8::Object>::Cast(global->GetPrototype());
-
-    v8::Handle<v8::String> key = V8HiddenPropertyName::scriptState();
-    v8::Local<v8::Value> val = global->GetHiddenValue(key);
-    if (!val.IsEmpty() && val->IsExternal())
-        return static_cast<ScriptState*>(v8::External::Cast(*val)->Value());
-
-    ScriptState* state = new ScriptState(context);
-    global->SetHiddenValue(key, v8::External::New(state));
-    return state;
-}
-
-ScriptState* ScriptState::current()
-{
-    v8::HandleScope handleScope;
-    v8::Local<v8::Context> context = v8::Context::GetCurrent();
-    if (context.IsEmpty()) {
-        ASSERT_NOT_REACHED();
-        return 0;
-    }
-    return ScriptState::forContext(context);
-}
-
-ScriptState* ScriptState::empty()
-{
-    DEFINE_STATIC_LOCAL(ScriptState, emptyState, (v8::Handle<v8::Context>()));
-    return &emptyState;
-}
-
-void ScriptState::weakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter)
-{
-    ScriptState* scriptState = static_cast<ScriptState*>(parameter);
-    delete scriptState;
-}
-
-ScriptState* mainWorldScriptState(Frame* frame)
-{
-    v8::HandleScope handleScope;
-    V8Proxy* proxy = frame->script()->proxy();
-    return ScriptState::forContext(proxy->mainWorldContext());
-}
-
 ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node* node)
 {
     // This should be never reached with V8 bindings (WebKit only uses it
@@ -120,7 +70,7 @@ ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node* node)
 ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page* page)
 {
     // This should be only reached with V8 bindings from single process layout tests.
-    return mainWorldScriptState(page->mainFrame());
+    return page->mainFrame()->script()->mainWorldScriptState();
 }
 
 }
diff --git a/WebCore/bindings/v8/ScriptState.h b/WebCore/bindings/v8/ScriptState.h
index e7eb102..8130092 100644
--- a/WebCore/bindings/v8/ScriptState.h
+++ b/WebCore/bindings/v8/ScriptState.h
@@ -44,10 +44,10 @@ namespace WebCore {
 
     class ScriptState : public Noncopyable {
     public:
-        // FIXME: This destructor will become private shortly.
+        ScriptState() { }
+        ScriptState(Frame* frame);
+        ScriptState(Frame* frame, v8::Handle<v8::Context> context);
         ~ScriptState();
-        // FIXME: This constructor will go away shortly.
-        ScriptState(Frame*, v8::Handle<v8::Context>);
 
         bool hadException() { return !m_exception.IsEmpty(); }
         void setException(v8::Local<v8::Value> exception)
@@ -56,27 +56,18 @@ namespace WebCore {
         }
         v8::Local<v8::Value> exception() { return m_exception; }
 
+        Frame* frame() const { return m_frame; }
         v8::Local<v8::Context> context() const
         {
             return v8::Local<v8::Context>::New(m_context);
         }
 
-        static ScriptState* forContext(v8::Local<v8::Context>);
-        static ScriptState* current();
-        static ScriptState* empty();
-
     private:
-        friend ScriptState* mainWorldScriptState(Frame*);
-        explicit ScriptState(v8::Handle<v8::Context>);
-
-        static void weakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter);
-
         v8::Local<v8::Value> m_exception;
+        Frame* m_frame;
         v8::Persistent<v8::Context> m_context;
     };
 
-    ScriptState* mainWorldScriptState(Frame*);
-
     ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
     ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
 
diff --git a/WebCore/bindings/v8/V8HiddenPropertyName.h b/WebCore/bindings/v8/V8HiddenPropertyName.h
index 0bfadd9..bb1ca4c 100644
--- a/WebCore/bindings/v8/V8HiddenPropertyName.h
+++ b/WebCore/bindings/v8/V8HiddenPropertyName.h
@@ -39,7 +39,6 @@ namespace WebCore {
     V(objectPrototype) \
     V(listener) \
     V(attributeListener) \
-    V(scriptState) \
     V(sleepFunction) \
     V(toStringString)
 
diff --git a/WebCore/bindings/v8/V8IsolatedContext.cpp b/WebCore/bindings/v8/V8IsolatedContext.cpp
index 3237ede..4db1efe 100644
--- a/WebCore/bindings/v8/V8IsolatedContext.cpp
+++ b/WebCore/bindings/v8/V8IsolatedContext.cpp
@@ -89,4 +89,14 @@ V8IsolatedContext::~V8IsolatedContext()
     m_context->disposeHandle();
 }
 
+ScriptState* V8IsolatedContext::scriptState()
+{
+    if (!m_scriptState) {
+        v8::HandleScope scope;
+        v8::Handle<v8::Context> context = m_context.get()->get();
+        m_scriptState.set(new ScriptState(V8Proxy::retrieveFrame(context), context));
+    }
+    return m_scriptState.get();
+}
+
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/V8IsolatedContext.h b/WebCore/bindings/v8/V8IsolatedContext.h
index 70ca270..3844b57 100644
--- a/WebCore/bindings/v8/V8IsolatedContext.h
+++ b/WebCore/bindings/v8/V8IsolatedContext.h
@@ -94,6 +94,8 @@ public:
 
     IsolatedWorld* world() const { return m_world.get(); }
 
+    ScriptState* scriptState();
+
 private:
     static v8::Handle<v8::Object> getGlobalObject(v8::Handle<v8::Context> context)
     {
@@ -109,6 +111,9 @@ private:
     RefPtr<SharedPersistent<v8::Context> > m_context;
 
     RefPtr<IsolatedWorld> m_world;
+
+    // FIXME: get rid of redundant m_context field. The context can be retrieved from the ScriptState.
+    OwnPtr<ScriptState> m_scriptState;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/V8Utilities.cpp b/WebCore/bindings/v8/V8Utilities.cpp
index fb1ecaa..c547cc7 100644
--- a/WebCore/bindings/v8/V8Utilities.cpp
+++ b/WebCore/bindings/v8/V8Utilities.cpp
@@ -134,15 +134,13 @@ ScriptExecutionContext* getScriptExecutionContext(ScriptState* scriptState)
         return proxy->workerContext()->scriptExecutionContext();
 #endif
 
-    Frame* frame;
-    if (scriptState) {
-        v8::HandleScope handleScope;
-        frame = V8Proxy::retrieveFrame(scriptState->context());
-    } else
-        frame = V8Proxy::retrieveFrameForCurrentContext();
-
-    if (frame)
-        return frame->document()->scriptExecutionContext();
+    if (scriptState)
+        return scriptState->frame()->document()->scriptExecutionContext();
+    else {
+        Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+        if (frame)
+            return frame->document()->scriptExecutionContext();
+    }
 
     return 0;
 }
@@ -172,7 +170,7 @@ void reportException(ScriptState* scriptState, v8::TryCatch& exceptionCatcher)
     ScriptExecutionContext* context = getScriptExecutionContext(scriptState);
     // During the frame teardown, there may not be a valid context.
     if (context && !context->isDocument())
-        context->reportException(errorMessage, lineNumber, sourceURL);
+      context->reportException(errorMessage, lineNumber, sourceURL);
     exceptionCatcher.Reset();
 }
 
diff --git a/WebCore/bindings/v8/custom/V8NodeIteratorCustom.cpp b/WebCore/bindings/v8/custom/V8NodeIteratorCustom.cpp
index 89143f1..1c077f7 100644
--- a/WebCore/bindings/v8/custom/V8NodeIteratorCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NodeIteratorCustom.cpp
@@ -63,8 +63,9 @@ v8::Handle<v8::Value> V8NodeIterator::nextNodeCallback(const v8::Arguments& args
     NodeIterator* nodeIterator = V8NodeIterator::toNative(args.Holder());
 
     ExceptionCode ec = 0;
-    RefPtr<Node> result = nodeIterator->nextNode(ScriptState::empty(), ec);
-    return toV8(result.release(), ec, ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = nodeIterator->nextNode(&state, ec);
+    return toV8(result.release(), ec, &state);
 }
 
 v8::Handle<v8::Value> V8NodeIterator::previousNodeCallback(const v8::Arguments& args)
@@ -73,8 +74,9 @@ v8::Handle<v8::Value> V8NodeIterator::previousNodeCallback(const v8::Arguments&
     NodeIterator* nodeIterator = V8NodeIterator::toNative(args.Holder());
 
     ExceptionCode ec = 0;
-    RefPtr<Node> result = nodeIterator->previousNode(ScriptState::empty(), ec);
-    return toV8(result.release(), ec, ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = nodeIterator->previousNode(&state, ec);
+    return toV8(result.release(), ec, &state);
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8TreeWalkerCustom.cpp b/WebCore/bindings/v8/custom/V8TreeWalkerCustom.cpp
index 80182f5..ecf217c 100644
--- a/WebCore/bindings/v8/custom/V8TreeWalkerCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8TreeWalkerCustom.cpp
@@ -60,8 +60,9 @@ v8::Handle<v8::Value> V8TreeWalker::parentNodeCallback(const v8::Arguments& args
     INC_STATS("DOM.TreeWalker.parentNode()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->parentNode(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->parentNode(&state);
+    return toV8(result.release(), &state);
 }
 
 v8::Handle<v8::Value> V8TreeWalker::firstChildCallback(const v8::Arguments& args)
@@ -69,8 +70,9 @@ v8::Handle<v8::Value> V8TreeWalker::firstChildCallback(const v8::Arguments& args
     INC_STATS("DOM.TreeWalker.firstChild()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->firstChild(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->firstChild(&state);
+    return toV8(result.release(), &state);
 }
 
 v8::Handle<v8::Value> V8TreeWalker::lastChildCallback(const v8::Arguments& args)
@@ -78,8 +80,9 @@ v8::Handle<v8::Value> V8TreeWalker::lastChildCallback(const v8::Arguments& args)
     INC_STATS("DOM.TreeWalker.lastChild()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->lastChild(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->lastChild(&state);
+    return toV8(result.release(), &state);
 }
 
 v8::Handle<v8::Value> V8TreeWalker::nextNodeCallback(const v8::Arguments& args)
@@ -87,8 +90,9 @@ v8::Handle<v8::Value> V8TreeWalker::nextNodeCallback(const v8::Arguments& args)
     INC_STATS("DOM.TreeWalker.nextNode()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->nextNode(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->nextNode(&state);
+    return toV8(result.release(), &state);
 }
 
 v8::Handle<v8::Value> V8TreeWalker::previousNodeCallback(const v8::Arguments& args)
@@ -96,8 +100,9 @@ v8::Handle<v8::Value> V8TreeWalker::previousNodeCallback(const v8::Arguments& ar
     INC_STATS("DOM.TreeWalker.previousNode()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->previousNode(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->previousNode(&state);
+    return toV8(result.release(), &state);
 }
 
 v8::Handle<v8::Value> V8TreeWalker::nextSiblingCallback(const v8::Arguments& args)
@@ -105,8 +110,9 @@ v8::Handle<v8::Value> V8TreeWalker::nextSiblingCallback(const v8::Arguments& arg
     INC_STATS("DOM.TreeWalker.nextSibling()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->nextSibling(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->nextSibling(&state);
+    return toV8(result.release(), &state);
 }
 
 v8::Handle<v8::Value> V8TreeWalker::previousSiblingCallback(const v8::Arguments& args)
@@ -114,8 +120,9 @@ v8::Handle<v8::Value> V8TreeWalker::previousSiblingCallback(const v8::Arguments&
     INC_STATS("DOM.TreeWalker.previousSibling()");
     TreeWalker* treeWalker = V8TreeWalker::toNative(args.Holder());
 
-    RefPtr<Node> result = treeWalker->previousSibling(ScriptState::empty());
-    return toV8(result.release(), ScriptState::empty());
+    ScriptState state;
+    RefPtr<Node> result = treeWalker->previousSibling(&state);
+    return toV8(result.release(), &state);
 }
 
 } // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 5ab1354..0c947f7 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -1845,7 +1845,7 @@ ScriptObject InspectorController::injectedScriptForNodeId(long id)
         frame = m_inspectedPage->mainFrame();
 
     if (frame)
-        return m_injectedScriptHost->injectedScriptFor(mainWorldScriptState(frame));
+        return m_injectedScriptHost->injectedScriptFor(frame->script()->mainWorldScriptState());
 
     return ScriptObject();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list