Changeset 36891 in webkit
- Timestamp:
- Sep 25, 2008 3:15:11 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 27 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r36890 r36891 1 2008-09-24 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Sam Weinig, Anders Carlsson, and (unofficially) Adam Barth. 4 5 https://bugs.webkit.org/show_bug.cgi?id=20879 6 Implement HTML5 channel messaging 7 8 * fast/dom/Window/window-properties-expected.txt: 9 * fast/events/message-channel-gc-expected.txt: Added. 10 * fast/events/message-channel-gc.html: Added. 11 * fast/events/message-port-deleted-document-expected.txt: Added. 12 * fast/events/message-port-deleted-document.html: Added. 13 * fast/events/message-port-deleted-frame-expected.txt: Added. 14 * fast/events/message-port-deleted-frame.html: Added. 15 * fast/events/message-port-expected.txt: Added. 16 * fast/events/message-port-inactive-document-expected.txt: Added. 17 * fast/events/message-port-inactive-document.html: Added. 18 * fast/events/message-port.html: Added. 19 * fast/events/resources/message-port-iframe.html: Added. 20 * http/tests/security/MessagePort: Added. 21 * http/tests/security/MessagePort/event-listener-context-expected.txt: Added. 22 * http/tests/security/MessagePort/event-listener-context.html: Added. 23 * http/tests/security/MessagePort/resources: Added. 24 * http/tests/security/MessagePort/resources/attacker-frame.html: Added. 25 * http/tests/security/MessagePort/resources/banking-site.html: Added. 26 1 27 2008-09-25 David Smith <catfish.man@gmail.com> 2 28 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r36287 r36891 902 902 window.MediaList.prototype.deleteMedium [function] 903 903 window.MediaList.prototype.item [function] 904 window.MessageChannel [object MessageChannelConstructor] 905 window.MessageChannel.prototype [object MessageChannelPrototype] 904 906 window.MessageEvent [object MessageEventConstructor] 905 907 window.MessageEvent.prototype [printed above as window.Event.prototype] -
trunk/WebCore/ChangeLog
r36890 r36891 1 2008-09-24 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Sam Weinig, Anders Carlsson, and (unofficially) Adam Barth. 4 5 https://bugs.webkit.org/show_bug.cgi?id=20879 6 Implement HTML5 channel messaging 7 8 Tests: fast/events/message-channel-gc.html 9 fast/events/message-port-deleted-document.html 10 fast/events/message-port-deleted-frame.html 11 fast/events/message-port-inactive-document.html 12 fast/events/message-port.html 13 http/tests/security/MessagePort/event-listener-context.html 14 15 * Configurations/WebCore.xcconfig: 16 Removed unused ENABLE_CROSS_DOCUMENT_MESSAGING macro. 17 18 * DerivedSources.make: 19 Added MessageChannel and MessagePort. 20 21 * WebCore.pro: Made MessageEvent compilation unconditional, as it could not possibly be 22 turmed off anyway. Added new files. 23 24 * GNUmakefile.am: 25 * WebCore.pro: 26 * WebCore.vcproj/WebCore.vcproj: 27 * WebCore.xcodeproj/project.pbxproj: 28 * WebCoreSources.bkl: 29 Added new files. 30 31 * bindings/js/JSDOMWindowBase.h: 32 * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::getValueProperty): 33 Added suport for window.MessageChannel constructor. 34 35 * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::postMessage): 36 * page/DOMWindow.cpp: 37 (WebCore::DOMWindow::postMessage): 38 * page/DOMWindow.h: 39 * page/DOMWindow.idl: 40 Added support for three-argument postMessage (that posts a MessagePort). 41 42 * dom/EventTarget.cpp: 43 (WebCore::EventTarget::toMessagePort): 44 * dom/EventTarget.h: 45 * bindings/js/JSEventTargetBase.cpp: (WebCore::toJS): Added MessagePort as yet another 46 EventTarget variant. 47 48 * bindings/js/JSMessageChannelConstructor.h: 49 * bindings/js/JSMessageChannelConstructor.cpp: Added a custom constructor, so that it could 50 take a browsing context (document) parameter. 51 52 * bindings/js/JSMessageChannelCustom.cpp: Added. 53 (WebCore::JSMessageChannel::mark): JSMessageChannel uses a custom mark function to mark 54 port1 and port2 that it owns. 55 56 * bindings/js/JSMessagePortCustom.cpp: Added. 57 (WebCore::JSMessagePort::startConversation): 58 (WebCore::JSMessagePort::addEventListener): 59 (WebCore::JSMessagePort::removeEventListener): 60 (WebCore::JSMessagePort::dispatchEvent): 61 (WebCore::JSMessagePort::setOnmessage): 62 (WebCore::JSMessagePort::onmessage): 63 (WebCore::JSMessagePort::setOnclose): 64 (WebCore::JSMessagePort::onclose): 65 (WebCore::JSMessagePort::mark): 66 * dom/MessagePort.cpp: Added. 67 * dom/MessagePort.h: Added. 68 * dom/MessagePort.idl: Added. 69 Added a MessagePort implementation. Currently, it is not thread-safe at all, and only works 70 with Documents as contexts, but in the future, it will be used for communication with worker 71 threads. 72 73 * bindings/objc/DOMInternal.h: Include "DOMMessagePortInternal.h". The new APIs do not 74 really have Obj-C bindings, as they are far from being final, but a MessagePort stub is 75 needed for MessageEvent. 76 77 * bindings/scripts/CodeGeneratorJS.pm: Include PlatformString.h for MessagePort happiness. 78 79 * dom/Document.cpp: 80 (WebCore::MessagePortTimer::MessagePortTimer): 81 (WebCore::MessagePortTimer::fired): 82 (WebCore::Document::processMessagePortMessagesSoon): 83 (WebCore::Document::~Document): 84 (WebCore::Document::dispatchMessagePortEvents): 85 (WebCore::Document::createdMessagePort): 86 (WebCore::Document::destroyedMessagePort): 87 * dom/Document.h: 88 Document keeps track of all MessagePort objects that were created when it was fully active 89 in its context. 90 91 * dom/EventNames.h: Added closeEvent. 92 93 * dom/MessageChannel.cpp: Added. 94 (WebCore::MessageChannel::MessageChannel): 95 (WebCore::MessageChannel::~MessageChannel): 96 * dom/MessageChannel.h: Added. 97 (WebCore::MessageChannel::create): 98 (WebCore::MessageChannel::port1): 99 (WebCore::MessageChannel::port2): 100 * dom/MessageChannel.idl: Added. 101 Addded JSMessageChannel implementation. 102 103 * dom/MessageEvent.cpp: 104 (WebCore::MessageEvent::MessageEvent): 105 (WebCore::MessageEvent::initMessageEvent): 106 * dom/MessageEvent.h: 107 (WebCore::MessageEvent::create): 108 (WebCore::MessageEvent::messagePort): 109 * dom/MessageEvent.idl: 110 MessageEvent has a MessagePort member now, making it possible to pass ports across 111 documents. 112 1 113 2008-09-25 David Smith <catfish.man@gmail.com> 2 114 -
trunk/WebCore/Configurations/WebCore.xcconfig
r36102 r36891 16 16 17 17 // This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebKit.xcconfig and the default settings of build-webkit. 18 FEATURE_DEFINES = ENABLE_ CROSS_DOCUMENT_MESSAGING ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_XPATH ENABLE_XSLT;18 FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_XPATH ENABLE_XSLT; 19 19 20 20 SQLITE3_LIBRARY = $(SQLITE3_LIBRARY_$(MAC_OS_X_VERSION_MAJOR)); -
trunk/WebCore/DerivedSources.cpp
r36091 r36891 142 142 #include "JSMediaError.cpp" 143 143 #include "JSMediaList.cpp" 144 #include "JSMessageChannel.cpp" 144 145 #include "JSMessageEvent.cpp" 146 #include "JSMessagePort.cpp" 145 147 #include "JSMimeType.cpp" 146 148 #include "JSMimeTypeArray.cpp" -
trunk/WebCore/DerivedSources.make
r36787 r36891 161 161 MediaError \ 162 162 MediaList \ 163 MessageChannel \ 163 164 MessageEvent \ 165 MessagePort \ 164 166 MimeType \ 165 167 MimeTypeArray \ -
trunk/WebCore/GNUmakefile.am
r36886 r36891 283 283 DerivedSources/JSMediaList.cpp \ 284 284 DerivedSources/JSMediaList.h \ 285 DerivedSources/JSMessageChannel.cpp \ 286 DerivedSources/JSMessageChannel.h \ 285 287 DerivedSources/JSMessageEvent.cpp \ 286 288 DerivedSources/JSMessageEvent.h \ 289 DerivedSources/JSMessagePort.cpp \ 290 DerivedSources/JSMessagePort.h \ 287 291 DerivedSources/JSMimeType.cpp \ 288 292 DerivedSources/JSMimeType.h \ … … 407 411 WebCore/dom/EventException.idl \ 408 412 WebCore/dom/KeyboardEvent.idl \ 413 WebCore/dom/MessageChannel.idl \ 409 414 WebCore/dom/MessageEvent.idl \ 415 WebCore/dom/MessagePort.idl \ 410 416 WebCore/dom/MouseEvent.idl \ 411 417 WebCore/dom/MutationEvent.idl \ … … 675 681 WebCore/bindings/js/JSLocationCustom.cpp \ 676 682 WebCore/bindings/js/JSLocationCustom.h \ 683 WebCore/bindings/js/JSMessageChannelConstructor.cpp \ 684 WebCore/bindings/js/JSMessageChannelConstructor.h \ 685 WebCore/bindings/js/JSMessageChannelCustom.cpp \ 686 WebCore/bindings/js/JSMessagePortCustom.cpp \ 677 687 WebCore/bindings/js/JSMimeTypeArrayCustom.cpp \ 678 688 WebCore/bindings/js/JSNSResolver.cpp \ … … 938 948 WebCore/dom/MappedAttribute.h \ 939 949 WebCore/dom/MappedAttributeEntry.h \ 950 WebCore/dom/MessageChannel.cpp \ 951 WebCore/dom/MessageChannel.h \ 940 952 WebCore/dom/MessageEvent.cpp \ 941 953 WebCore/dom/MessageEvent.h \ 954 WebCore/dom/MessagePort.cpp \ 955 WebCore/dom/MessagePort.h \ 942 956 WebCore/dom/MouseEvent.cpp \ 943 957 WebCore/dom/MouseEvent.h \ -
trunk/WebCore/WebCore.pro
r36886 r36891 59 59 60 60 # Optional components (look for defs in config.h and included files!) 61 !contains(DEFINES, ENABLE_CROSS_DOCUMENT_MESSAGING=.): DEFINES += ENABLE_CROSS_DOCUMENT_MESSAGING=162 61 !contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=.): DEFINES += ENABLE_DASHBOARD_SUPPORT=0 63 62 !contains(DEFINES, ENABLE_DATABASE=.): DEFINES += ENABLE_DATABASE=1 … … 247 246 dom/KeyboardEvent.idl \ 248 247 dom/MouseEvent.idl \ 248 dom/MessageChannel.idl \ 249 dom/MessageEvent.idl \ 250 dom/MessagePort.idl \ 249 251 dom/MutationEvent.idl \ 250 252 dom/NamedNodeMap.idl \ … … 420 422 bindings/js/JSPluginCustom.cpp \ 421 423 bindings/js/JSPluginArrayCustom.cpp \ 424 bindings/js/JSMessageChannelConstructor.cpp \ 425 bindings/js/JSMessageChannelCustom.cpp \ 426 bindings/js/JSMessagePortCustom.cpp \ 422 427 bindings/js/JSMimeTypeArrayCustom.cpp \ 423 428 bindings/js/JSDOMBinding.cpp \ … … 525 530 dom/KeyboardEvent.cpp \ 526 531 dom/MappedAttribute.cpp \ 532 dom/MessageChannel.cpp \ 533 dom/MessageEvent.cpp \ 534 dom/MessagePort.cpp \ 527 535 dom/MouseEvent.cpp \ 528 536 dom/MouseRelatedEvent.cpp \ … … 1123 1131 } 1124 1132 1125 contains(DEFINES, ENABLE_CROSS_DOCUMENT_MESSAGING=1) {1126 FEATURE_DEFINES_JAVASCRIPT += ENABLE_CROSS_DOCUMENT_MESSAGING=11127 1128 SOURCES += \1129 dom/MessageEvent.cpp1130 1131 IDL_BINDINGS += \1132 dom/MessageEvent.idl1133 }1134 1135 1133 contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=0) { 1136 1134 DASHBOARDSUPPORTCSSPROPERTIES -= $$PWD/css/DashboardSupportCSSPropertyNames.in -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r36886 r36891 2 2 <VisualStudioProject 3 3 ProjectType="Visual C++" 4 Version="8 .00"4 Version="8,00" 5 5 Name="WebCore" 6 6 ProjectGUID="{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}" … … 985 985 </File> 986 986 <File 987 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMessageChannel.h" 988 > 989 </File> 990 <File 987 991 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMessageEvent.h" 992 > 993 </File> 994 <File 995 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMessagePort.h" 988 996 > 989 997 </File> … … 3354 3362 <File 3355 3363 RelativePath="..\platform\ScrollTypes.h" 3356 >3357 </File>3358 <File3359 RelativePath="..\platform\ScrollView.cpp"3360 3364 > 3361 3365 </File> … … 5461 5465 </File> 5462 5466 <File 5467 RelativePath="..\platform\network\cf\DNSCFNet.cpp" 5468 > 5469 <FileConfiguration 5470 Name="Debug_Cairo|Win32" 5471 ExcludedFromBuild="true" 5472 > 5473 <Tool 5474 Name="VCCLCompilerTool" 5475 /> 5476 </FileConfiguration> 5477 <FileConfiguration 5478 Name="Release_Cairo|Win32" 5479 ExcludedFromBuild="true" 5480 > 5481 <Tool 5482 Name="VCCLCompilerTool" 5483 /> 5484 </FileConfiguration> 5485 </File> 5486 <File 5463 5487 RelativePath="..\platform\network\cf\FormDataStreamCFNet.cpp" 5464 5488 > … … 5582 5606 <File 5583 5607 RelativePath="..\platform\network\cf\ResourceRequestCFNet.cpp" 5584 >5585 <FileConfiguration5586 Name="Debug_Cairo|Win32"5587 ExcludedFromBuild="true"5588 >5589 <Tool5590 Name="VCCLCompilerTool"5591 />5592 </FileConfiguration>5593 <FileConfiguration5594 Name="Release_Cairo|Win32"5595 ExcludedFromBuild="true"5596 >5597 <Tool5598 Name="VCCLCompilerTool"5599 />5600 </FileConfiguration>5601 </File>5602 <File5603 RelativePath="..\platform\network\cf\DNSCFNet.cpp"5604 5608 > 5605 5609 <FileConfiguration … … 10755 10759 </File> 10756 10760 <File 10761 RelativePath="..\dom\MessageChannel.cpp" 10762 > 10763 </File> 10764 <File 10765 RelativePath="..\dom\MessageChannel.h" 10766 > 10767 </File> 10768 <File 10757 10769 RelativePath="..\dom\MessageEvent.cpp" 10758 10770 > … … 10771 10783 </File> 10772 10784 <File 10785 RelativePath="..\dom\MessagePort.cpp" 10786 > 10787 </File> 10788 <File 10789 RelativePath="..\dom\MessagePort.h" 10790 > 10791 </File> 10792 <File 10773 10793 RelativePath="..\dom\MouseEvent.cpp" 10774 10794 > … … 11347 11367 </File> 11348 11368 <File 11369 RelativePath="..\dom\XMLTokenizer.h" 11370 > 11371 </File> 11372 <File 11349 11373 RelativePath="..\dom\XMLTokenizerLibxml2.cpp" 11350 11374 > … … 11357 11381 /> 11358 11382 </FileConfiguration> 11359 </File>11360 <File11361 RelativePath="..\dom\XMLTokenizer.h"11362 >11363 11383 </File> 11364 11384 </Filter> … … 13410 13430 </File> 13411 13431 <File 13432 RelativePath="..\bindings\js\JSHTMLAllCollection.cpp" 13433 > 13434 </File> 13435 <File 13412 13436 RelativePath="..\bindings\js\JSHTMLAllCollection.h" 13413 13437 > 13414 13438 </File> 13415 13439 <File 13416 RelativePath="..\bindings\js\JSHTMLAllCollection.cpp"13417 >13418 </File>13419 <File13420 13440 RelativePath="..\bindings\js\JSHTMLAppletElementCustom.cpp" 13421 13441 > … … 13515 13535 <File 13516 13536 RelativePath="..\bindings\js\JSLocationCustom.cpp" 13537 > 13538 </File> 13539 <File 13540 RelativePath="..\bindings\js\JSMessageChannelConstructor.cpp" 13541 > 13542 </File> 13543 <File 13544 RelativePath="..\bindings\js\JSMessageChannelConstructor.h" 13545 > 13546 </File> 13547 <File 13548 RelativePath="..\bindings\js\JSMessageChannelCustom.cpp" 13549 > 13550 </File> 13551 <File 13552 RelativePath="..\bindings\js\JSMessagePortCustom.cpp" 13517 13553 > 13518 13554 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r36886 r36891 4114 4114 DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CCE0A1989CA007FB8C5 /* CSSUnknownRule.h */; }; 4115 4115 DDE63ED50B7D45A800226998 /* DOMTextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A14750B7D1BAF00A53FFD /* DOMTextEvent.h */; }; 4116 E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */; }; 4117 E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E107400C0E77BDC00033AF24 /* JSMessageChannel.h */; }; 4118 E10743240E7835830033AF24 /* JSMessageChannelConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E10743230E7835830033AF24 /* JSMessageChannelConstructor.cpp */; }; 4119 E10743270E7835A50033AF24 /* JSMessageChannelConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E10743260E7835A50033AF24 /* JSMessageChannelConstructor.h */; }; 4116 4120 E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */; }; 4117 4121 E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */; }; … … 4126 4130 E1A302BC0DE8370300C52F2C /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A302BB0DE8370300C52F2C /* StringBuilder.h */; }; 4127 4131 E1A302C10DE8376900C52F2C /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A302C00DE8376900C52F2C /* StringBuilder.cpp */; }; 4132 E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */; }; 4133 E1ACAF4C0E791AAF0087D12B /* DOMMessagePort.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1ACAF4A0E791AAF0087D12B /* DOMMessagePort.mm */; }; 4134 E1ACAF4D0E791AAF0087D12B /* DOMMessagePort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ACAF4B0E791AAF0087D12B /* DOMMessagePort.h */; }; 4135 E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADECBD0E76ACF1004A1A5E /* MessagePort.h */; }; 4136 E1ADECC00E76ACF1004A1A5E /* MessagePort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1ADECBE0E76ACF1004A1A5E /* MessagePort.cpp */; }; 4137 E1ADECC70E76AD1F004A1A5E /* MessagePort.idl in Resources */ = {isa = PBXBuildFile; fileRef = E1ADECC60E76AD1F004A1A5E /* MessagePort.idl */; }; 4138 E1ADECCE0E76AD8B004A1A5E /* MessageChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADECCC0E76AD8B004A1A5E /* MessageChannel.h */; }; 4139 E1ADECCF0E76AD8B004A1A5E /* MessageChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1ADECCD0E76AD8B004A1A5E /* MessageChannel.cpp */; }; 4140 E1ADECD10E76ADAB004A1A5E /* MessageChannel.idl in Resources */ = {isa = PBXBuildFile; fileRef = E1ADECD00E76ADAB004A1A5E /* MessageChannel.idl */; }; 4141 E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1ADED460E76B8DD004A1A5E /* JSMessagePortCustom.cpp */; }; 4142 E1ADEDD50E76BD60004A1A5E /* DOMMessagePortInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADEDD40E76BD60004A1A5E /* DOMMessagePortInternal.h */; }; 4143 E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADEDD80E76BD93004A1A5E /* JSMessagePort.h */; }; 4144 E1ADEDDB0E76BD93004A1A5E /* JSMessagePort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1ADEDD90E76BD93004A1A5E /* JSMessagePort.cpp */; }; 4128 4145 E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1BE512B0CF6C512002EA959 /* XSLTUnicodeSort.cpp */; }; 4129 4146 E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1BE512C0CF6C512002EA959 /* XSLTUnicodeSort.h */; }; … … 8654 8671 DD05FE0C0B8BA3C6009ACDFE /* WebCoreObjCExtras.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WebCoreObjCExtras.c; sourceTree = "<group>"; }; 8655 8672 DD763BB10992C2C900740B8E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; }; 8673 E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannel.cpp; sourceTree = "<group>"; }; 8674 E107400C0E77BDC00033AF24 /* JSMessageChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessageChannel.h; sourceTree = "<group>"; }; 8675 E10743230E7835830033AF24 /* JSMessageChannelConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannelConstructor.cpp; sourceTree = "<group>"; }; 8676 E10743260E7835A50033AF24 /* JSMessageChannelConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessageChannelConstructor.h; sourceTree = "<group>"; }; 8656 8677 E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomXPathNSResolver.h; sourceTree = "<group>"; }; 8657 8678 E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomXPathNSResolver.cpp; sourceTree = "<group>"; }; … … 8664 8685 E1A302BB0DE8370300C52F2C /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; }; 8665 8686 E1A302C00DE8376900C52F2C /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilder.cpp; sourceTree = "<group>"; }; 8687 E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannelCustom.cpp; sourceTree = "<group>"; }; 8688 E1ACAF4A0E791AAF0087D12B /* DOMMessagePort.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessagePort.mm; sourceTree = "<group>"; }; 8689 E1ACAF4B0E791AAF0087D12B /* DOMMessagePort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMMessagePort.h; sourceTree = "<group>"; }; 8690 E1ADECBD0E76ACF1004A1A5E /* MessagePort.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MessagePort.h; sourceTree = "<group>"; }; 8691 E1ADECBE0E76ACF1004A1A5E /* MessagePort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessagePort.cpp; sourceTree = "<group>"; }; 8692 E1ADECC60E76AD1F004A1A5E /* MessagePort.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MessagePort.idl; sourceTree = "<group>"; }; 8693 E1ADECCC0E76AD8B004A1A5E /* MessageChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageChannel.h; sourceTree = "<group>"; }; 8694 E1ADECCD0E76AD8B004A1A5E /* MessageChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageChannel.cpp; sourceTree = "<group>"; }; 8695 E1ADECD00E76ADAB004A1A5E /* MessageChannel.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MessageChannel.idl; sourceTree = "<group>"; }; 8696 E1ADED460E76B8DD004A1A5E /* JSMessagePortCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessagePortCustom.cpp; sourceTree = "<group>"; }; 8697 E1ADEDD40E76BD60004A1A5E /* DOMMessagePortInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMMessagePortInternal.h; sourceTree = "<group>"; }; 8698 E1ADEDD80E76BD93004A1A5E /* JSMessagePort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessagePort.h; sourceTree = "<group>"; }; 8699 E1ADEDD90E76BD93004A1A5E /* JSMessagePort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessagePort.cpp; sourceTree = "<group>"; }; 8666 8700 E1BE512B0CF6C512002EA959 /* XSLTUnicodeSort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTUnicodeSort.cpp; sourceTree = "<group>"; }; 8667 8701 E1BE512C0CF6C512002EA959 /* XSLTUnicodeSort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLTUnicodeSort.h; sourceTree = "<group>"; }; … … 10289 10323 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */, 10290 10324 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */, 10325 E1ACAF4A0E791AAF0087D12B /* DOMMessagePort.mm */, 10326 E1ACAF4B0E791AAF0087D12B /* DOMMessagePort.h */, 10291 10327 857E0B230AB043460036E447 /* DOMMouseEvent.h */, 10292 10328 857E0B240AB043460036E447 /* DOMMouseEvent.mm */, … … 10580 10616 85E711820AC5D5350053270F /* DOMMediaListInternal.h */, 10581 10617 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */, 10618 E1ADEDD40E76BD60004A1A5E /* DOMMessagePortInternal.h */, 10582 10619 85989DC60ACC8BBD00A0BC51 /* DOMMouseEventInternal.h */, 10583 10620 85989DC70ACC8BBD00A0BC51 /* DOMMutationEventInternal.h */, … … 11718 11755 A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */, 11719 11756 A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */, 11757 E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */, 11758 E107400C0E77BDC00033AF24 /* JSMessageChannel.h */, 11720 11759 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */, 11721 11760 75793EC70D0CE72D007FC0AC /* JSMessageEvent.h */, 11761 E1ADEDD80E76BD93004A1A5E /* JSMessagePort.h */, 11762 E1ADEDD90E76BD93004A1A5E /* JSMessagePort.cpp */, 11722 11763 A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */, 11723 11764 A86629CB09DA2B47009633A5 /* JSMouseEvent.h */, … … 12672 12713 C09158860DB4209200E55AF4 /* JSInspectorCallbackWrapper.cpp */, 12673 12714 C09158870DB4209200E55AF4 /* JSInspectorCallbackWrapper.h */, 12715 E10743230E7835830033AF24 /* JSMessageChannelConstructor.cpp */, 12716 E10743260E7835A50033AF24 /* JSMessageChannelConstructor.h */, 12674 12717 BCD9C26C0C17AA81005C90A2 /* JSNamedNodesCollection.cpp */, 12675 12718 BCD9C26D0C17AA81005C90A2 /* JSNamedNodesCollection.h */, … … 12791 12834 1C5FAEE60DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp */, 12792 12835 BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */, 12836 E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */, 12837 E1ADED460E76B8DD004A1A5E /* JSMessagePortCustom.cpp */, 12793 12838 A9C6E6460D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp */, 12794 12839 BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */, … … 13673 13718 A8C4A7F309D563270003AC8D /* MappedAttribute.h */, 13674 13719 A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */, 13720 E1ADECCD0E76AD8B004A1A5E /* MessageChannel.cpp */, 13721 E1ADECCC0E76AD8B004A1A5E /* MessageChannel.h */, 13722 E1ADECD00E76ADAB004A1A5E /* MessageChannel.idl */, 13675 13723 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */, 13676 13724 75793E810D0CE0B3007FC0AC /* MessageEvent.h */, 13677 13725 75793E820D0CE0B3007FC0AC /* MessageEvent.idl */, 13726 E1ADECBE0E76ACF1004A1A5E /* MessagePort.cpp */, 13727 E1ADECBD0E76ACF1004A1A5E /* MessagePort.h */, 13728 E1ADECC60E76AD1F004A1A5E /* MessagePort.idl */, 13678 13729 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */, 13679 13730 85031B300A44EFC700F992E0 /* MouseEvent.h */, … … 15817 15868 7284ADDE0E6FEB31002EEFBD /* UserStyleSheetLoader.h in Headers */, 15818 15869 E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */, 15870 E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */, 15871 E1ADECCE0E76AD8B004A1A5E /* MessageChannel.h in Headers */, 15872 E1ADEDD50E76BD60004A1A5E /* DOMMessagePortInternal.h in Headers */, 15873 E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */, 15874 E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */, 15875 E10743270E7835A50033AF24 /* JSMessageChannelConstructor.h in Headers */, 15876 E1ACAF4D0E791AAF0087D12B /* DOMMessagePort.h in Headers */, 15819 15877 63D7B32D0E78CD3F00F7617C /* NodeRenderStyle.h in Headers */, 15820 15878 63459C650E79CD33008ADFAF /* CSSNthSelector.h in Headers */, … … 15985 16043 1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */, 15986 16044 BCEF45400E676AC1001C1287 /* TextMetrics.idl in Resources */, 16045 E1ADECC70E76AD1F004A1A5E /* MessagePort.idl in Resources */, 16046 E1ADECD10E76ADAB004A1A5E /* MessageChannel.idl in Resources */, 15987 16047 ); 15988 16048 runOnlyForDeploymentPostprocessing = 0; … … 17669 17729 7284ADDD0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp in Sources */, 17670 17730 E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */, 17731 E1ADECC00E76ACF1004A1A5E /* MessagePort.cpp in Sources */, 17732 E1ADECCF0E76AD8B004A1A5E /* MessageChannel.cpp in Sources */, 17733 E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */, 17734 E1ADEDDB0E76BD93004A1A5E /* JSMessagePort.cpp in Sources */, 17735 E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */, 17736 E10743240E7835830033AF24 /* JSMessageChannelConstructor.cpp in Sources */, 17737 E1ACAF4C0E791AAF0087D12B /* DOMMessagePort.mm in Sources */, 17738 E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */, 17671 17739 63459C660E79CD33008ADFAF /* CSSNthSelector.cpp in Sources */, 17672 17740 29FFBB820E7C5A3D00407730 /* AccessibilityList.cpp in Sources */, -
trunk/WebCore/WebCoreSources.bkl
r36886 r36891 82 82 bindings/js/JSJavaScriptCallFrameCustom.cpp 83 83 bindings/js/JSLocationCustom.cpp 84 bindings/js/JSMessageChannelConstructor.cpp 85 bindings/js/JSMessageChannelCustom.cpp 86 bindings/js/JSMessagePortCustom.cpp 84 87 bindings/js/JSMimeTypeArrayCustom.cpp 85 88 bindings/js/JSNamedNodeMapCustom.cpp … … 303 306 DerivedSources/WebCore/JSLocation.cpp 304 307 DerivedSources/WebCore/JSMediaList.cpp 308 DerivedSources/WebCore/JSMessageChannel.cpp 305 309 DerivedSources/WebCore/JSMessageEvent.cpp 310 DerivedSources/WebCore/JSMessagePort.cpp 306 311 DerivedSources/WebCore/JSMimeType.cpp 307 312 DerivedSources/WebCore/JSMimeTypeArray.cpp … … 392 397 dom/KeyboardEvent.cpp 393 398 dom/MappedAttribute.cpp 399 dom/MessageChannel.cpp 394 400 dom/MessageEvent.cpp 401 dom/MessagePort.cpp 395 402 dom/MouseEvent.cpp 396 403 dom/MouseRelatedEvent.cpp -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r36877 r36891 46 46 #include "JSHTMLOptionElementConstructor.h" 47 47 #include "JSImageConstructor.h" 48 #include "JSMessageChannelConstructor.h" 48 49 #include "JSNode.h" 49 50 #include "JSXMLHttpRequestConstructor.h" … … 189 190 Audio WebCore::JSDOMWindowBase::Audio DontDelete 190 191 Image WebCore::JSDOMWindowBase::Image DontDelete 192 MessageChannel WebCore::JSDOMWindowBase::MessageChannel DontDelete 191 193 Option WebCore::JSDOMWindowBase::Option DontDelete 192 194 XMLHttpRequest WebCore::JSDOMWindowBase::XMLHttpRequest DontDelete … … 451 453 // time 452 454 return new (exec) JSImageConstructor(exec, impl()->frame()->document()); 455 case MessageChannel: 456 if (!allowsAccessFrom(exec)) 457 return jsUndefined(); 458 return new (exec) JSMessageChannelConstructor(exec, impl()->frame()->document()); 453 459 case Option: 454 460 if (!allowsAccessFrom(exec)) -
trunk/WebCore/bindings/js/JSDOMWindowBase.h
r36675 r36891 148 148 149 149 // Constructors 150 Audio, Image, Option, XMLHttpRequest, XSLTProcessor150 Audio, Image, MessageChannel, Option, XMLHttpRequest, XSLTProcessor 151 151 }; 152 152 -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r36675 r36891 29 29 #include "FrameTree.h" 30 30 #include "JSDOMWindowShell.h" 31 #include "JSMessagePort.h" 32 #include "MessagePort.h" 31 33 #include "Settings.h" 32 34 #include "ScriptController.h" … … 176 178 return jsUndefined(); 177 179 178 String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, args.at(exec, 1)); 180 MessagePort* messagePort = (args.size() == 2) ? 0 : toMessagePort(args.at(exec, 1)); 181 182 String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, args.at(exec, (args.size() == 2) ? 1 : 2)); 179 183 if (exec->hadException()) 180 184 return jsUndefined(); 181 185 182 186 ExceptionCode ec = 0; 183 window->postMessage(message, targetOrigin, source, ec);187 window->postMessage(message, messagePort, targetOrigin, source, ec); 184 188 setDOMException(exec, ec); 185 189 -
trunk/WebCore/bindings/js/JSEventTargetBase.cpp
r36816 r36891 32 32 #include "JSEventListener.h" 33 33 #include "JSEventTargetNode.h" 34 #include "JSMessagePort.h" 34 35 #include "JSXMLHttpRequestUpload.h" 35 36 #include <kjs/Error.h> … … 295 296 return getCachedDOMObjectWrapper(cache); 296 297 #endif 298 299 if (MessagePort* messagePort = target->toMessagePort()) 300 return toJS(exec, messagePort); 297 301 298 302 ASSERT_NOT_REACHED(); -
trunk/WebCore/bindings/objc/DOMInternal.h
r36263 r36891 1 1 /* 2 * Copyright (C) 2004 -2006 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. 3 3 * Copyright (C) 2006 James G. Speth (speth@end.com) 4 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) … … 130 130 #import "DOMKeyboardEventInternal.h" 131 131 #import "DOMMediaListInternal.h" 132 #import "DOMMessagePortInternal.h" 132 133 #import "DOMMouseEventInternal.h" 133 134 #import "DOMMutationEventInternal.h" -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r36816 r36891 196 196 } 197 197 198 if ($type eq "CanvasGradient" or $type eq "XPathNSResolver" ) {198 if ($type eq "CanvasGradient" or $type eq "XPathNSResolver" or $type eq "MessagePort") { 199 199 $implIncludes{"PlatformString.h"} = 1; 200 200 } -
trunk/WebCore/dom/Document.cpp
r36820 r36891 76 76 #include "Logging.h" 77 77 #include "MessageEvent.h" 78 #include "MessagePort.h" 78 79 #include "MouseEvent.h" 79 80 #include "MouseEventWithHitTestResults.h" … … 262 263 static HashSet<Document*>* changedDocuments = 0; 263 264 265 class MessagePortTimer : public TimerBase { 266 public: 267 MessagePortTimer(PassRefPtr<Document> document) 268 : m_document(document) 269 { 270 } 271 272 private: 273 virtual void fired() 274 { 275 m_document->dispatchMessagePortEvents(); 276 delete this; 277 } 278 279 RefPtr<Document> m_document; 280 }; 281 264 282 Document::Document(Frame* frame, bool isXHTML) 265 283 : ContainerNode(0) … … 275 293 , m_xmlVersion("1.0") 276 294 , m_xmlStandalone(false) 295 , m_firedMessagePortTimer(false) 277 296 #if ENABLE(XBL) 278 297 , m_bindingManager(new XBLBindingManager(this)) … … 448 467 if (m_styleSheets) 449 468 m_styleSheets->documentDestroyed(); 469 470 HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end(); 471 for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != m_messagePorts.end(); ++iter) { 472 ASSERT((*iter)->document() == this); 473 (*iter)->contextDestroyed(); 474 if ((*iter)->entangledPort()) { 475 RefPtr<MessagePort> survivingPort = (*iter)->entangledPort(); 476 (*iter)->unentangle(); 477 if (survivingPort->document() != this) // Otherwise, survivingPort won't really survive. 478 survivingPort->queueCloseEvent(); 479 } 480 } 450 481 451 482 m_document = 0; … … 4341 4372 } 4342 4373 4374 void Document::processMessagePortMessagesSoon() 4375 { 4376 if (m_firedMessagePortTimer) 4377 return; 4378 4379 MessagePortTimer* timer = new MessagePortTimer(this); 4380 timer->startOneShot(0); 4381 4382 m_firedMessagePortTimer = true; 4383 } 4384 4385 void Document::dispatchMessagePortEvents() 4386 { 4387 RefPtr<Document> protect(this); 4388 4389 // Make a frozen copy. 4390 Vector<MessagePort*> ports; 4391 copyToVector(m_messagePorts, ports); 4392 4393 m_firedMessagePortTimer = false; 4394 4395 unsigned portCount = ports.size(); 4396 for (unsigned i = 0; i < portCount; ++i) { 4397 MessagePort* port = ports[i]; 4398 if (m_messagePorts.contains(port) && port->queueIsOpen()) 4399 port->dispatchMessages(); 4400 } 4401 } 4402 4403 void Document::createdMessagePort(MessagePort* port) 4404 { 4405 ASSERT(port); 4406 m_messagePorts.add(port); 4407 } 4408 4409 void Document::destroyedMessagePort(MessagePort* port) 4410 { 4411 ASSERT(port); 4412 m_messagePorts.remove(port); 4413 } 4414 4343 4415 void Document::initDNSPrefetch() 4344 4416 { -
trunk/WebCore/dom/Document.h
r36820 r36891 86 86 class IntPoint; 87 87 class JSNode; 88 class MessagePort; 88 89 class MouseEventWithHitTestResults; 89 90 class NodeFilter; … … 763 764 CanvasRenderingContext2D* getCSSCanvasContext(const String& type, const String& name, int width, int height); 764 765 HTMLCanvasElement* getCSSCanvasElement(const String& name); 765 766 767 void processMessagePortMessagesSoon(); 768 void dispatchMessagePortEvents(); 769 void createdMessagePort(MessagePort*); 770 void destroyedMessagePort(MessagePort*); 771 766 772 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; } 767 773 void initDNSPrefetch(); … … 921 927 String m_contentLanguage; 922 928 929 bool m_firedMessagePortTimer; 930 HashSet<MessagePort*> m_messagePorts; 931 923 932 public: 924 933 bool inPageCache(); -
trunk/WebCore/dom/EventNames.h
r35545 r36891 39 39 macro(checking) \ 40 40 macro(click) \ 41 macro(close) \ 41 42 macro(contextmenu) \ 42 43 macro(copy) \ -
trunk/WebCore/dom/EventTarget.cpp
r36820 r36891 74 74 #endif 75 75 76 MessagePort* EventTarget::toMessagePort() 77 { 78 return 0; 79 } 80 76 81 #ifndef NDEBUG 77 82 void forbidEventDispatch() -
trunk/WebCore/dom/EventTarget.h
r36820 r36891 42 42 class EventListener; 43 43 class EventTargetNode; 44 class MessagePort; 45 class RegisteredEventListener; 44 46 class SVGElementInstance; 45 47 class XMLHttpRequest; 46 class RegisteredEventListener;47 48 class XMLHttpRequestUpload; 48 49 … … 54 55 class EventTarget { 55 56 public: 57 virtual MessagePort* toMessagePort(); 56 58 virtual EventTargetNode* toNode(); 57 59 virtual XMLHttpRequest* toXMLHttpRequest(); -
trunk/WebCore/dom/MessageEvent.cpp
r34536 r36891 40 40 } 41 41 42 MessageEvent::MessageEvent(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source )42 MessageEvent::MessageEvent(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassRefPtr<MessagePort> messagePort) 43 43 : Event(messageEvent, false, true) 44 44 , m_data(data) … … 46 46 , m_lastEventId(lastEventId) 47 47 , m_source(source) 48 , m_messagePort(messagePort) 48 49 { 49 50 } … … 53 54 } 54 55 55 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& data, const String& origin, const String& lastEventId, DOMWindow* source )56 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& data, const String& origin, const String& lastEventId, DOMWindow* source, MessagePort* messagePort) 56 57 { 57 58 if (dispatched()) … … 64 65 m_lastEventId = lastEventId; 65 66 m_source = source; 67 m_messagePort = messagePort; 66 68 } 67 69 -
trunk/WebCore/dom/MessageEvent.h
r34536 r36891 30 30 31 31 #include "Event.h" 32 #include "MessagePort.h" 32 33 33 34 namespace WebCore { … … 41 42 return adoptRef(new MessageEvent); 42 43 } 43 static PassRefPtr<MessageEvent> create(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source )44 static PassRefPtr<MessageEvent> create(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassRefPtr<MessagePort> messagePort) 44 45 { 45 return adoptRef(new MessageEvent(data, origin, lastEventId, source ));46 return adoptRef(new MessageEvent(data, origin, lastEventId, source, messagePort)); 46 47 } 47 48 virtual ~MessageEvent(); 48 49 49 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& data, const String& origin, const String& lastEventId, DOMWindow* source );50 void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& data, const String& origin, const String& lastEventId, DOMWindow* source, MessagePort*); 50 51 51 52 const String& data() const { return m_data; } … … 53 54 const String& lastEventId() const { return m_lastEventId; } 54 55 DOMWindow* source() const { return m_source.get(); } 56 MessagePort* messagePort() const { return m_messagePort.get(); } 55 57 56 58 virtual bool isMessageEvent() const; … … 58 60 private: 59 61 MessageEvent(); 60 MessageEvent(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source );62 MessageEvent(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassRefPtr<MessagePort> messagePort); 61 63 62 64 String m_data; … … 64 66 String m_lastEventId; 65 67 RefPtr<DOMWindow> m_source; 68 RefPtr<MessagePort> m_messagePort; 66 69 }; 67 70 -
trunk/WebCore/dom/MessageEvent.idl
r33009 r36891 35 35 readonly attribute DOMString lastEventId; 36 36 readonly attribute DOMWindow source; 37 readonly attribute MessagePort messagePort; 37 38 38 void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in DOMWindow sourceArg );39 void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in DOMWindow sourceArg, in MessagePort messagePort); 39 40 40 41 }; -
trunk/WebCore/page/DOMWindow.cpp
r36560 r36891 348 348 #endif 349 349 350 void DOMWindow::postMessage(const String& message, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)350 void DOMWindow::postMessage(const String& message, MessagePort* messagePort, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) 351 351 { 352 352 if (!m_frame) … … 364 364 } 365 365 366 RefPtr<MessagePort> newMessagePort; 367 if (messagePort) 368 newMessagePort = messagePort->clone(document(), ec); 369 if (ec) 370 return; 371 366 372 // Capture the source of the message. We need to do this synchronously 367 373 // in order to capture the source of the message correctly. … … 372 378 373 379 // Schedule the message. 374 PostMessageTimer* timer = new PostMessageTimer(this, MessageEvent::create(message, sourceOrigin, "", source ), target.get());380 PostMessageTimer* timer = new PostMessageTimer(this, MessageEvent::create(message, sourceOrigin, "", source, newMessagePort), target.get()); 375 381 timer->startOneShot(0); 376 382 } -
trunk/WebCore/page/DOMWindow.h
r33009 r36891 48 48 class History; 49 49 class Location; 50 class MessagePort; 50 51 class Navigator; 51 52 class PostMessageTimer; … … 176 177 #endif 177 178 178 void postMessage(const String& message, const String& targetOrigin, DOMWindow* source, ExceptionCode&);179 void postMessage(const String& message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&); 179 180 void postMessageTimerFired(PostMessageTimer*); 180 181 -
trunk/WebCore/page/DOMWindow.idl
r36675 r36891 152 152 153 153 // cross-document messaging 154 [DoNotCheckDomainSecurity, Custom] void postMessage(in DOMString message, in DOMString targetOrigin)154 [DoNotCheckDomainSecurity, Custom] void postMessage(in DOMString message, in [Optional] MessagePort messagePort, in DOMString targetOrigin) 155 155 raises(DOMException); 156 156
Note: See TracChangeset
for help on using the changeset viewer.