| 1129 | | == `[TransferList]`(p) == #TransferList |
| 1130 | | |
| 1131 | | Summary: `[TransferList]` allows a SerializedScriptValue parameter used |
| 1132 | | with the structured clone algorithm to specify another parameter used |
| 1133 | | to pass the transfer list. |
| 1134 | | |
| 1135 | | Usage: The possible usage is `[TransferList=XXX]` where `XXX` is another |
| 1136 | | parameter in the same method signature as the SerializedScriptValue |
| 1137 | | parameter on which the modifier is placed. The referenced parameter |
| 1138 | | should be of type "Array" to be compatible with the Web Messaging |
| 1139 | | standard. |
| 1140 | | |
| 1141 | | When this modifier is used, the code generation automatically creates |
| 1142 | | a MessagePortArray and completes the structured clone algorithm using |
| 1143 | | the input data from the JavaScript caller. The resulting |
| 1144 | | MessagePortArray is then passed to the implementation's method |
| 1145 | | signature in place of the Array parameter referenced. |
| 1146 | | |
| 1147 | | Example: |
| 1148 | | {{{ |
| 1149 | | interface Worker { |
| 1150 | | void postMessage([TransferList=transfer] SerializedScriptValue data, [Default=Undefined] optional Array transfer); |
| 1151 | | } |
| 1152 | | }}} |
| 1153 | | And in the implementation: |
| 1154 | | {{{ |
| 1155 | | class Worker { |
| 1156 | | virtual void postMessage(PassRefPtr<SerializedScriptValue> data, const MessagePortArray& ports); |
| 1157 | | } |
| 1158 | | }}} |
| 1159 | | |