Changeset 64803 in webkit
- Timestamp:
- Aug 5, 2010 5:31:51 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64801 r64803 1 2010-08-05 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Add ability to get a JSValueRef for a node handle and a world 6 https://bugs.webkit.org/show_bug.cgi?id=43591 7 8 * WebCore.exp.in: Add exports. 9 1 10 2010-08-05 Gavin Barraclough <barraclough@apple.com> 2 11 -
trunk/WebCore/WebCore.exp.in
r64797 r64803 290 290 __ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb 291 291 __ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE 292 __ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE 292 293 __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow 293 294 __ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE … … 411 412 __ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE 412 413 __ZN7WebCore17openTemporaryFileEPKcRi 414 __ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE 413 415 __ZN7WebCore18deprecatedParseURLERKNS_6StringE 414 416 __ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE 415 417 __ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE 416 __ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE417 418 __ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE 418 419 __ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE … … 672 673 __ZN7WebCore8Document16isPageBoxVisibleEi 673 674 __ZN7WebCore8Document17getFocusableNodesERN3WTF6VectorINS1_6RefPtrINS_4NodeEEELm0EEE 675 __ZN7WebCore8Document18createWrapperCacheEPNS_15DOMWrapperWorldE 674 676 __ZN7WebCore8Document19accessSVGExtensionsEv 675 677 __ZN7WebCore8Document22createDocumentFragmentEv -
trunk/WebKit2/ChangeLog
r64801 r64803 1 2010-08-05 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Add ability to get a JSValueRef for a node handle and a world 6 https://bugs.webkit.org/show_bug.cgi?id=43591 7 8 - Add API to get a JSValueRef for a world, node and frame (the 9 frame is currently necessary to pick the right globalObject for 10 the node wrapper). 11 - Add API to a JSGlobalContextRef for a world and a frame. 12 13 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: 14 (WKBundleFrameGetJavaScriptContextForWorld): 15 (WKBundleFrameGetJavaScriptWrapperForNodeForWorld): 16 * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: 17 * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h: 18 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: 19 (WebKit::InjectedBundleNodeHandle::coreNode): 20 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 21 * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: 22 (WebKit::InjectedBundleScriptWorld::coreWorld): 23 * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: 24 * WebProcess/WebPage/WebFrame.cpp: 25 (WebKit::WebFrame::jsContext): 26 (WebKit::WebFrame::jsContextForWorld): 27 (WebKit::WebFrame::jsWrapperForWorld): 28 * WebProcess/WebPage/WebFrame.h: 29 1 30 2010-08-05 Gavin Barraclough <barraclough@apple.com> 2 31 -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
r64426 r64803 70 70 } 71 71 72 JSGlobalContextRef WKBundleFrameGetJavaScriptContextForWorld(WKBundleFrameRef frameRef, WKBundleScriptWorldRef worldRef) 73 { 74 return toWK(frameRef)->jsContextForWorld(toWK(worldRef)); 75 } 76 77 JSValueRef WKBundleFrameGetJavaScriptWrapperForNodeForWorld(WKBundleFrameRef frameRef, WKBundleNodeHandleRef nodeHandleRef, WKBundleScriptWorldRef worldRef) 78 { 79 return toWK(frameRef)->jsWrapperForWorld(toWK(nodeHandleRef), toWK(worldRef)); 80 } 81 72 82 WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef) 73 83 { -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
r64253 r64803 44 44 45 45 WK_EXPORT JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frame); 46 WK_EXPORT JSGlobalContextRef WKBundleFrameGetJavaScriptContextForWorld(WKBundleFrameRef frame, WKBundleScriptWorldRef world); 47 48 WK_EXPORT JSValueRef WKBundleFrameGetJavaScriptWrapperForNodeForWorld(WKBundleFrameRef frame, WKBundleNodeHandleRef nodeHandle, WKBundleScriptWorldRef world); 46 49 47 50 #ifdef __cplusplus -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h
r64778 r64803 27 27 #define WKBundleNodeHandle_h 28 28 29 #include <JavaScriptCore/JavaScript.h> 29 30 #include <WebKit2/WKBase.h> 30 31 #include <WebKit2/WKBundleBase.h> -
trunk/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
r64788 r64803 26 26 #include "InjectedBundleNodeHandle.h" 27 27 28 #include "InjectedBundleScriptWorld.h" 28 29 #include <WebCore/Node.h> 29 30 #include <wtf/HashMap.h> … … 67 68 } 68 69 70 Node* InjectedBundleNodeHandle::coreNode() const 71 { 72 return m_node.get(); 73 } 74 69 75 } // namespace WebKit -
trunk/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
r64778 r64803 25 25 26 26 #include "APIObject.h" 27 #include <JavaScriptCore/JSBase.h> 28 #include <wtf/PassRefPtr.h> 27 29 #include <wtf/RefPtr.h> 28 #include <wtf/PassRefPtr.h>29 30 30 31 namespace WebCore { … … 34 35 namespace WebKit { 35 36 37 class InjectedBundleScriptWorld; 38 36 39 class InjectedBundleNodeHandle : public APIObject { 37 40 public: … … 40 43 static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(WebCore::Node*); 41 44 ~InjectedBundleNodeHandle(); 45 46 WebCore::Node* coreNode() const; 42 47 43 48 private: -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
r64788 r64803 77 77 } 78 78 79 DOMWrapperWorld* InjectedBundleScriptWorld::coreWorld() const 80 { 81 return m_world.get(); 82 } 83 79 84 } // namespace WebKit -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
r64788 r64803 47 47 ~InjectedBundleScriptWorld(); 48 48 49 WebCore::DOMWrapperWorld* coreWorld() const; 50 49 51 private: 50 52 InjectedBundleScriptWorld(PassRefPtr<WebCore::DOMWrapperWorld>); -
trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp
r64504 r64803 26 26 #include "WebFrame.h" 27 27 28 #include "InjectedBundleNodeHandle.h" 29 #include "InjectedBundleScriptWorld.h" 28 30 #include "WebPage.h" 29 31 #include <JavaScriptCore/APICast.h> … … 250 252 JSGlobalContextRef WebFrame::jsContext() 251 253 { 252 // FIXME: Is there a way to get this and know that it's a JSGlobalContextRef? 253 // The const_cast here is a bit ugly. 254 return const_cast<JSGlobalContextRef>(toRef(m_coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec())); 254 return toGlobalRef(m_coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec()); 255 } 256 257 JSGlobalContextRef WebFrame::jsContextForWorld(InjectedBundleScriptWorld* world) 258 { 259 return toGlobalRef(m_coreFrame->script()->globalObject(world->coreWorld())->globalExec()); 260 } 261 262 JSValueRef WebFrame::jsWrapperForWorld(InjectedBundleNodeHandle* nodeHandle, InjectedBundleScriptWorld* world) 263 { 264 JSDOMWindow* globalObject = m_coreFrame->script()->globalObject(world->coreWorld()); 265 ExecState* exec = globalObject->globalExec(); 266 267 JSLock lock(SilenceAssertionsOnly); 268 return toRef(exec, toJS(exec, globalObject, nodeHandle->coreNode())); 255 269 } 256 270 -
trunk/WebKit2/WebProcess/WebPage/WebFrame.h
r64801 r64803 45 45 namespace WebKit { 46 46 47 class InjectedBundleNodeHandle; 48 class InjectedBundleScriptWorld; 47 49 class WebPage; 48 50 … … 75 77 JSValueRef computedStyleIncludingVisitedInfo(JSObjectRef element); 76 78 JSGlobalContextRef jsContext(); 79 JSGlobalContextRef jsContextForWorld(InjectedBundleScriptWorld*); 80 81 JSValueRef jsWrapperForWorld(InjectedBundleNodeHandle*, InjectedBundleScriptWorld*); 82 77 83 static WebCore::String counterValue(JSObjectRef element); 78 84 static WebCore::String markerText(JSObjectRef element);
Note: See TracChangeset
for help on using the changeset viewer.