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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // The overwhelmingly common case is sending a single port, so handle that effic
iently with an inline buffer of size 1. | 50 // The overwhelmingly common case is sending a single port, so handle that effic
iently with an inline buffer of size 1. |
51 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray; | 51 typedef WillBeHeapVector<RefPtrWillBeMember<MessagePort>, 1> MessagePortArray; |
52 | 52 |
53 // Not to be confused with WebMessagePortChannelArray; this one uses Vector and
OwnPtr instead of WebVector and raw pointers. | 53 // Not to be confused with WebMessagePortChannelArray; this one uses Vector and
OwnPtr instead of WebVector and raw pointers. |
54 typedef Vector<OwnPtr<WebMessagePortChannel>, 1> MessagePortChannelArray; | 54 typedef Vector<OwnPtr<WebMessagePortChannel>, 1> MessagePortChannelArray; |
55 | 55 |
56 class MessagePort FINAL : public RefCountedWillBeGarbageCollectedFinalized<Messa
gePort> | 56 class MessagePort FINAL : public RefCountedWillBeGarbageCollectedFinalized<Messa
gePort> |
57 , public ActiveDOMObject | 57 , public ActiveDOMObject |
58 , public EventTargetWithInlineData | 58 , public EventTargetWithInlineData |
59 , public WebMessagePortChannelClient { | 59 , public WebMessagePortChannelClient { |
| 60 DEFINE_WRAPPERTYPEINFO(); |
60 REFCOUNTED_EVENT_TARGET(MessagePort); | 61 REFCOUNTED_EVENT_TARGET(MessagePort); |
61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MessagePort); | 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MessagePort); |
62 public: | 63 public: |
63 static PassRefPtrWillBeRawPtr<MessagePort> create(ExecutionContext&); | 64 static PassRefPtrWillBeRawPtr<MessagePort> create(ExecutionContext&); |
64 virtual ~MessagePort(); | 65 virtual ~MessagePort(); |
65 | 66 |
66 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> messag
e, const MessagePortArray*, ExceptionState&); | 67 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> messag
e, const MessagePortArray*, ExceptionState&); |
67 | 68 |
68 void start(); | 69 void start(); |
69 void close(); | 70 void close(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 115 |
115 bool m_started; | 116 bool m_started; |
116 bool m_closed; | 117 bool m_closed; |
117 | 118 |
118 WeakPtrFactory<MessagePort> m_weakFactory; | 119 WeakPtrFactory<MessagePort> m_weakFactory; |
119 }; | 120 }; |
120 | 121 |
121 } // namespace blink | 122 } // namespace blink |
122 | 123 |
123 #endif // MessagePort_h | 124 #endif // MessagePort_h |
OLD | NEW |