Chromium Code Reviews| Index: Source/modules/serviceworkers/StashedMessagePort.h |
| diff --git a/Source/modules/serviceworkers/StashedMessagePort.h b/Source/modules/serviceworkers/StashedMessagePort.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..21f1a7a95de91fcdc5a4bff6494c1ba746f2dfef |
| --- /dev/null |
| +++ b/Source/modules/serviceworkers/StashedMessagePort.h |
| @@ -0,0 +1,42 @@ |
| +// 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 StashedMessagePort_h |
| +#define StashedMessagePort_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/dom/MessagePort.h" |
| + |
| +namespace blink { |
| +class ExecutionContext; |
| +class StashedMessagePort; |
| + |
| +typedef WillBeHeapVector<RefPtrWillBeMember<StashedMessagePort>, 1> StashedMessagePortArray; |
| + |
| +class StashedMessagePort final |
|
scheib
2015/05/06 21:44:31
Class comment
Marijn Kruisselbrink
2015/05/12 06:56:40
Done.
|
| + : public MessagePort { |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + static PassRefPtrWillBeRawPtr<StashedMessagePort> create(ExecutionContext&, PassOwnPtr<WebMessagePortChannel>, const String& name); |
| + virtual ~StashedMessagePort(); |
| + |
| + static PassOwnPtrWillBeRawPtr<StashedMessagePortArray> toStashedMessagePortArray(ExecutionContext*, const WebMessagePortChannelArray&, const WebVector<WebString>& channelKeys); |
| + |
| + String name() const; |
|
scheib
2015/05/06 21:44:31
// StashedMessagePort.idl
Marijn Kruisselbrink
2015/05/12 06:56:40
Done.
|
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| +private: |
| + void messageAvailable() override; |
| + void dispatchMessages(); |
| + |
| + explicit StashedMessagePort(ExecutionContext&, PassOwnPtr<WebMessagePortChannel>, const String& name); |
| + |
| + WeakPtrFactory<StashedMessagePort> m_weakFactory; |
|
scheib
2015/05/06 21:44:30
WeakPtrFactory best practice is as last member to
Marijn Kruisselbrink
2015/05/12 06:56:41
Done.
|
| + String m_name; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // StashedMessagePort_h |