| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 break; | 211 break; |
| 212 } | 212 } |
| 213 | 213 |
| 214 RefPtr<SerializedScriptValue> message; | 214 RefPtr<SerializedScriptValue> message; |
| 215 std::unique_ptr<MessagePortChannelArray> channels; | 215 std::unique_ptr<MessagePortChannelArray> channels; |
| 216 if (!tryGetMessage(message, channels)) | 216 if (!tryGetMessage(message, channels)) |
| 217 break; | 217 break; |
| 218 | 218 |
| 219 MessagePortArray* ports = | 219 MessagePortArray* ports = |
| 220 MessagePort::entanglePorts(*getExecutionContext(), std::move(channels)); | 220 MessagePort::entanglePorts(*getExecutionContext(), std::move(channels)); |
| 221 Event* evt = MessageEvent::create(ports, message.release()); | 221 Event* evt = MessageEvent::create(ports, std::move(message)); |
| 222 | 222 |
| 223 dispatchEvent(evt); | 223 dispatchEvent(evt); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool MessagePort::hasPendingActivity() const { | 227 bool MessagePort::hasPendingActivity() const { |
| 228 // The spec says that entangled message ports should always be treated as if | 228 // The spec says that entangled message ports should always be treated as if |
| 229 // they have a strong reference. | 229 // they have a strong reference. |
| 230 // We'll also stipulate that the queue needs to be open (if the app drops its | 230 // We'll also stipulate that the queue needs to be open (if the app drops its |
| 231 // reference to the port before start()-ing it, then it's not really entangled | 231 // reference to the port before start()-ing it, then it's not really entangled |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 return portArray; | 289 return portArray; |
| 290 } | 290 } |
| 291 | 291 |
| 292 DEFINE_TRACE(MessagePort) { | 292 DEFINE_TRACE(MessagePort) { |
| 293 ContextLifecycleObserver::trace(visitor); | 293 ContextLifecycleObserver::trace(visitor); |
| 294 EventTargetWithInlineData::trace(visitor); | 294 EventTargetWithInlineData::trace(visitor); |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace blink | 297 } // namespace blink |
| OLD | NEW |