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

Side by Side Diff: Source/modules/navigatorconnect/ServicePortConnectEvent.h

Issue 1210633002: Update navigator.services API to use the new services.onconnect event [1/3]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@serviceport-part3
Patch Set: rebase Created 5 years, 5 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 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
OLDNEW
« no previous file with comments | « Source/modules/navigatorconnect/ServicePortCollection.idl ('k') | Source/modules/navigatorconnect/ServicePortConnectEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698