| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 , m_peer(0) | 374 , m_peer(0) |
| 375 { | 375 { |
| 376 ASSERT(m_workerClientWrapper.get()); | 376 ASSERT(m_workerClientWrapper.get()); |
| 377 } | 377 } |
| 378 | 378 |
| 379 WorkerThreadableWebSocketChannel::Bridge::~Bridge() | 379 WorkerThreadableWebSocketChannel::Bridge::~Bridge() |
| 380 { | 380 { |
| 381 disconnect(); | 381 disconnect(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 class WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask : pub
lic ExecutionContextTask { | 384 class WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask FINAL
: public ExecutionContextTask { |
| 385 public: | 385 public: |
| 386 static PassOwnPtr<ExecutionContextTask> create(WorkerThreadableWebSocketChan
nel::Peer* peer, WorkerLoaderProxy* loaderProxy, PassRefPtr<ThreadableWebSocketC
hannelClientWrapper> workerClientWrapper) | 386 static PassOwnPtr<ExecutionContextTask> create(WorkerThreadableWebSocketChan
nel::Peer* peer, WorkerLoaderProxy* loaderProxy, PassRefPtr<ThreadableWebSocketC
hannelClientWrapper> workerClientWrapper) |
| 387 { | 387 { |
| 388 return adoptPtr(new WorkerGlobalScopeDidInitializeTask(peer, loaderProxy
, workerClientWrapper)); | 388 return adoptPtr(new WorkerGlobalScopeDidInitializeTask(peer, loaderProxy
, workerClientWrapper)); |
| 389 } | 389 } |
| 390 | 390 |
| 391 virtual ~WorkerGlobalScopeDidInitializeTask() { } | 391 virtual ~WorkerGlobalScopeDidInitializeTask() { } |
| 392 virtual void performTask(ExecutionContext* context) OVERRIDE | 392 virtual void performTask(ExecutionContext* context) OVERRIDE |
| 393 { | 393 { |
| 394 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); | 394 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 WorkerRunLoop& runLoop = m_workerGlobalScope->thread()->runLoop(); | 663 WorkerRunLoop& runLoop = m_workerGlobalScope->thread()->runLoop(); |
| 664 MessageQueueWaitResult result = MessageQueueMessageReceived; | 664 MessageQueueWaitResult result = MessageQueueMessageReceived; |
| 665 ThreadableWebSocketChannelClientWrapper* clientWrapper = m_workerClientWrapp
er.get(); | 665 ThreadableWebSocketChannelClientWrapper* clientWrapper = m_workerClientWrapp
er.get(); |
| 666 while (m_workerGlobalScope && clientWrapper && !clientWrapper->syncMethodDon
e() && result != MessageQueueTerminated) { | 666 while (m_workerGlobalScope && clientWrapper && !clientWrapper->syncMethodDon
e() && result != MessageQueueTerminated) { |
| 667 result = runLoop.runInMode(m_workerGlobalScope.get(), m_taskMode); // Ma
y cause this bridge to get disconnected, which makes m_workerGlobalScope become
null. | 667 result = runLoop.runInMode(m_workerGlobalScope.get(), m_taskMode); // Ma
y cause this bridge to get disconnected, which makes m_workerGlobalScope become
null. |
| 668 clientWrapper = m_workerClientWrapper.get(); | 668 clientWrapper = m_workerClientWrapper.get(); |
| 669 } | 669 } |
| 670 } | 670 } |
| 671 | 671 |
| 672 } // namespace WebCore | 672 } // namespace WebCore |
| OLD | NEW |