OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 211 } |
212 | 212 |
213 void ThreadableWebSocketChannelClientWrapper::resume() | 213 void ThreadableWebSocketChannelClientWrapper::resume() |
214 { | 214 { |
215 m_suspended = false; | 215 m_suspended = false; |
216 processPendingTasks(); | 216 processPendingTasks(); |
217 } | 217 } |
218 | 218 |
219 void ThreadableWebSocketChannelClientWrapper::processPendingTasksCallback(Script
ExecutionContext* context, PassRefPtr<ThreadableWebSocketChannelClientWrapper> w
rapper) | 219 void ThreadableWebSocketChannelClientWrapper::processPendingTasksCallback(Script
ExecutionContext* context, PassRefPtr<ThreadableWebSocketChannelClientWrapper> w
rapper) |
220 { | 220 { |
221 ASSERT_UNUSED(context, context->isWorkerContext()); | 221 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); |
222 wrapper->processPendingTasks(); | 222 wrapper->processPendingTasks(); |
223 } | 223 } |
224 | 224 |
225 void ThreadableWebSocketChannelClientWrapper::processPendingTasks() | 225 void ThreadableWebSocketChannelClientWrapper::processPendingTasks() |
226 { | 226 { |
227 if (m_suspended) | 227 if (m_suspended) |
228 return; | 228 return; |
229 if (!m_syncMethodDone) { | 229 if (!m_syncMethodDone) { |
230 // When a synchronous operation is in progress (i.e. the execution stack
contains | 230 // When a synchronous operation is in progress (i.e. the execution stack
contains |
231 // WorkerThreadableWebSocketChannel::waitForMethodCompletion()), we cann
ot invoke callbacks in this run loop. | 231 // WorkerThreadableWebSocketChannel::waitForMethodCompletion()), we cann
ot invoke callbacks in this run loop. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 } | 281 } |
282 | 282 |
283 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(Scr
iptExecutionContext* context, PassRefPtr<ThreadableWebSocketChannelClientWrapper
> wrapper) | 283 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(Scr
iptExecutionContext* context, PassRefPtr<ThreadableWebSocketChannelClientWrapper
> wrapper) |
284 { | 284 { |
285 ASSERT_UNUSED(context, !context); | 285 ASSERT_UNUSED(context, !context); |
286 if (wrapper->m_client) | 286 if (wrapper->m_client) |
287 wrapper->m_client->didReceiveMessageError(); | 287 wrapper->m_client->didReceiveMessageError(); |
288 } | 288 } |
289 | 289 |
290 } // namespace WebCore | 290 } // namespace WebCore |
OLD | NEW |