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

Side by Side Diff: Source/modules/serviceworkers/StashedPortCollection.h

Issue 1008533005: Initial implementation of stashed message ports, blink side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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 #ifndef StashedPortCollection_h
6 #define StashedPortCollection_h
7
8 #include "core/dom/ContextLifecycleObserver.h"
9 #include "core/events/EventTarget.h"
10 #include "modules/serviceworkers/StashedMessagePort.h"
11 #include "wtf/RefCounted.h"
12
13 namespace blink {
14 class ScriptState;
15 class ScriptValue;
16 class ServiceWorkerGlobalScope;
17
18 class StashedPortCollection final
19 : public EventTargetWithInlineData
20 , public RefCountedWillBeNoBase<StashedPortCollection>
21 , public ContextLifecycleObserver {
22 DEFINE_WRAPPERTYPEINFO();
23 REFCOUNTED_EVENT_TARGET(StashedPortCollection);
24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StashedPortCollection);
25 WTF_MAKE_NONCOPYABLE(StashedPortCollection);
26 public:
27 static PassRefPtrWillBeRawPtr<StashedPortCollection> create(ExecutionContext *);
28 virtual ~StashedPortCollection();
29
30 void addPorts(const StashedMessagePortArray&);
31
32 // StashedPortCollection.idl
33 PassRefPtrWillBeRawPtr<StashedMessagePort> add(ScriptState*, const String& n ame, MessagePort*);
34
35 // EventTarget overrides.
36 const AtomicString& interfaceName() const override;
37 ExecutionContext* executionContext() const override;
38
39 DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
40
41 DECLARE_VIRTUAL_TRACE();
42
43 private:
44 explicit StashedPortCollection(ExecutionContext*);
45
46 StashedMessagePortArray m_ports;
47 };
48
49 } // namespace blink
50
51 #endif // StashedPortCollection_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/StashedMessagePort.idl ('k') | Source/modules/serviceworkers/StashedPortCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698