| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Make sure we aren't connected to any of the passed-in ports. | 70 // Make sure we aren't connected to any of the passed-in ports. |
| 71 for (unsigned i = 0; i < ports.size(); ++i) { | 71 for (unsigned i = 0; i < ports.size(); ++i) { |
| 72 if (ports[i] == this) { | 72 if (ports[i] == this) { |
| 73 exceptionState.throwDOMException( | 73 exceptionState.throwDOMException( |
| 74 DataCloneError, | 74 DataCloneError, |
| 75 "Port at index " + String::number(i) + " contains the source port."); | 75 "Port at index " + String::number(i) + " contains the source port."); |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 MessagePortChannelArray channels = | 79 MessagePortChannelArray channels = MessagePort::disentanglePorts( |
| 80 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports, | 80 scriptState->getExecutionContext(), ports, exceptionState); |
| 81 exceptionState); | |
| 82 if (exceptionState.hadException()) | 81 if (exceptionState.hadException()) |
| 83 return; | 82 return; |
| 84 | 83 |
| 85 WebString messageString = message->toWireString(); | 84 WebString messageString = message->toWireString(); |
| 86 WebMessagePortChannelArray webChannels = | 85 WebMessagePortChannelArray webChannels = |
| 87 toWebMessagePortChannelArray(std::move(channels)); | 86 toWebMessagePortChannelArray(std::move(channels)); |
| 88 m_entangledChannel->postMessage(messageString, std::move(webChannels)); | 87 m_entangledChannel->postMessage(messageString, std::move(webChannels)); |
| 89 } | 88 } |
| 90 | 89 |
| 91 // static | 90 // static |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 276 } |
| 278 return portArray; | 277 return portArray; |
| 279 } | 278 } |
| 280 | 279 |
| 281 DEFINE_TRACE(MessagePort) { | 280 DEFINE_TRACE(MessagePort) { |
| 282 ContextLifecycleObserver::trace(visitor); | 281 ContextLifecycleObserver::trace(visitor); |
| 283 EventTargetWithInlineData::trace(visitor); | 282 EventTargetWithInlineData::trace(visitor); |
| 284 } | 283 } |
| 285 | 284 |
| 286 } // namespace blink | 285 } // namespace blink |
| OLD | NEW |