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

Side by Side Diff: Source/core/workers/WorkerThread.cpp

Issue 887463003: Turn WorkerLoaderProxy into a threadsafe, ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clarify WorkerLoaderProxyProvider's obligations on shutdown Created 5 years, 10 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/core/workers/WorkerThread.h ('k') | Source/modules/serviceworkers/ServiceWorkerThread.h » ('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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 ASSERT(context->isWorkerGlobalScope()); 244 ASSERT(context->isWorkerGlobalScope());
245 m_thread->runDebuggerTask(WorkerThread::DontWaitForMessage); 245 m_thread->runDebuggerTask(WorkerThread::DontWaitForMessage);
246 } 246 }
247 247
248 private: 248 private:
249 explicit RunDebuggerQueueTask(WorkerThread* thread) : m_thread(thread) { } 249 explicit RunDebuggerQueueTask(WorkerThread* thread) : m_thread(thread) { }
250 250
251 WorkerThread* m_thread; 251 WorkerThread* m_thread;
252 }; 252 };
253 253
254 WorkerThread::WorkerThread(WorkerLoaderProxy& workerLoaderProxy, WorkerReporting Proxy& workerReportingProxy, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> sta rtupData) 254 WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, Work erReportingProxy& workerReportingProxy, PassOwnPtrWillBeRawPtr<WorkerThreadStart upData> startupData)
255 : m_terminated(false) 255 : m_terminated(false)
256 , m_workerLoaderProxy(workerLoaderProxy) 256 , m_workerLoaderProxy(workerLoaderProxy)
257 , m_workerReportingProxy(workerReportingProxy) 257 , m_workerReportingProxy(workerReportingProxy)
258 , m_startupData(startupData) 258 , m_startupData(startupData)
259 , m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent() )) 259 , m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent() ))
260 , m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEven t())) 260 , m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEven t()))
261 { 261 {
262 MutexLocker lock(threadSetMutex()); 262 MutexLocker lock(threadSetMutex());
263 workerThreads().add(this); 263 workerThreads().add(this);
264 } 264 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); 553 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get());
554 } 554 }
555 555
556 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) 556 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
557 { 557 {
558 MutexLocker locker(m_workerInspectorControllerMutex); 558 MutexLocker locker(m_workerInspectorControllerMutex);
559 m_workerInspectorController = workerInspectorController; 559 m_workerInspectorController = workerInspectorController;
560 } 560 }
561 561
562 } // namespace blink 562 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerThread.h ('k') | Source/modules/serviceworkers/ServiceWorkerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698