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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 { | 231 { |
232 WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy-
>pageInspector(); | 232 WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy-
>pageInspector(); |
233 if (!pageInspector) | 233 if (!pageInspector) |
234 return; | 234 return; |
235 pageInspector->dispatchMessageFromWorker(message); | 235 pageInspector->dispatchMessageFromWorker(message); |
236 | 236 |
237 } | 237 } |
238 | 238 |
239 void WebSharedWorkerImpl::workerGlobalScopeClosed() | 239 void WebSharedWorkerImpl::workerGlobalScopeClosed() |
240 { | 240 { |
241 Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(&WebSh
aredWorkerImpl::workerGlobalScopeClosedOnMainThread, AllowCrossThreadAccess(this
))); | 241 Platform::current()->mainThread()->defaultTaskRunner()->postTask(FROM_HERE,
threadSafeBind(&WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread, AllowC
rossThreadAccess(this))); |
242 } | 242 } |
243 | 243 |
244 void WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread() | 244 void WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread() |
245 { | 245 { |
246 m_client->workerContextClosed(); | 246 m_client->workerContextClosed(); |
247 | 247 |
248 terminateWorkerThread(); | 248 terminateWorkerThread(); |
249 } | 249 } |
250 | 250 |
251 void WebSharedWorkerImpl::workerGlobalScopeStarted(WorkerGlobalScope*) | 251 void WebSharedWorkerImpl::workerGlobalScopeStarted(WorkerGlobalScope*) |
252 { | 252 { |
253 } | 253 } |
254 | 254 |
255 void WebSharedWorkerImpl::workerThreadTerminated() | 255 void WebSharedWorkerImpl::workerThreadTerminated() |
256 { | 256 { |
257 Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(&WebSh
aredWorkerImpl::workerThreadTerminatedOnMainThread, AllowCrossThreadAccess(this)
)); | 257 Platform::current()->mainThread()->defaultTaskRunner()->postTask(FROM_HERE,
threadSafeBind(&WebSharedWorkerImpl::workerThreadTerminatedOnMainThread, AllowCr
ossThreadAccess(this))); |
258 } | 258 } |
259 | 259 |
260 void WebSharedWorkerImpl::workerThreadTerminatedOnMainThread() | 260 void WebSharedWorkerImpl::workerThreadTerminatedOnMainThread() |
261 { | 261 { |
262 m_client->workerContextDestroyed(); | 262 m_client->workerContextDestroyed(); |
263 // The lifetime of this proxy is controlled by the worker context. | 263 // The lifetime of this proxy is controlled by the worker context. |
264 delete this; | 264 delete this; |
265 } | 265 } |
266 | 266 |
267 // WorkerLoaderProxyProvider ---------------------------------------------------
-------- | 267 // WorkerLoaderProxyProvider ---------------------------------------------------
-------- |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 if (devtoolsAgent) | 394 if (devtoolsAgent) |
395 devtoolsAgent->dispatchOnInspectorBackend(message); | 395 devtoolsAgent->dispatchOnInspectorBackend(message); |
396 } | 396 } |
397 | 397 |
398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
399 { | 399 { |
400 return new WebSharedWorkerImpl(client); | 400 return new WebSharedWorkerImpl(client); |
401 } | 401 } |
402 | 402 |
403 } // namespace blink | 403 } // namespace blink |
OLD | NEW |