Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerMessageEvent.cpp

Issue 1139873002: [PROTOTYPE] ServiceWorker: Add ServiceWorkerMessageEvent impl. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/serviceworkers/ServiceWorkerMessageEvent.h"
7
8 #include "bindings/core/v8/ExceptionMessages.h"
9 #include "bindings/core/v8/ExceptionState.h"
10
11 namespace blink {
12
13 ServiceWorkerMessageEventInit::ServiceWorkerMessageEventInit()
14 {
15 }
16
17 ServiceWorkerMessageEvent::ServiceWorkerMessageEvent()
18 {
19 }
20
21 ServiceWorkerMessageEvent::ServiceWorkerMessageEvent(const AtomicString& type, c onst ServiceWorkerMessageEventInit& initializer)
22 : Event(type, initializer)
23 , m_origin(initializer.origin)
24 , m_lastEventId(initializer.lastEventId)
25 , m_source(initializer.source)
26 , m_ports(adoptPtrWillBeNoop(new MessagePortArray(initializer.ports)))
27 {
28 }
29
30 ServiceWorkerMessageEvent::~ServiceWorkerMessageEvent()
31 {
32 }
33
34 void ServiceWorkerMessageEvent::initServiceWorkerMessageEvent(const AtomicString & type, bool canBubble, bool cancelable, const String& origin, const String& las tEventId, const ServiceWorkerOrMessagePort& source, PassOwnPtrWillBeRawPtr<Messa gePortArray> ports)
35 {
36 if (dispatched())
37 return;
38
39 initEvent(type, canBubble, cancelable);
40
41 m_origin = origin;
42 m_lastEventId = lastEventId;
43 m_source = source;
44 m_ports = ports;
45 }
46
47 const AtomicString& ServiceWorkerMessageEvent::interfaceName() const
48 {
49 return EventNames::ServiceWorkerMessageEvent;
50 }
51
52 DEFINE_TRACE(ServiceWorkerMessageEvent)
53 {
54 #if ENABLE(OILPAN)
55 visitor->trace(m_ports);
56 #endif
57 Event::trace(visitor);
58 }
59
60 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerMessageEvent.h ('k') | Source/modules/serviceworkers/ServiceWorkerMessageEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698