[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
weinig at apple.com
weinig at apple.com
Wed Dec 22 11:48:51 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1b134df76e39e72fbd85dc75576abbb3c70fefad
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Aug 7 21:42:06 2010 +0000
WebKitTestRunner needs GCController
<rdar://problem/8213834>
https://bugs.webkit.org/show_bug.cgi?id=42701
Reviewed by Anders Carlsson.
WebKit2:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleGarbageCollectJavaScriptObjects):
(WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
(WKBundleGetJavaScriptObjectsCount):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
(WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
(WebKit::InjectedBundle::javaScriptObjectsCount):
* WebProcess/InjectedBundle/InjectedBundle.h:
WebKitTools:
* WebKitTestRunner/DerivedSources.make:
* WebKitTestRunner/InjectedBundle/Bindings/GCController.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h:
(WTR::setProperty):
* WebKitTestRunner/InjectedBundle/GCController.cpp: Added.
(WTR::GCController::create):
(WTR::GCController::GCController):
(WTR::GCController::~GCController):
(WTR::GCController::wrapperClass):
(WTR::GCController::collect):
(WTR::GCController::collectOnAlternateThread):
(WTR::GCController::getJSObjectCount):
(WTR::GCController::makeWindowObject):
* WebKitTestRunner/InjectedBundle/GCController.h: Added.
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::reset):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::bundle):
(WTR::InjectedBundle::gcController):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didClearWindowForFrame):
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::keepWebHistory):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/win/InjectedBundle.vcproj:
LayoutTests:
* platform/mac-wk2/Skipped: Remove now passing tests and add some failing tests.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e7f696e..5d998fc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-07 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKitTestRunner needs GCController
+ <rdar://problem/8213834>
+ https://bugs.webkit.org/show_bug.cgi?id=42701
+
+ * platform/mac-wk2/Skipped: Remove now passing tests and add some failing tests.
+
2010-08-07 Dan Bernstein <mitz at apple.com>
Reviewed by Anders Carlsson.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 8586399..0be7029 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1590,13 +1590,16 @@ fast/dom/Geolocation/callback-exception.html
fast/dom/Geolocation/callback-to-deleted-context.html
fast/dom/Geolocation/callback-to-remote-context.html
fast/dom/Geolocation/callback-to-remote-context2.html
+fast/dom/Geolocation/delayed-permission-allowed.html
+fast/dom/Geolocation/delayed-permission-denied.html
fast/dom/Geolocation/error.html
fast/dom/Geolocation/multiple-requests.html
+fast/dom/Geolocation/notimer-after-unload.html
fast/dom/Geolocation/permission-denied-already-clear-watch.html
fast/dom/Geolocation/permission-denied-already-error.html
fast/dom/Geolocation/permission-denied-already-success.html
-fast/dom/Geolocation/permission-denied.html
fast/dom/Geolocation/permission-denied-stops-watches.html
+fast/dom/Geolocation/permission-denied.html
fast/dom/Geolocation/position-string.html
fast/dom/Geolocation/reentrant-error.html
fast/dom/Geolocation/reentrant-permission-denied.html
@@ -1604,7 +1607,6 @@ fast/dom/Geolocation/reentrant-success.html
fast/dom/Geolocation/success.html
fast/dom/Geolocation/timeout.html
fast/dom/Geolocation/watch.html
-fast/dom/Geolocation/notimer-after-unload.html
# WebKitTestRunner needs layoutTestController.setMockGeolocationPosition
fast/dom/Geolocation/timeout-clear-watch.html
@@ -1791,12 +1793,6 @@ fast/loader/non-deferred-substitute-load.html
http/tests/cookies/third-party-cookie-relaxing.html
http/tests/plugins/third-party-cookie-accept-policy.html
-# WebKitTestRunner needs GCController
-# <https://bugs.webkit.org/show_bug.cgi?id=42701>
-fast/dom/gc-10.html
-fast/dom/StyleSheet/ownerNode-lifetime-2.html
-fast/frames/removal-before-attach-crash.html
-
# WebKitTestRunner needs to print onunload handler information
# <https://bugs.webkit.org/show_bug.cgi?id=42703>
fast/events/onunload-clears-onbeforeunload.html
@@ -2119,6 +2115,7 @@ fast/loader/empty-embed-src-attribute.html
fast/loader/empty-ref-versus-no-ref.html
fast/loader/frame-creation-removal.html
fast/overflow/scroll-vertical-not-horizontal.html
+fast/parser/entities-in-xhtml.xhtml
http/tests/history/back-to-post.php
http/tests/media/video-load-twice.html
http/tests/misc/slow-loading-mask.html
@@ -2139,7 +2136,6 @@ media/video-preload.html
media/video-src-change.html
platform/mac/fast/loader/non-html-load-event.html
-
########################################
# THINGS WE DON'T HAVE AND DON'T WANT
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index aa5b2b9..5f36921 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,22 @@
+2010-08-07 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKitTestRunner needs GCController
+ <rdar://problem/8213834>
+ https://bugs.webkit.org/show_bug.cgi?id=42701
+
+ * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+ (WKBundleGarbageCollectJavaScriptObjects):
+ (WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
+ (WKBundleGetJavaScriptObjectsCount):
+ * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
+ (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
+ (WebKit::InjectedBundle::javaScriptObjectsCount):
+ * WebProcess/InjectedBundle/InjectedBundle.h:
+
2010-08-07 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
index e3b2632..4236671 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
@@ -62,3 +62,18 @@ void WKBundleActivateMacFontAscentHack(WKBundleRef bundleRef)
{
toWK(bundleRef)->activateMacFontAscentHack();
}
+
+void WKBundleGarbageCollectJavaScriptObjects(WKBundleRef bundleRef)
+{
+ toWK(bundleRef)->garbageCollectJavaScriptObjects();
+}
+
+void WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(WKBundleRef bundleRef, bool waitUntilDone)
+{
+ toWK(bundleRef)->garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(waitUntilDone);
+}
+
+size_t WKBundleGetJavaScriptObjectsCount(WKBundleRef bundleRef)
+{
+ return toWK(bundleRef)->javaScriptObjectsCount();
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
index 35e7fe2..64b97ea 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
@@ -29,6 +29,10 @@
#include <WebKit2/WKBase.h>
#include <WebKit2/WKBundleBase.h>
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -36,6 +40,9 @@ extern "C" {
WK_EXPORT void WKBundleSetShouldTrackVisitedLinks(WKBundleRef bundle, bool shouldTrackVisitedLinks);
WK_EXPORT void WKBundleRemoveAllVisitedLinks(WKBundleRef bundle);
WK_EXPORT void WKBundleActivateMacFontAscentHack(WKBundleRef bundle);
+WK_EXPORT void WKBundleGarbageCollectJavaScriptObjects(WKBundleRef bundle);
+WK_EXPORT void WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(WKBundleRef bundle, bool waitUntilDone);
+WK_EXPORT size_t WKBundleGetJavaScriptObjectsCount(WKBundleRef bundle);
#ifdef __cplusplus
}
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index c6681e9..b667395 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -27,17 +27,21 @@
#include "Arguments.h"
#include "ImmutableArray.h"
-#include "WebContextMessageKinds.h"
#include "InjectedBundleMessageKinds.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
+#include "WebContextMessageKinds.h"
#include "WebCoreArgumentCoders.h"
#include "WebPage.h"
#include "WebProcess.h"
+#include <JavaScriptCore/JSLock.h>
+#include <WebCore/GCController.h>
+#include <WebCore/JSDOMWindow.h>
#include <WebCore/PageGroup.h>
#include <wtf/OwnArrayPtr.h>
using namespace WebCore;
+using namespace JSC;
namespace WebKit {
@@ -193,6 +197,22 @@ void InjectedBundle::removeAllVisitedLinks()
PageGroup::removeAllVisitedLinks();
}
+void InjectedBundle::garbageCollectJavaScriptObjects()
+{
+ gcController().garbageCollectNow();
+}
+
+void InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(bool waitUntilDone)
+{
+ gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+}
+
+size_t InjectedBundle::javaScriptObjectsCount()
+{
+ JSLock lock(SilenceAssertionsOnly);
+ return JSDOMWindow::commonJSGlobalData()->heap.objectCount();
+}
+
void InjectedBundle::didCreatePage(WebPage* page)
{
if (m_client.didCreatePage)
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
index 17945a4..695bc85 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
@@ -72,6 +72,11 @@ public:
void removeAllVisitedLinks();
void activateMacFontAscentHack();
+ // Garbage collection API
+ void garbageCollectJavaScriptObjects();
+ void garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(bool waitUntilDone);
+ size_t javaScriptObjectsCount();
+
// Callback hooks
void didCreatePage(WebPage*);
void willDestroyPage(WebPage*);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8d61bb7..3808b0e 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,38 @@
+2010-08-07 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKitTestRunner needs GCController
+ <rdar://problem/8213834>
+ https://bugs.webkit.org/show_bug.cgi?id=42701
+
+ * WebKitTestRunner/DerivedSources.make:
+ * WebKitTestRunner/InjectedBundle/Bindings/GCController.idl: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h:
+ (WTR::setProperty):
+ * WebKitTestRunner/InjectedBundle/GCController.cpp: Added.
+ (WTR::GCController::create):
+ (WTR::GCController::GCController):
+ (WTR::GCController::~GCController):
+ (WTR::GCController::wrapperClass):
+ (WTR::GCController::collect):
+ (WTR::GCController::collectOnAlternateThread):
+ (WTR::GCController::getJSObjectCount):
+ (WTR::GCController::makeWindowObject):
+ * WebKitTestRunner/InjectedBundle/GCController.h: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::reset):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::bundle):
+ (WTR::InjectedBundle::gcController):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::keepWebHistory):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/win/InjectedBundle.vcproj:
+
2010-08-05 Jon Honeycutt <jhoneycutt at apple.com>
WebKitTestRunner needs to be able to set the font smoothing type
diff --git a/WebKitTools/WebKitTestRunner/DerivedSources.make b/WebKitTools/WebKitTestRunner/DerivedSources.make
index 6134380..1aa3c86 100644
--- a/WebKitTools/WebKitTestRunner/DerivedSources.make
+++ b/WebKitTools/WebKitTestRunner/DerivedSources.make
@@ -27,6 +27,7 @@ VPATH = \
INTERFACES = \
LayoutTestController \
+ GCController \
#
SCRIPTS = \
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
new file mode 100644
index 0000000..eb3ddee
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module WTR {
+
+ interface GCController {
+ void collect();
+ void collectOnAlternateThread(in boolean waitUntilDone);
+ unsigned long long getJSObjectCount();
+ };
+
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h
index 9839cb4..d885801 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h
@@ -27,6 +27,7 @@
#define JSWrapper_h
#include "JSWrappable.h"
+#include <JavaScriptCore/JSRetainPtr.h>
namespace WTR {
@@ -45,6 +46,12 @@ inline JSValueRef toJS(JSContextRef context, JSWrappable* impl)
return JSWrapper::wrap(context, impl);
}
+inline void setProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception)
+{
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ JSObjectSetProperty(context, object, propertyNameString.get(), JSWrapper::wrap(context, value), attributes, exception);
+}
+
} // namespace WTR
#endif // JSWrapper_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp
new file mode 100644
index 0000000..0eba2df
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "GCController.h"
+
+#include "InjectedBundle.h"
+#include "JSGCController.h"
+#include <WebKit2/WKBundlePrivate.h>
+
+namespace WTR {
+
+PassRefPtr<GCController> GCController::create()
+{
+ return adoptRef(new GCController);
+}
+
+GCController::GCController()
+{
+}
+
+GCController::~GCController()
+{
+}
+
+JSClassRef GCController::wrapperClass()
+{
+ return JSGCController::gCControllerClass();
+}
+
+void GCController::collect()
+{
+ WKBundleGarbageCollectJavaScriptObjects(InjectedBundle::shared().bundle());
+}
+
+void GCController::collectOnAlternateThread(bool waitUntilDone)
+{
+ WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(InjectedBundle::shared().bundle(), waitUntilDone);
+}
+
+size_t GCController::getJSObjectCount()
+{
+ return WKBundleGetJavaScriptObjectsCount(InjectedBundle::shared().bundle());
+}
+
+// Object Creation
+
+void GCController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+{
+ setProperty(context, windowObject, "GCController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h
new file mode 100644
index 0000000..654fe0e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GCController_h
+#define GCController_h
+
+#include "JSWrappable.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WTR {
+
+class GCController : public JSWrappable {
+public:
+ static PassRefPtr<GCController> create();
+ virtual ~GCController();
+
+ // JSWrappable
+ virtual JSClassRef wrapperClass();
+
+ void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
+
+ // The basics.
+ void collect();
+ void collectOnAlternateThread(bool waitUntilDone);
+ size_t getJSObjectCount();
+
+private:
+ GCController();
+};
+
+} // namespace WTR
+
+#endif // GCController_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 94feab1..a97d1e9 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -134,16 +134,12 @@ void InjectedBundle::reset()
{
m_outputStream.str("");
m_layoutTestController = LayoutTestController::create();
+ m_gcController = GCController::create();
WKBundleSetShouldTrackVisitedLinks(m_bundle, false);
WKBundleRemoveAllVisitedLinks(m_bundle);
m_mainPage->reset();
}
-void InjectedBundle::setShouldTrackVisitedLinks()
-{
- WKBundleSetShouldTrackVisitedLinks(m_bundle, true);
-}
-
void InjectedBundle::closeOtherPages()
{
Vector<WKBundlePageRef> pages;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index 42eb3a1..e97a0f0 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -26,6 +26,7 @@
#ifndef InjectedBundle_h
#define InjectedBundle_h
+#include "GCController.h"
#include "LayoutTestController.h"
#include <WebKit2/WKBase.h>
#include <WebKit2/WKBundleBase.h>
@@ -46,17 +47,18 @@ public:
// Initialize the InjectedBundle.
void initialize(WKBundleRef);
- void done();
+ WKBundleRef bundle() const { return m_bundle; }
LayoutTestController* layoutTestController() { return m_layoutTestController.get(); }
+ GCController* gcController() { return m_gcController.get(); }
+
InjectedBundlePage* page() { return m_mainPage.get(); }
size_t pageCount() { return !!m_mainPage + m_otherPages.size(); }
void closeOtherPages();
+ void done();
std::ostringstream& os() { return m_outputStream; }
- void setShouldTrackVisitedLinks();
-
private:
InjectedBundle();
~InjectedBundle();
@@ -76,6 +78,7 @@ private:
OwnPtr<InjectedBundlePage> m_mainPage;
RefPtr<LayoutTestController> m_layoutTestController;
+ RefPtr<GCController> m_gcController;
std::ostringstream m_outputStream;
};
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index fe6488d..c69de66 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -328,6 +328,7 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSGlobal
{
JSValueRef exception = 0;
InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
+ InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
}
// UI Client Callbacks
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index 490640c..487cc43 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -32,6 +32,7 @@
#include <WebKit2/WKBundleFrame.h>
#include <WebKit2/WKBundleFramePrivate.h>
#include <WebKit2/WKBundlePagePrivate.h>
+#include <WebKit2/WKBundlePrivate.h>
#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WebKit2.h>
@@ -41,12 +42,6 @@ namespace WTR {
// Eventually it should be changed to match.
static const CFTimeInterval waitToDumpWatchdogInterval = 6.0;
-static void setProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception)
-{
- JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
- JSObjectSetProperty(context, object, propertyNameString.get(), JSWrapper::wrap(context, value), attributes, exception);
-}
-
static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
{
if (!object)
@@ -169,7 +164,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
void LayoutTestController::keepWebHistory()
{
- InjectedBundle::shared().setShouldTrackVisitedLinks();
+ WKBundleSetShouldTrackVisitedLinks(InjectedBundle::shared().bundle(), true);
}
JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element)
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index 75aeb9e..f4b33b8 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -27,7 +27,6 @@
#define LayoutTestController_h
#include "JSWrappable.h"
-#include <JavaScriptCore/JavaScriptCore.h>
#include <JavaScriptCore/JSRetainPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RetainPtr.h>
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 145729d..9495b12 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -33,6 +33,8 @@
6510A78B11EC643800410867 /* WebKitWeightWatcher800.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A78011EC643800410867 /* WebKitWeightWatcher800.ttf */; };
6510A78C11EC643800410867 /* WebKitWeightWatcher900.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A78111EC643800410867 /* WebKitWeightWatcher900.ttf */; };
65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65EB859F11EC67CC0034D300 /* ActivateFonts.mm */; };
+ BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E4D9120E02D000826C0C /* GCController.cpp */; };
+ BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E4E8120E03D800826C0C /* JSGCController.cpp */; };
BC25193E11D15D8B002EBC01 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934A411906584005EA8E2 /* Cocoa.framework */; };
BC25193F11D15D8B002EBC01 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934AB1190658C005EA8E2 /* WebKit2.framework */; };
BC25194011D15D8B002EBC01 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
@@ -85,6 +87,11 @@
65EB859D11EC67CC0034D300 /* ActivateFonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivateFonts.h; sourceTree = "<group>"; };
65EB859F11EC67CC0034D300 /* ActivateFonts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ActivateFonts.mm; sourceTree = "<group>"; };
8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC14E4D8120E02D000826C0C /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; };
+ BC14E4D9120E02D000826C0C /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; };
+ BC14E4E1120E032000826C0C /* GCController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GCController.idl; sourceTree = "<group>"; };
+ BC14E4E8120E03D800826C0C /* JSGCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSGCController.cpp; path = ../../WebKitBuild/Debug/DerivedSources/WebKitTestRunner/JSGCController.cpp; sourceTree = SOURCE_ROOT; };
+ BC14E4E9120E03D800826C0C /* JSGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSGCController.h; path = ../../WebKitBuild/Debug/DerivedSources/WebKitTestRunner/JSGCController.h; sourceTree = SOURCE_ROOT; };
BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
BC25186211D15D54002EBC01 /* InjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
@@ -202,11 +209,23 @@
path = mac;
sourceTree = "<group>";
};
+ BC14E4E0120E02F900826C0C /* Controllers */ = {
+ isa = PBXGroup;
+ children = (
+ BC14E4D9120E02D000826C0C /* GCController.cpp */,
+ BC14E4D8120E02D000826C0C /* GCController.h */,
+ BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */,
+ BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */,
+ );
+ name = Controllers;
+ sourceTree = "<group>";
+ };
BC25183511D1571D002EBC01 /* InjectedBundle */ = {
isa = PBXGroup;
children = (
BC952D3A11F3BF1F003398B4 /* Derived Sources */,
BC952C0A11F3B939003398B4 /* Bindings */,
+ BC14E4E0120E02F900826C0C /* Controllers */,
65EB859E11EC67CC0034D300 /* mac */,
65EB859D11EC67CC0034D300 /* ActivateFonts.h */,
BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */,
@@ -214,8 +233,6 @@
BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */,
BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */,
BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */,
- BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */,
- BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */,
);
path = InjectedBundle;
sourceTree = "<group>";
@@ -268,6 +285,7 @@
BC952C0E11F3B97B003398B4 /* JSWrappable.h */,
BC952C0C11F3B965003398B4 /* JSWrapper.cpp */,
BC952C0B11F3B965003398B4 /* JSWrapper.h */,
+ BC14E4E1120E032000826C0C /* GCController.idl */,
BC952ED211F3C29F003398B4 /* LayoutTestController.idl */,
);
path = Bindings;
@@ -276,6 +294,8 @@
BC952D3A11F3BF1F003398B4 /* Derived Sources */ = {
isa = PBXGroup;
children = (
+ BC14E4E8120E03D800826C0C /* JSGCController.cpp */,
+ BC14E4E9120E03D800826C0C /* JSGCController.h */,
BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */,
BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */,
);
@@ -411,6 +431,8 @@
65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */,
BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */,
BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */,
+ BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */,
+ BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
index d283083..ddfcf37 100644
--- a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
+++ b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
@@ -288,6 +288,14 @@
Name="Derived Sources"
>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGCController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGCController.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.cpp"
>
</File>
@@ -321,6 +329,14 @@
>
</File>
<File
+ RelativePath="..\InjectedBundle\GCController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\GCController.h"
+ >
+ </File>
+ <File
RelativePath="..\InjectedBundle\LayoutTestController.cpp"
>
</File>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list