Changeset 63631 in webkit
- Timestamp:
- Jul 18, 2010 2:33:58 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63628 r63631 1 2010-07-18 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Add NPJSObjectMap class 6 https://bugs.webkit.org/show_bug.cgi?id=42524 7 8 Export ScriptController functions. 9 10 * WebCore.exp.in: 11 1 12 2010-07-18 Anders Carlsson <andersca@apple.com> 2 13 -
trunk/WebCore/WebCore.exp.in
r63628 r63631 381 381 __ZN7WebCore16ScriptController11createWorldEv 382 382 __ZN7WebCore16ScriptController13executeScriptERKNS_6StringEbNS_14ShouldAllowXSSE 383 __ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE 383 384 __ZN7WebCore16ScriptController18windowScriptObjectEv 384 385 __ZN7WebCore16ScriptController20executeScriptInWorldEPNS_15DOMWrapperWorldERKNS_6StringEbNS_14ShouldAllowXSSE 386 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE 385 387 __ZN7WebCore16ThreadGlobalData10staticDataE 386 388 __ZN7WebCore16ThreadGlobalDataC1Ev … … 1223 1225 __ZN3JSC8Bindings8InstanceC2EN3WTF10PassRefPtrINS0_10RootObjectEEE 1224 1226 __ZN3JSC8Bindings8InstanceD2Ev 1225 __ZN7WebCore13IdentifierRep3getEPKc1226 __ZN7WebCore13IdentifierRep3getEi1227 1227 __ZN7WebCore13IdentifierRep7isValidEPS0_ 1228 1228 __ZN7WebCore16ScriptController16createRootObjectEPv 1229 __ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE1230 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE1231 1229 __ZNK3JSC8Bindings13RuntimeObject12defaultValueEPNS_9ExecStateENS_22PreferredPrimitiveTypeE 1232 1230 __ZTVN3JSC13RuntimeMethodE -
trunk/WebKit2/ChangeLog
r63630 r63631 1 2010-07-18 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Add NPJSObjectMap class 6 https://bugs.webkit.org/show_bug.cgi?id=42524 7 8 * WebKit2.xcodeproj/project.pbxproj: 9 Add files. 10 11 * WebProcess/Plugins/NPJSObjectMap.cpp: Added. 12 * WebProcess/Plugins/NPJSObjectMap.h: Added. 13 Add NPJSObjectMap, a map which contains NPObjects that wrap JavaScript objects. 14 15 * WebProcess/Plugins/PluginView.cpp: 16 (WebKit::PluginView::PluginView): 17 Initialize the map. 18 19 (WebKit::PluginView::~PluginView): 20 Invalidate the map. 21 22 (WebKit::PluginView::frame): 23 Add frame getter. 24 25 (WebKit::PluginView::windowScriptNPObject): 26 Wrap the window object. 27 28 (WebKit::PluginView::pluginElementNPObject): 29 Wrap the plug-in element object. 30 31 * WebProcess/Plugins/PluginView.h: 32 1 33 2010-07-18 Anders Carlsson <andersca@apple.com> 2 34 -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r63630 r63631 33 33 1A10475A110A5AD500A43ECD /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */; }; 34 34 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C79A100E7FC50078DEBC /* WebCore.framework */; }; 35 1A2161B011F37664008AD0F5 /* NPJSObjectMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2161AE11F37664008AD0F5 /* NPJSObjectMap.h */; }; 36 1A2161B111F37664008AD0F5 /* NPJSObjectMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2161AF11F37664008AD0F5 /* NPJSObjectMap.cpp */; }; 35 37 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */; }; 36 38 1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */; }; … … 300 302 0F52667311DD4A490006D33C /* WebProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessProxyMac.mm; sourceTree = "<group>"; }; 301 303 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 304 1A2161AE11F37664008AD0F5 /* NPJSObjectMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPJSObjectMap.h; sourceTree = "<group>"; }; 305 1A2161AF11F37664008AD0F5 /* NPJSObjectMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPJSObjectMap.cpp; sourceTree = "<group>"; }; 302 306 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeUtilities.cpp; sourceTree = "<group>"; }; 303 307 1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPRuntimeUtilities.h; sourceTree = "<group>"; }; … … 653 657 1A6FB7E511E6530500DB1371 /* DummyPlugin.cpp */, 654 658 1A6FB7E411E6530500DB1371 /* DummyPlugin.h */, 659 1A2161AF11F37664008AD0F5 /* NPJSObjectMap.cpp */, 660 1A2161AE11F37664008AD0F5 /* NPJSObjectMap.h */, 655 661 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */, 656 662 1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */, … … 1241 1247 BC2E6E8C1141971500A63B1E /* WorkItem.h in Headers */, 1242 1248 BC2E6E8E1141971500A63B1E /* WorkQueue.h in Headers */, 1249 1A2161B011F37664008AD0F5 /* NPJSObjectMap.h in Headers */, 1243 1250 1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */, 1244 1251 ); … … 1432 1439 BC2E6E8D1141971500A63B1E /* WorkQueue.cpp in Sources */, 1433 1440 BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */, 1441 1A2161B111F37664008AD0F5 /* NPJSObjectMap.cpp in Sources */, 1434 1442 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */, 1435 1443 ); -
trunk/WebKit2/WebProcess/Plugins/PluginView.cpp
r63629 r63631 38 38 #include <WebCore/ScrollView.h> 39 39 40 using namespace JSC; 40 41 using namespace WebCore; 41 42 … … 211 212 , m_isWaitingUntilMediaCanStart(false) 212 213 , m_pendingURLRequestsTimer(RunLoop::main(), this, &PluginView::pendingURLRequestsTimerFired) 214 , m_npJSObjectMap(this) 213 215 { 214 216 } … … 227 229 m_plugin->destroy(); 228 230 231 // Invalidate the NPObject map. 232 m_npJSObjectMap.invalidate(); 233 229 234 // Cancel all streams. 230 235 cancelAllStreams(); 236 } 237 238 Frame* PluginView::frame() 239 { 240 return m_pluginElement->document()->frame(); 231 241 } 232 242 … … 534 544 NPObject* PluginView::windowScriptNPObject() 535 545 { 536 // FIXME: Implement. 537 return 0; 546 if (!frame()) 547 return 0; 548 549 // FIXME: Handle JavaScript being disabled. 550 ASSERT(frame()->script()->canExecuteScripts(NotAboutToExecuteScript)); 551 552 return m_npJSObjectMap.getOrCreateObject(frame()->script()->windowShell(pluginWorld())->window()); 538 553 } 539 554 540 555 NPObject* PluginView::pluginElementNPObject() 541 556 { 542 // FIXME: Implement. 543 return 0; 557 if (!frame()) 558 return 0; 559 560 // FIXME: Handle JavaScript being disabled. 561 JSObject* object = frame()->script()->jsObjectForPluginElement(m_pluginElement); 562 ASSERT(object); 563 564 return m_npJSObjectMap.getOrCreateObject(object); 544 565 } 545 566 -
trunk/WebKit2/WebProcess/Plugins/PluginView.h
r63629 r63631 27 27 #define PluginView_h 28 28 29 #include "NPJSObjectMap.h" 29 30 #include "Plugin.h" 30 31 #include "PluginController.h" … … 39 40 40 41 namespace WebCore { 42 class Frame; 41 43 class HTMLPlugInElement; 42 44 } … … 50 52 return adoptRef(new PluginView(pluginElement, plugin, parameters)); 51 53 } 54 55 WebCore::Frame* frame(); 52 56 53 57 private: … … 115 119 // Streams that the plug-in has requested to load. 116 120 HashMap<uint64_t, RefPtr<Stream> > m_streams; 121 122 // NPObjects wrapping JavaScript objects. 123 NPJSObjectMap m_npJSObjectMap; 117 124 }; 118 125
Note: See TracChangeset
for help on using the changeset viewer.