OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 CrossOriginConnectEvent_h | |
6 #define CrossOriginConnectEvent_h | |
7 | |
8 #include "modules/EventModules.h" | |
9 #include "modules/ModulesExport.h" | |
10 #include "platform/heap/Handle.h" | |
11 | |
12 namespace blink { | |
13 | |
14 class AcceptConnectionObserver; | |
15 class CrossOriginServiceWorkerClient; | |
16 | |
17 // A crossoriginconnect event is dispatched by the client to a service worker's | |
18 // script. AcceptConnectionObserver can be used to notify the client about the | |
19 // service worker's response. | |
20 class MODULES_EXPORT CrossOriginConnectEvent final : public Event { | |
21 DEFINE_WRAPPERTYPEINFO(); | |
22 public: | |
23 static PassRefPtrWillBeRawPtr<CrossOriginConnectEvent> create(); | |
24 static PassRefPtrWillBeRawPtr<CrossOriginConnectEvent> create(AcceptConnecti
onObserver*, CrossOriginServiceWorkerClient*); | |
25 | |
26 CrossOriginServiceWorkerClient* client() const; | |
27 | |
28 void acceptConnection(ScriptState*, const ScriptPromise&, ExceptionState&); | |
29 | |
30 const AtomicString& interfaceName() const override; | |
31 | |
32 DECLARE_VIRTUAL_TRACE(); | |
33 | |
34 protected: | |
35 CrossOriginConnectEvent(); | |
36 CrossOriginConnectEvent(AcceptConnectionObserver*, CrossOriginServiceWorkerC
lient*); | |
37 | |
38 private: | |
39 PersistentWillBeMember<AcceptConnectionObserver> m_observer; | |
40 PersistentWillBeMember<CrossOriginServiceWorkerClient> m_client; | |
41 }; | |
42 | |
43 } // namespace blink | |
44 | |
45 #endif // CrossOriginConnectEvent_h | |
OLD | NEW |