| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Make sure we aren't connected to any of the passed-in ports. | 71 // Make sure we aren't connected to any of the passed-in ports. |
| 72 for (unsigned i = 0; i < ports.size(); ++i) { | 72 for (unsigned i = 0; i < ports.size(); ++i) { |
| 73 if (ports[i] == this) { | 73 if (ports[i] == this) { |
| 74 exception_state.ThrowDOMException( | 74 exception_state.ThrowDOMException( |
| 75 kDataCloneError, | 75 kDataCloneError, |
| 76 "Port at index " + String::Number(i) + " contains the source port."); | 76 "Port at index " + String::Number(i) + " contains the source port."); |
| 77 return; | 77 return; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 MessagePortChannelArray channels = MessagePort::DisentanglePorts( | 80 MessagePortChannelArray channels = MessagePort::DisentanglePorts( |
| 81 script_state->GetExecutionContext(), ports, exception_state); | 81 ExecutionContext::From(script_state), ports, exception_state); |
| 82 if (exception_state.HadException()) | 82 if (exception_state.HadException()) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 WebString message_string = message->ToWireString(); | 85 WebString message_string = message->ToWireString(); |
| 86 WebMessagePortChannelArray web_channels = | 86 WebMessagePortChannelArray web_channels = |
| 87 ToWebMessagePortChannelArray(std::move(channels)); | 87 ToWebMessagePortChannelArray(std::move(channels)); |
| 88 entangled_channel_->PostMessage(message_string, std::move(web_channels)); | 88 entangled_channel_->PostMessage(message_string, std::move(web_channels)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 // static | 91 // static |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 286 } |
| 287 return port_array; | 287 return port_array; |
| 288 } | 288 } |
| 289 | 289 |
| 290 DEFINE_TRACE(MessagePort) { | 290 DEFINE_TRACE(MessagePort) { |
| 291 ContextLifecycleObserver::Trace(visitor); | 291 ContextLifecycleObserver::Trace(visitor); |
| 292 EventTargetWithInlineData::Trace(visitor); | 292 EventTargetWithInlineData::Trace(visitor); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |