| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 const String& message) { | 265 const String& message) { |
| 266 m_workerInspectorProxy->dispatchMessageFromWorker(message); | 266 m_workerInspectorProxy->dispatchMessageFromWorker(message); |
| 267 } | 267 } |
| 268 | 268 |
| 269 ParentFrameTaskRunners* WebSharedWorkerImpl::getParentFrameTaskRunners() { | 269 ParentFrameTaskRunners* WebSharedWorkerImpl::getParentFrameTaskRunners() { |
| 270 return m_parentFrameTaskRunners.get(); | 270 return m_parentFrameTaskRunners.get(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void WebSharedWorkerImpl::didCloseWorkerGlobalScope() { | 273 void WebSharedWorkerImpl::didCloseWorkerGlobalScope() { |
| 274 getParentFrameTaskRunners() | 274 getParentFrameTaskRunners() |
| 275 ->get(TaskType::Internal) | 275 ->get(TaskType::InternalTimer) |
| 276 ->postTask( | 276 ->postTask( |
| 277 BLINK_FROM_HERE, | 277 BLINK_FROM_HERE, |
| 278 crossThreadBind( | 278 crossThreadBind( |
| 279 &WebSharedWorkerImpl::didCloseWorkerGlobalScopeOnMainThread, | 279 &WebSharedWorkerImpl::didCloseWorkerGlobalScopeOnMainThread, |
| 280 crossThreadUnretained(this))); | 280 crossThreadUnretained(this))); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void WebSharedWorkerImpl::didCloseWorkerGlobalScopeOnMainThread() { | 283 void WebSharedWorkerImpl::didCloseWorkerGlobalScopeOnMainThread() { |
| 284 m_client->workerContextClosed(); | 284 m_client->workerContextClosed(); |
| 285 | 285 |
| 286 terminateWorkerThread(); | 286 terminateWorkerThread(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void WebSharedWorkerImpl::didTerminateWorkerThread() { | 289 void WebSharedWorkerImpl::didTerminateWorkerThread() { |
| 290 getParentFrameTaskRunners() | 290 getParentFrameTaskRunners() |
| 291 ->get(TaskType::Internal) | 291 ->get(TaskType::InternalTimer) |
| 292 ->postTask(BLINK_FROM_HERE, | 292 ->postTask(BLINK_FROM_HERE, |
| 293 crossThreadBind( | 293 crossThreadBind( |
| 294 &WebSharedWorkerImpl::didTerminateWorkerThreadOnMainThread, | 294 &WebSharedWorkerImpl::didTerminateWorkerThreadOnMainThread, |
| 295 crossThreadUnretained(this))); | 295 crossThreadUnretained(this))); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void WebSharedWorkerImpl::didTerminateWorkerThreadOnMainThread() { | 298 void WebSharedWorkerImpl::didTerminateWorkerThreadOnMainThread() { |
| 299 m_client->workerContextDestroyed(); | 299 m_client->workerContextDestroyed(); |
| 300 // The lifetime of this proxy is controlled by the worker context. | 300 // The lifetime of this proxy is controlled by the worker context. |
| 301 delete this; | 301 delete this; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 if (devtoolsAgent) | 460 if (devtoolsAgent) |
| 461 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 461 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
| 462 message); | 462 message); |
| 463 } | 463 } |
| 464 | 464 |
| 465 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 465 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
| 466 return new WebSharedWorkerImpl(client); | 466 return new WebSharedWorkerImpl(client); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace blink | 469 } // namespace blink |
| OLD | NEW |