Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(869)

Side by Side Diff: Source/web/WebSharedWorkerImpl.cpp

Issue 1303153005: Introduce WebTaskRunner Patch 3/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing #include Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/WebKit.cpp ('k') | Source/web/tests/FrameTestHelpers.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()->taskRunner()->postTask(FROM_HERE, threadS afeBind(&WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread, AllowCrossThr eadAccess(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()->taskRunner()->postTask(FROM_HERE, threadS afeBind(&WebSharedWorkerImpl::workerThreadTerminatedOnMainThread, AllowCrossThre adAccess(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
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
OLDNEW
« no previous file with comments | « Source/web/WebKit.cpp ('k') | Source/web/tests/FrameTestHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698