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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (!isEntangled()) | 61 if (!isEntangled()) |
62 return; | 62 return; |
63 ASSERT(m_scriptExecutionContext); | 63 ASSERT(m_scriptExecutionContext); |
64 | 64 |
65 OwnPtr<MessagePortChannelArray> channels; | 65 OwnPtr<MessagePortChannelArray> channels; |
66 // Make sure we aren't connected to any of the passed-in ports. | 66 // Make sure we aren't connected to any of the passed-in ports. |
67 if (ports) { | 67 if (ports) { |
68 for (unsigned int i = 0; i < ports->size(); ++i) { | 68 for (unsigned int i = 0; i < ports->size(); ++i) { |
69 MessagePort* dataPort = (*ports)[i].get(); | 69 MessagePort* dataPort = (*ports)[i].get(); |
70 if (dataPort == this || m_entangledChannel->isConnectedTo(dataPort))
{ | 70 if (dataPort == this || m_entangledChannel->isConnectedTo(dataPort))
{ |
71 es.throwDOMException(InvalidStateError); | 71 es.throwDOMException(DataCloneError); |
72 return; | 72 return; |
73 } | 73 } |
74 } | 74 } |
75 channels = MessagePort::disentanglePorts(ports, es); | 75 channels = MessagePort::disentanglePorts(ports, es); |
76 if (es.hadException()) | 76 if (es.hadException()) |
77 return; | 77 return; |
78 } | 78 } |
79 m_entangledChannel->postMessageToRemote(message, channels.release()); | 79 m_entangledChannel->postMessageToRemote(message, channels.release()); |
80 } | 80 } |
81 | 81 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 { | 234 { |
235 return &m_eventTargetData; | 235 return &m_eventTargetData; |
236 } | 236 } |
237 | 237 |
238 EventTargetData* MessagePort::ensureEventTargetData() | 238 EventTargetData* MessagePort::ensureEventTargetData() |
239 { | 239 { |
240 return &m_eventTargetData; | 240 return &m_eventTargetData; |
241 } | 241 } |
242 | 242 |
243 } // namespace WebCore | 243 } // namespace WebCore |
OLD | NEW |