Implement serviceWorker.postMessage API spec changes

RESOLVED FIXED in Firefox 39

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: catalinb, Assigned: catalinb)

Tracking

Trunk
mozilla39
x86
All
Points:
---

Firefox Tracking Flags

(firefox39 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

4 years ago
http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-postmessage

MessageEvents should have a source object.
MessageEvent should contain an array of message ports.
(Assignee)

Comment 1

4 years ago
Created attachment 8575951 [details] [diff] [review]
Add source for messages dispatched to a Service Worker.
(Assignee)

Updated

4 years ago
Attachment #8575951 - Flags: review?(amarchesini)
(Assignee)

Updated

4 years ago
Blocks: 1059784
(Assignee)

Comment 2

4 years ago
The webidl change for MessageEvent is being tracked here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28199.
Comment on attachment 8575951 [details] [diff] [review]
Add source for messages dispatched to a Service Worker.

Review of attachment 8575951 [details] [diff] [review]:
-----------------------------------------------------------------

Just 1 thing: SetSource(workers::ServiceWorker* aServiceWorker); is not actually used. Remove it and file a follow-up for that.

::: dom/events/MessageEvent.h
@@ +17,5 @@
>  struct MessageEventInit;
>  class MessagePort;
>  class MessagePortBase;
>  class MessagePortList;
> +class OwningWindowProxyOrMessagePortOrServiceWorkerOrClient;

remove this.

@@ +19,5 @@
>  class MessagePortBase;
>  class MessagePortList;
> +class OwningWindowProxyOrMessagePortOrServiceWorkerOrClient;
> +
> +typedef OwningWindowProxyOrMessagePortOrServiceWorkerOrClient MessageEventSource;

we don't need this, right?

@@ +68,5 @@
>  
>    // Non WebIDL methods
>    void SetSource(mozilla::dom::MessagePort* aPort);
>  
> +  void SetSource(workers::ServiceWorker* aServiceWorker);

You don't actually use this.

::: dom/webidl/MessageEvent.webidl
@@ +6,5 @@
>   * For more information on this interface, please see
>   * http://www.whatwg.org/specs/web-apps/current-work/#messageevent
>   */
>  
> +typedef (WindowProxy or MessagePort or ServiceWorker or Client) MessageEventSource;

I don't think this change is part of http://www.whatwg.org/specs/web-apps/current-work/#messageevent
Add the URL of the  new spec at line 7.

::: dom/workers/WorkerPrivate.cpp
@@ +3103,5 @@
>  void
>  WorkerPrivateParent<Derived>::PostMessageInternal(
>                                              JSContext* aCx,
>                                              JS::Handle<JS::Value> aMessage,
>                                              const Optional<Sequence<JS::Value> >& aTransferable,

can you fix the indentation of this method?
Attachment #8575951 - Flags: review?(amarchesini) → review+
(Assignee)

Comment 4

4 years ago
Created attachment 8578167 [details] [diff] [review]
Add source for messages dispatched to a Service Worker.
(Assignee)

Comment 5

4 years ago
Created attachment 8578207 [details] [diff] [review]
Add source for messages dispatched to a Service Worker.
(Assignee)

Comment 6

4 years ago
Comment on attachment 8578207 [details] [diff] [review]
Add source for messages dispatched to a Service Worker.

https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=dbdd76cde1de
Attachment #8578207 - Flags: checkin+
(Assignee)

Updated

4 years ago
Attachment #8575951 - Attachment is obsolete: true
(Assignee)

Updated

4 years ago
Attachment #8578167 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/dbdd76cde1de
Status: NEW → RESOLVED
Last Resolved: 4 years ago
status-firefox39: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.