Closed Bug 1142015 Opened 5 years ago Closed 5 years ago

Implement serviceWorker.postMessage API spec changes

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: catalinb, Assigned: catalinb)

References

Details

Attachments

(1 file, 2 obsolete files)

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.
Attachment #8575951 - Flags: review?(amarchesini)
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+
Attachment #8575951 - Attachment is obsolete: true
Attachment #8578167 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/dbdd76cde1de
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.