OLD | NEW |
(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 ServicePortConnectEvent_h |
| 6 #define ServicePortConnectEvent_h |
| 7 |
| 8 #include "modules/EventModules.h" |
| 9 #include "modules/ModulesExport.h" |
| 10 #include "modules/serviceworkers/ExtendableEvent.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class AcceptConnectionObserver; |
| 16 class ExceptionState; |
| 17 class ServicePortConnectEventInit; |
| 18 |
| 19 // A connect event is dispatched by the client to a service worker's script. |
| 20 // AcceptConnectionObserver can be used to notify the client about the service |
| 21 // worker's response. |
| 22 class MODULES_EXPORT ServicePortConnectEvent final : public ExtendableEvent { |
| 23 DEFINE_WRAPPERTYPEINFO(); |
| 24 public: |
| 25 static PassRefPtrWillBeRawPtr<ServicePortConnectEvent> create(); |
| 26 static PassRefPtrWillBeRawPtr<ServicePortConnectEvent> create(const AtomicSt
ring& type, const ServicePortConnectEventInit&); |
| 27 static PassRefPtrWillBeRawPtr<ServicePortConnectEvent> create(const AtomicSt
ring& type, const ServicePortConnectEventInit&, AcceptConnectionObserver*); |
| 28 |
| 29 // ServicePortConnectEvent.idl |
| 30 String targetURL() const { return m_targetURL; } |
| 31 String origin() const { return m_origin; } |
| 32 ScriptPromise respondWith(ScriptState*, const ScriptPromise& response, Excep
tionState&); |
| 33 |
| 34 const AtomicString& interfaceName() const override; |
| 35 |
| 36 DECLARE_VIRTUAL_TRACE(); |
| 37 |
| 38 protected: |
| 39 ServicePortConnectEvent(); |
| 40 ServicePortConnectEvent(const AtomicString& type, const ServicePortConnectEv
entInit&, AcceptConnectionObserver*); |
| 41 |
| 42 private: |
| 43 PersistentWillBeMember<AcceptConnectionObserver> m_observer; |
| 44 String m_targetURL; |
| 45 String m_origin; |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // ServicePortConnectEvent_h |
OLD | NEW |