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

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

Issue 1191393003: Update client side navigator.connect API to use ServicePortCollection [1/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@serviceport
Patch Set: address more comments Created 5 years, 6 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 ServicePort_h
6 #define ServicePort_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/MessagePort.h"
10 #include "modules/ModulesExport.h"
11 #include "public/platform/modules/navigator_services/WebServicePort.h"
12
13 namespace blink {
14
15 class ExceptionState;
16 class ExecutionContext;
17 class MessagePort;
18 class ScriptState;
19 class ScriptValue;
20 class SerializedScriptValue;
21 class ServicePortCollection;
22
23 class MODULES_EXPORT ServicePort final
24 : public GarbageCollectedFinalized<ServicePort>, public ScriptWrappable {
25 DEFINE_WRAPPERTYPEINFO();
26 WTF_MAKE_NONCOPYABLE(ServicePort);
27 public:
28 static ServicePort* create(ServicePortCollection*, const WebServicePort&);
29 virtual ~ServicePort();
30
31 WebServicePortID id() const { return m_port.id; }
32
33 // ServicePort.idl
34 String targetURL() const;
35 String name() const;
36 ScriptValue data(ScriptState*) const;
37 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> messag e, const MessagePortArray*, ExceptionState&);
38 void close();
39
40 DECLARE_VIRTUAL_TRACE();
41
42 private:
43 ServicePort(ServicePortCollection*, const WebServicePort&);
44
45 bool m_isOpen;
46 WebServicePort m_port;
47 RefPtr<SerializedScriptValue> m_serializedData;
48 Member<ServicePortCollection> m_collection;
49 };
50
51 } // namespace blink
52
53 #endif // ServicePort_h
OLDNEW
« no previous file with comments | « Source/modules/navigatorconnect/NavigatorServices.h ('k') | Source/modules/navigatorconnect/ServicePort.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698