[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
yurys at chromium.org
yurys at chromium.org
Tue Jan 5 23:39:46 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit f848565856c3baa04ca359d9fd70c34e8fccefba
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 1 16:17:42 2009 +0000
2009-12-01 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Adam Barth.
Provide a way to get ScriptState for the inspected page.
https://bugs.webkit.org/show_bug.cgi?id=32020
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::mainWorldScriptState):
* bindings/v8/ScriptController.h:
* bindings/v8/ScriptState.cpp:
(WebCore::scriptStateFromPage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51538 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 243c1e7..549257b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-01 Yury Semikhatsky <yurys at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Provide a way to get ScriptState for the inspected page.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32020
+
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::mainWorldScriptState):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/ScriptState.cpp:
+ (WebCore::scriptStateFromPage):
+
2009-12-01 Chris Marrin <cmarrin at apple.com>
Reviewed by Adam Roben.
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index dd27dc9..d8926f8 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 "V8NPObject.h"
@@ -354,6 +355,13 @@ void ScriptController::getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
worlds.append(mainThreadNormalWorld());
}
+ScriptState* ScriptController::mainWorldScriptState()
+{
+ if (!m_mainWorldScriptState)
+ m_mainWorldScriptState.set(new ScriptState(m_frame, V8Proxy::mainWorldContext(m_frame)));
+ return m_mainWorldScriptState.get();
+}
+
static NPObject* createNoScriptObject()
{
notImplemented();
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index aa0e467..fb7bbee 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -48,6 +48,7 @@ namespace WebCore {
class Frame;
class HTMLPlugInElement;
class ScriptSourceCode;
+ class ScriptState;
class String;
class Widget;
class XSSAuditor;
@@ -170,6 +171,9 @@ namespace WebCore {
void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*) { }
static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
+ // Script state for the main world context.
+ ScriptState* mainWorldScriptState();
+
private:
Frame* m_frame;
const String* m_sourceURL;
@@ -192,6 +196,9 @@ namespace WebCore {
#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/ScriptState.cpp b/WebCore/bindings/v8/ScriptState.cpp
index 0b5cd08..5854ce9 100644
--- a/WebCore/bindings/v8/ScriptState.cpp
+++ b/WebCore/bindings/v8/ScriptState.cpp
@@ -68,9 +68,8 @@ ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node* node)
ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page* page)
{
- // This should be never reached with V8 bindings.
- ASSERT_NOT_REACHED();
- return 0;
+ // This should be only reached with V8 bindings from single process layout tests.
+ return page->mainFrame()->script()->mainWorldScriptState();
}
// FIXME: Stub method so we compile. Currently called from FrameLoader.cpp.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list