| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 return; | 203 return; |
| 204 | 204 |
| 205 RefPtr<SerializedScriptValue> message; | 205 RefPtr<SerializedScriptValue> message; |
| 206 OwnPtr<MessagePortChannelArray> channels; | 206 OwnPtr<MessagePortChannelArray> channels; |
| 207 while (tryGetMessage(message, channels)) { | 207 while (tryGetMessage(message, channels)) { |
| 208 // close() in Worker onmessage handler should prevent next message from
dispatching. | 208 // close() in Worker onmessage handler should prevent next message from
dispatching. |
| 209 if (getExecutionContext()->isWorkerGlobalScope() && toWorkerGlobalScope(
getExecutionContext())->isClosing()) | 209 if (getExecutionContext()->isWorkerGlobalScope() && toWorkerGlobalScope(
getExecutionContext())->isClosing()) |
| 210 return; | 210 return; |
| 211 | 211 |
| 212 MessagePortArray* ports = MessagePort::entanglePorts(*getExecutionContex
t(), channels.release()); | 212 MessagePortArray* ports = MessagePort::entanglePorts(*getExecutionContex
t(), channels.release()); |
| 213 RefPtrWillBeRawPtr<Event> evt = MessageEvent::create(ports, message.rele
ase()); | 213 RawPtr<Event> evt = MessageEvent::create(ports, message.release()); |
| 214 | 214 |
| 215 dispatchEvent(evt.release()); | 215 dispatchEvent(evt.release()); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool MessagePort::hasPendingActivity() const | 219 bool MessagePort::hasPendingActivity() const |
| 220 { | 220 { |
| 221 // The spec says that entangled message ports should always be treated as if
they have a strong reference. | 221 // The spec says that entangled message ports should always be treated as if
they have a strong reference. |
| 222 // We'll also stipulate that the queue needs to be open (if the app drops it
s reference to the port before start()-ing it, then it's not really entangled as
it's unreachable). | 222 // We'll also stipulate that the queue needs to be open (if the app drops it
s reference to the port before start()-ing it, then it's not really entangled as
it's unreachable). |
| 223 return m_started && isEntangled(); | 223 return m_started && isEntangled(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 { | 289 { |
| 290 ASSERT(getExecutionContext()); | 290 ASSERT(getExecutionContext()); |
| 291 if (!m_scriptStateForConversion) { | 291 if (!m_scriptStateForConversion) { |
| 292 v8::Isolate* isolate = scriptIsolate(); | 292 v8::Isolate* isolate = scriptIsolate(); |
| 293 m_scriptStateForConversion = ScriptState::create(v8::Context::New(isolat
e), DOMWrapperWorld::create(isolate)); | 293 m_scriptStateForConversion = ScriptState::create(v8::Context::New(isolat
e), DOMWrapperWorld::create(isolate)); |
| 294 } | 294 } |
| 295 return m_scriptStateForConversion->context(); | 295 return m_scriptStateForConversion->context(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace blink | 298 } // namespace blink |
| OLD | NEW |