| Index: Source/modules/navigatorconnect/ServicePort.h
|
| diff --git a/Source/modules/navigatorconnect/ServicePort.h b/Source/modules/navigatorconnect/ServicePort.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0aeddb3a9b941d91c0642c339791615941149ff3
|
| --- /dev/null
|
| +++ b/Source/modules/navigatorconnect/ServicePort.h
|
| @@ -0,0 +1,54 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef ServicePort_h
|
| +#define ServicePort_h
|
| +
|
| +#include "bindings/core/v8/ScriptWrappable.h"
|
| +#include "modules/ModulesExport.h"
|
| +#include "public/platform/modules/navigator_services/WebServicePort.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class ExceptionState;
|
| +class ExecutionContext;
|
| +class MessagePort;
|
| +class ScriptState;
|
| +class ScriptValue;
|
| +class SerializedScriptValue;
|
| +class ServicePortCollection;
|
| +
|
| +typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray;
|
| +
|
| +class MODULES_EXPORT ServicePort final
|
| + : public GarbageCollectedFinalized<ServicePort>, public ScriptWrappable {
|
| + DEFINE_WRAPPERTYPEINFO();
|
| + WTF_MAKE_NONCOPYABLE(ServicePort);
|
| +public:
|
| + static ServicePort* create(WeakPtrWillBeRawPtr<ServicePortCollection>, const WebServicePort&);
|
| + virtual ~ServicePort();
|
| +
|
| + WebServicePortID id() const { return m_port.id; }
|
| +
|
| + // ServicePort.idl
|
| + String targetURL() const;
|
| + String name() const;
|
| + ScriptValue data(ScriptState*) const;
|
| + void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, ExceptionState&);
|
| + void close();
|
| +
|
| + DEFINE_INLINE_VIRTUAL_TRACE() { }
|
| +
|
| +private:
|
| + explicit ServicePort(WeakPtrWillBeRawPtr<ServicePortCollection>, const WebServicePort&);
|
| +
|
| + bool m_isOpen;
|
| + WebServicePort m_port;
|
| + RefPtr<SerializedScriptValue> m_serializedData;
|
| + WeakPtrWillBeWeakMember<ServicePortCollection> m_collection;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // ServicePort_h
|
|
|