OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #ifndef MessageChannel_h | 27 #ifndef MessageChannel_h |
28 #define MessageChannel_h | 28 #define MessageChannel_h |
29 | 29 |
30 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
31 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
32 #include "wtf/RefPtr.h" | |
33 | 32 |
34 namespace blink { | 33 namespace blink { |
35 | 34 |
36 class MessagePort; | 35 class MessagePort; |
37 class ExecutionContext; | 36 class ExecutionContext; |
38 | 37 |
39 class MessageChannel final : public GarbageCollectedFinalized<MessageChannel>, p
ublic ScriptWrappable { | 38 class MessageChannel final : public GarbageCollectedFinalized<MessageChannel>, p
ublic ScriptWrappable { |
40 DEFINE_WRAPPERTYPEINFO(); | 39 DEFINE_WRAPPERTYPEINFO(); |
41 public: | 40 public: |
42 static MessageChannel* create(ExecutionContext* context) | 41 static MessageChannel* create(ExecutionContext* context) |
43 { | 42 { |
44 return new MessageChannel(context); | 43 return new MessageChannel(context); |
45 } | 44 } |
46 | 45 |
47 MessagePort* port1() const { return m_port1; } | 46 MessagePort* port1() const { return m_port1; } |
48 MessagePort* port2() const { return m_port2; } | 47 MessagePort* port2() const { return m_port2; } |
49 | 48 |
50 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
51 | 50 |
52 private: | 51 private: |
53 explicit MessageChannel(ExecutionContext*); | 52 explicit MessageChannel(ExecutionContext*); |
54 | 53 |
55 Member<MessagePort> m_port1; | 54 Member<MessagePort> m_port1; |
56 Member<MessagePort> m_port2; | 55 Member<MessagePort> m_port2; |
57 }; | 56 }; |
58 | 57 |
59 } // namespace blink | 58 } // namespace blink |
60 | 59 |
61 #endif // MessageChannel_h | 60 #endif // MessageChannel_h |
OLD | NEW |