[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:45:45 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e1dd7fb39e35685245ae3fcd122bcb79a66f8278
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Aug 6 00:31:51 2010 +0000
Add ability to get a JSValueRef for a node handle and a world
https://bugs.webkit.org/show_bug.cgi?id=43591
Reviewed by Anders Carlsson.
WebCore:
* WebCore.exp.in: Add exports.
WebKit2:
- Add API to get a JSValueRef for a world, node and frame (the
frame is currently necessary to pick the right globalObject for
the node wrapper).
- Add API to a JSGlobalContextRef for a world and a frame.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetJavaScriptContextForWorld):
(WKBundleFrameGetJavaScriptWrapperForNodeForWorld):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::coreNode):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::InjectedBundleScriptWorld::coreWorld):
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::jsContext):
(WebKit::WebFrame::jsContextForWorld):
(WebKit::WebFrame::jsWrapperForWorld):
* WebProcess/WebPage/WebFrame.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e4fc593..5fdc758 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-05 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add ability to get a JSValueRef for a node handle and a world
+ https://bugs.webkit.org/show_bug.cgi?id=43591
+
+ * WebCore.exp.in: Add exports.
+
2010-08-05 Gavin Barraclough <barraclough at apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 828510a..7fc8956 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -289,6 +289,7 @@ __ZN7WebCore13IdentifierRep3getEi
__ZN7WebCore13JSHTMLElement6s_infoE
__ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
__ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
+__ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE
__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
__ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
@@ -410,10 +411,10 @@ __ZN7WebCore17HTMLPlugInElement11getNPObjectEv
__ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
__ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
__ZN7WebCore17openTemporaryFileEPKcRi
+__ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE
__ZN7WebCore18deprecatedParseURLERKNS_6StringE
__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
__ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE
-__ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE
__ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
@@ -671,6 +672,7 @@ __ZN7WebCore8Document13svgExtensionsEv
__ZN7WebCore8Document14setFocusedNodeEN3WTF10PassRefPtrINS_4NodeEEE
__ZN7WebCore8Document16isPageBoxVisibleEi
__ZN7WebCore8Document17getFocusableNodesERN3WTF6VectorINS1_6RefPtrINS_4NodeEEELm0EEE
+__ZN7WebCore8Document18createWrapperCacheEPNS_15DOMWrapperWorldE
__ZN7WebCore8Document19accessSVGExtensionsEv
__ZN7WebCore8Document22createDocumentFragmentEv
__ZN7WebCore8Document23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6200b58..afff3eb 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,32 @@
+2010-08-05 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add ability to get a JSValueRef for a node handle and a world
+ https://bugs.webkit.org/show_bug.cgi?id=43591
+
+ - Add API to get a JSValueRef for a world, node and frame (the
+ frame is currently necessary to pick the right globalObject for
+ the node wrapper).
+ - Add API to a JSGlobalContextRef for a world and a frame.
+
+ * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+ (WKBundleFrameGetJavaScriptContextForWorld):
+ (WKBundleFrameGetJavaScriptWrapperForNodeForWorld):
+ * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
+ * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+ (WebKit::InjectedBundleNodeHandle::coreNode):
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
+ * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
+ (WebKit::InjectedBundleScriptWorld::coreWorld):
+ * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::jsContext):
+ (WebKit::WebFrame::jsContextForWorld):
+ (WebKit::WebFrame::jsWrapperForWorld):
+ * WebProcess/WebPage/WebFrame.h:
+
2010-08-05 Gavin Barraclough <barraclough at apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
index 707a249..ca2a31f 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
@@ -69,6 +69,16 @@ JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frameRef)
return toWK(frameRef)->jsContext();
}
+JSGlobalContextRef WKBundleFrameGetJavaScriptContextForWorld(WKBundleFrameRef frameRef, WKBundleScriptWorldRef worldRef)
+{
+ return toWK(frameRef)->jsContextForWorld(toWK(worldRef));
+}
+
+JSValueRef WKBundleFrameGetJavaScriptWrapperForNodeForWorld(WKBundleFrameRef frameRef, WKBundleNodeHandleRef nodeHandleRef, WKBundleScriptWorldRef worldRef)
+{
+ return toWK(frameRef)->jsWrapperForWorld(toWK(nodeHandleRef), toWK(worldRef));
+}
+
WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef)
{
return toCopiedRef(toWK(frameRef)->name());
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
index b271596..2e1b1ca 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
@@ -43,6 +43,9 @@ WK_EXPORT WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frame);
WK_EXPORT WKURLRef WKBundleFrameCopyURL(WKBundleFrameRef frame);
WK_EXPORT JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frame);
+WK_EXPORT JSGlobalContextRef WKBundleFrameGetJavaScriptContextForWorld(WKBundleFrameRef frame, WKBundleScriptWorldRef world);
+
+WK_EXPORT JSValueRef WKBundleFrameGetJavaScriptWrapperForNodeForWorld(WKBundleFrameRef frame, WKBundleNodeHandleRef nodeHandle, WKBundleScriptWorldRef world);
#ifdef __cplusplus
}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h
index af7d895..3d73d3c 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h
@@ -26,6 +26,7 @@
#ifndef WKBundleNodeHandle_h
#define WKBundleNodeHandle_h
+#include <JavaScriptCore/JavaScript.h>
#include <WebKit2/WKBase.h>
#include <WebKit2/WKBundleBase.h>
diff --git a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
index de69f15..3b2a118 100644
--- a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
@@ -25,6 +25,7 @@
#include "InjectedBundleNodeHandle.h"
+#include "InjectedBundleScriptWorld.h"
#include <WebCore/Node.h>
#include <wtf/HashMap.h>
@@ -66,4 +67,9 @@ InjectedBundleNodeHandle::~InjectedBundleNodeHandle()
domHandleCache().remove(m_node.get());
}
+Node* InjectedBundleNodeHandle::coreNode() const
+{
+ return m_node.get();
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
index df9f5fc..f0e593b 100644
--- a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
+++ b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
@@ -24,8 +24,9 @@
*/
#include "APIObject.h"
-#include <wtf/RefPtr.h>
+#include <JavaScriptCore/JSBase.h>
#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
namespace WebCore {
class Node;
@@ -33,6 +34,8 @@ namespace WebCore {
namespace WebKit {
+class InjectedBundleScriptWorld;
+
class InjectedBundleNodeHandle : public APIObject {
public:
static const Type APIType = TypeBundleNodeHandle;
@@ -40,6 +43,8 @@ public:
static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(WebCore::Node*);
~InjectedBundleNodeHandle();
+ WebCore::Node* coreNode() const;
+
private:
static PassRefPtr<InjectedBundleNodeHandle> create(WebCore::Node*);
InjectedBundleNodeHandle(WebCore::Node*);
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
index ce02390..d764cf2 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
@@ -76,4 +76,9 @@ InjectedBundleScriptWorld::~InjectedBundleScriptWorld()
allWorlds().remove(m_world.get());
}
+DOMWrapperWorld* InjectedBundleScriptWorld::coreWorld() const
+{
+ return m_world.get();
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
index 0f6e6fa..1356ae5 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
@@ -46,6 +46,8 @@ public:
~InjectedBundleScriptWorld();
+ WebCore::DOMWrapperWorld* coreWorld() const;
+
private:
InjectedBundleScriptWorld(PassRefPtr<WebCore::DOMWrapperWorld>);
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.cpp b/WebKit2/WebProcess/WebPage/WebFrame.cpp
index d66a80b..a724a3d 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -25,6 +25,8 @@
#include "WebFrame.h"
+#include "InjectedBundleNodeHandle.h"
+#include "InjectedBundleScriptWorld.h"
#include "WebPage.h"
#include <JavaScriptCore/APICast.h>
#include <JavaScriptCore/JSLock.h>
@@ -249,9 +251,21 @@ bool WebFrame::pauseAnimationOnElementWithId(const String& animationName, const
JSGlobalContextRef WebFrame::jsContext()
{
- // FIXME: Is there a way to get this and know that it's a JSGlobalContextRef?
- // The const_cast here is a bit ugly.
- return const_cast<JSGlobalContextRef>(toRef(m_coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec()));
+ return toGlobalRef(m_coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec());
+}
+
+JSGlobalContextRef WebFrame::jsContextForWorld(InjectedBundleScriptWorld* world)
+{
+ return toGlobalRef(m_coreFrame->script()->globalObject(world->coreWorld())->globalExec());
+}
+
+JSValueRef WebFrame::jsWrapperForWorld(InjectedBundleNodeHandle* nodeHandle, InjectedBundleScriptWorld* world)
+{
+ JSDOMWindow* globalObject = m_coreFrame->script()->globalObject(world->coreWorld());
+ ExecState* exec = globalObject->globalExec();
+
+ JSLock lock(SilenceAssertionsOnly);
+ return toRef(exec, toJS(exec, globalObject, nodeHandle->coreNode()));
}
JSValueRef WebFrame::computedStyleIncludingVisitedInfo(JSObjectRef element)
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.h b/WebKit2/WebProcess/WebPage/WebFrame.h
index 3bd86cc..89eb925 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -44,6 +44,8 @@ namespace WebCore {
namespace WebKit {
+class InjectedBundleNodeHandle;
+class InjectedBundleScriptWorld;
class WebPage;
class WebFrame : public APIObject {
@@ -74,6 +76,10 @@ public:
PassRefPtr<ImmutableArray> childFrames();
JSValueRef computedStyleIncludingVisitedInfo(JSObjectRef element);
JSGlobalContextRef jsContext();
+ JSGlobalContextRef jsContextForWorld(InjectedBundleScriptWorld*);
+
+ JSValueRef jsWrapperForWorld(InjectedBundleNodeHandle*, InjectedBundleScriptWorld*);
+
static WebCore::String counterValue(JSObjectRef element);
static WebCore::String markerText(JSObjectRef element);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list