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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 bool started() const { return m_started; } | 86 bool started() const { return m_started; } |
87 | 87 |
88 const AtomicString& interfaceName() const override; | 88 const AtomicString& interfaceName() const override; |
89 ExecutionContext* executionContext() const override { return ActiveDOMObject
::executionContext(); } | 89 ExecutionContext* executionContext() const override { return ActiveDOMObject
::executionContext(); } |
90 MessagePort* toMessagePort() override { return this; } | 90 MessagePort* toMessagePort() override { return this; } |
91 | 91 |
92 // ActiveDOMObject implementation. | 92 // ActiveDOMObject implementation. |
93 bool hasPendingActivity() const override; | 93 bool hasPendingActivity() const override; |
94 void stop() override { close(); } | 94 void stop() override { close(); } |
95 | 95 |
96 void setOnmessage(PassRefPtr<EventListener> listener) | 96 void setOnmessage(PassRefPtrWillBeRawPtr<EventListener> listener) |
97 { | 97 { |
98 setAttributeEventListener(EventTypeNames::message, listener); | 98 setAttributeEventListener(EventTypeNames::message, listener); |
99 start(); | 99 start(); |
100 } | 100 } |
101 EventListener* onmessage() { return getAttributeEventListener(EventTypeNames
::message); } | 101 EventListener* onmessage() { return getAttributeEventListener(EventTypeNames
::message); } |
102 | 102 |
103 // A port starts out its life entangled, and remains entangled until it is c
losed or is cloned. | 103 // A port starts out its life entangled, and remains entangled until it is c
losed or is cloned. |
104 bool isEntangled() const { return !m_closed && !isNeutered(); } | 104 bool isEntangled() const { return !m_closed && !isNeutered(); } |
105 | 105 |
106 // A port gets neutered when it is transferred to a new owner via postMessag
e(). | 106 // A port gets neutered when it is transferred to a new owner via postMessag
e(). |
(...skipping 18 matching lines...) Expand all Loading... |
125 bool m_closed; | 125 bool m_closed; |
126 | 126 |
127 WeakPtrFactory<MessagePort> m_weakFactory; | 127 WeakPtrFactory<MessagePort> m_weakFactory; |
128 | 128 |
129 RefPtr<ScriptState> m_scriptStateForConversion; | 129 RefPtr<ScriptState> m_scriptStateForConversion; |
130 }; | 130 }; |
131 | 131 |
132 } // namespace blink | 132 } // namespace blink |
133 | 133 |
134 #endif // MessagePort_h | 134 #endif // MessagePort_h |
OLD | NEW |