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