| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const AtomicString& interfaceName() const override; | 98 const AtomicString& interfaceName() const override; |
| 99 ExecutionContext* getExecutionContext() const override { | 99 ExecutionContext* getExecutionContext() const override { |
| 100 return ContextLifecycleObserver::getExecutionContext(); | 100 return ContextLifecycleObserver::getExecutionContext(); |
| 101 } | 101 } |
| 102 MessagePort* toMessagePort() override { return this; } | 102 MessagePort* toMessagePort() override { return this; } |
| 103 | 103 |
| 104 // ScriptWrappable implementation. | 104 // ScriptWrappable implementation. |
| 105 bool hasPendingActivity() const final; | 105 bool hasPendingActivity() const final; |
| 106 | 106 |
| 107 // ContextLifecycleObserver implementation. | 107 // ContextLifecycleObserver implementation. |
| 108 void contextDestroyed() override { close(); } | 108 void contextDestroyed(ExecutionContext*) override { close(); } |
| 109 | 109 |
| 110 void setOnmessage(EventListener* listener) { | 110 void setOnmessage(EventListener* listener) { |
| 111 setAttributeEventListener(EventTypeNames::message, listener); | 111 setAttributeEventListener(EventTypeNames::message, listener); |
| 112 start(); | 112 start(); |
| 113 } | 113 } |
| 114 EventListener* onmessage() { | 114 EventListener* onmessage() { |
| 115 return getAttributeEventListener(EventTypeNames::message); | 115 return getAttributeEventListener(EventTypeNames::message); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // A port starts out its life entangled, and remains entangled until it is | 118 // A port starts out its life entangled, and remains entangled until it is |
| (...skipping 23 matching lines...) Expand all Loading... |
| 142 | 142 |
| 143 WebMessagePortChannelUniquePtr m_entangledChannel; | 143 WebMessagePortChannelUniquePtr m_entangledChannel; |
| 144 | 144 |
| 145 bool m_started; | 145 bool m_started; |
| 146 bool m_closed; | 146 bool m_closed; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace blink | 149 } // namespace blink |
| 150 | 150 |
| 151 #endif // MessagePort_h | 151 #endif // MessagePort_h |
| OLD | NEW |