[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
jberlin at webkit.org
jberlin at webkit.org
Wed Dec 22 13:08:10 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 82fe6953c2e7d68fa860a6785fbeec263c409950
Author: jberlin at webkit.org <jberlin at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 7 18:09:31 2010 +0000
2010-09-07 Jessie Berlin <jberlin at apple.com>
Reviewed by Darin Adler.
Indicate which one of the ScriptWorlds for a Frame the Window Object has been cleared for
https://bugs.webkit.org/show_bug.cgi?id=45217
WebKit2:
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
WebKitTools:
Make WebKitTestRunner work with this change.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didClearWindowForFrame):
Make sure the ScriptWorld here is the normal world, since that is no longer being done in
WebFrameLoaderClient.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 28957b0..2e30e8c 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-07 Jessie Berlin <jberlin at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Indicate which one of the ScriptWorlds for a Frame the Window Object has been cleared for
+ https://bugs.webkit.org/show_bug.cgi?id=45217
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+
+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
+ (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+
2010-09-06 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index ea43049..b723474 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -57,7 +57,7 @@ typedef void (*WKBundlePageDidDocumentFinishLoadForFrameCallback)(WKBundlePageRe
typedef void (*WKBundlePageDidFinishLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
typedef void (*WKBundlePageDidFailLoadWithErrorForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo); // FIXME: Add WKErrorRef.
typedef void (*WKBundlePageDidReceiveTitleForFrameCallback)(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo);
-typedef void (*WKBundlePageDidClearWindowObjectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window, const void *clientInfo);
+typedef void (*WKBundlePageDidClearWindowObjectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo);
typedef void (*WKBundlePageDidCancelClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
typedef void (*WKBundlePageWillPerformClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date, const void *clientInfo);
typedef void (*WKBundlePageDidChangeLocationWithinPageForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
index 237499c..8ddf9bb 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
@@ -25,6 +25,7 @@
#include "InjectedBundlePageLoaderClient.h"
+#include "InjectedBundleScriptWorld.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
#include <wtf/text/WTFString.h>
@@ -94,10 +95,10 @@ void InjectedBundlePageLoaderClient::didReceiveTitleForFrame(WebPage* page, cons
m_client.didReceiveTitleForFrame(toRef(page), toRef(title.impl()), toRef(frame), m_client.clientInfo);
}
-void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, JSGlobalContextRef context, JSObjectRef window)
+void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld* world)
{
if (m_client.didClearWindowObjectForFrame)
- m_client.didClearWindowObjectForFrame(toRef(page), toRef(frame), context, window, m_client.clientInfo);
+ m_client.didClearWindowObjectForFrame(toRef(page), toRef(frame), toRef(InjectedBundleScriptWorld::getOrCreate(world).get()), m_client.clientInfo);
}
void InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame(WebPage* page, WebFrame* frame)
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
index 00c7fc6..0f547c5 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
@@ -30,6 +30,10 @@
#include <JavaScriptCore/JSBase.h>
#include <wtf/Forward.h>
+namespace WebCore {
+class DOMWrapperWorld;
+}
+
namespace WebKit {
class WebPage;
@@ -48,7 +52,7 @@ public:
void didFinishLoadForFrame(WebPage*, WebFrame*);
void didFailLoadWithErrorForFrame(WebPage*, WebFrame*);
void didReceiveTitleForFrame(WebPage*, const WTF::String&, WebFrame*);
- void didClearWindowObjectForFrame(WebPage*, WebFrame*, JSGlobalContextRef, JSObjectRef);
+ void didClearWindowObjectForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld*);
void didCancelClientRedirectForFrame(WebPage*, WebFrame*);
void willPerformClientRedirectForFrame(WebPage*, WebFrame*, const WTF::String& url, double delay, double date);
void didChangeLocationWithinPageForFrame(WebPage*, WebFrame*);
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 55793aa..e4f611f 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -994,15 +994,7 @@ void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*
if (!webPage)
return;
- if (world != mainThreadNormalWorld())
- return;
-
- // FIXME: Is there a way to get this and know that it's a JSGlobalContextRef?
- // The const_cast here is a bit ugly.
- JSGlobalContextRef context = const_cast<JSGlobalContextRef>(toRef(m_frame->coreFrame()->script()->globalObject(world)->globalExec()));
- JSObjectRef windowObject = toRef(m_frame->coreFrame()->script()->globalObject(world));
-
- webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, context, windowObject);
+ webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);
}
void WebFrameLoaderClient::documentElementAvailable()
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index eea96c8..eba5a70 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-07 Jessie Berlin <jberlin at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Indicate which one of the ScriptWorlds for a Frame the Window Object has been cleared for
+ https://bugs.webkit.org/show_bug.cgi?id=45217
+
+ Make WebKitTestRunner work with this change.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ Make sure the ScriptWorld here is the normal world, since that is no longer being done in
+ WebFrameLoaderClient.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
2010-09-07 Philippe Normand <pnormand at igalia.com>
Unreviewed, build fix.
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index c7f9a84..bf7a029 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -35,6 +35,7 @@
#include <WebKit2/WKBundlePagePrivate.h>
#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WKBundleRange.h>
+#include <WebKit2/WKBundleScriptWorld.h>
using namespace std;
@@ -198,9 +199,9 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringR
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveTitleForFrame(title, frame);
}
-void InjectedBundlePage::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window, const void *clientInfo)
+void InjectedBundlePage::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo)
{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, context, window);
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, world);
}
void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
@@ -412,11 +413,17 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
InjectedBundle::shared().os() << "TITLE CHANGED: " << title << "\n";
}
-void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window)
+void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
{
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (WKBundleScriptWorldNormalWorld() != world)
+ return;
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSObjectRef window = JSContextGetGlobalObject(context);
+
JSValueRef exception = 0;
InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 3f63bf3..cde1655 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -52,7 +52,7 @@ private:
static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, const void*);
- static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, JSGlobalContextRef, JSObjectRef window, const void*);
+ static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleScriptWorldRef, const void*);
static void didCancelClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*);
static void didChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
@@ -67,7 +67,7 @@ private:
void didFinishLoadForFrame(WKBundleFrameRef);
void didFailLoadWithErrorForFrame(WKBundleFrameRef);
void didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef);
- void didClearWindowForFrame(WKBundleFrameRef, JSGlobalContextRef, JSObjectRef window);
+ void didClearWindowForFrame(WKBundleFrameRef, WKBundleScriptWorldRef);
void didCancelClientRedirectForFrame(WKBundleFrameRef);
void willPerformClientRedirectForFrame(WKBundleFrameRef, WKURLRef url, double delay, double date);
void didChangeLocationWithinPageForFrame(WKBundleFrameRef);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list