Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 m_unconfirmedMessageCount = m_queuedEarlyTasks.size(); | 195 m_unconfirmedMessageCount = m_queuedEarlyTasks.size(); |
| 196 m_workerThreadHadPendingActivity = true; // Worker initialization means a pe nding activity. | 196 m_workerThreadHadPendingActivity = true; // Worker initialization means a pe nding activity. |
| 197 | 197 |
| 198 for (auto& earlyTasks : m_queuedEarlyTasks) | 198 for (auto& earlyTasks : m_queuedEarlyTasks) |
| 199 m_workerThread->postTask(FROM_HERE, earlyTasks.release()); | 199 m_workerThread->postTask(FROM_HERE, earlyTasks.release()); |
| 200 m_queuedEarlyTasks.clear(); | 200 m_queuedEarlyTasks.clear(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void WorkerMessagingProxy::workerObjectDestroyed() | 203 void WorkerMessagingProxy::workerObjectDestroyed() |
| 204 { | 204 { |
| 205 m_workerObject = nullptr; | 205 ASSERT(!m_workerObject); |
|
sof
2015/08/14 05:06:57
Spelling it out why it must be so would be a usefu
peria
2015/08/14 05:23:10
Done.
| |
| 206 m_executionContext->postTask(FROM_HERE, createCrossThreadTask(&WorkerMessagi ngProxy::workerObjectDestroyedInternal, this)); | 206 m_executionContext->postTask(FROM_HERE, createCrossThreadTask(&WorkerMessagi ngProxy::workerObjectDestroyedInternal, this)); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void WorkerMessagingProxy::workerObjectDestroyedInternal() | 209 void WorkerMessagingProxy::workerObjectDestroyedInternal() |
| 210 { | 210 { |
| 211 m_mayBeDestroyed = true; | 211 m_mayBeDestroyed = true; |
| 212 if (m_workerThread) | 212 if (m_workerThread) |
| 213 terminateWorkerGlobalScope(); | 213 terminateWorkerGlobalScope(); |
| 214 else | 214 else |
| 215 workerThreadTerminated(); | 215 workerThreadTerminated(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 | 286 |
| 287 // FIXME: This need to be revisited when we support nested worker one day | 287 // FIXME: This need to be revisited when we support nested worker one day |
| 288 ASSERT(m_executionContext->isDocument()); | 288 ASSERT(m_executionContext->isDocument()); |
| 289 Document* document = toDocument(m_executionContext.get()); | 289 Document* document = toDocument(m_executionContext.get()); |
| 290 LocalFrame* frame = document->frame(); | 290 LocalFrame* frame = document->frame(); |
| 291 if (frame) | 291 if (frame) |
| 292 frame->console().adoptWorkerMessagesAfterTermination(this); | 292 frame->console().adoptWorkerMessagesAfterTermination(this); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |