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