Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js |
index 4eb14ee1c41337b805f2ce65186b0f8b21219380..7af935f4f8fc01756980e46dcce5018ddc620e67 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js |
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js |
@@ -3,18 +3,17 @@ self.onmessage = function(e) { |
clients.forEach(function(client) { |
var messageChannel = new MessageChannel(); |
messageChannel.port1.onmessage = |
- onMessageViaMessagePort.bind(null, client); |
- client.postMessage({port: messageChannel.port2}, |
- [messageChannel.port2]); |
+ onMessageViaMessagePort.bind(null, messageChannel.port1); |
+ client.postMessage(undefined, [messageChannel.port2]); |
}); |
})); |
}; |
-function onMessageViaMessagePort(client, e) { |
+function onMessageViaMessagePort(port, e) { |
var message = e.data; |
if ('value' in message) { |
- client.postMessage({ack: 'Acking value: ' + message.value}); |
+ port.postMessage({ack: 'Acking value: ' + message.value}); |
} else if ('done' in message) { |
- client.postMessage({done: true}); |
+ port.postMessage({done: true}); |
} |
} |