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

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

Issue 307943002: Oilpan: Prepare moving InspectorController and InspectorAgents to oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 * 24 *
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 28
29 #include "core/workers/WorkerThread.h" 29 #include "core/workers/WorkerThread.h"
30 30
31 #include "bindings/core/v8/ScriptSourceCode.h" 31 #include "bindings/core/v8/ScriptSourceCode.h"
32 #include "core/inspector/InspectorInstrumentation.h" 32 #include "core/inspector/InspectorInstrumentation.h"
33 #include "core/inspector/WorkerInspectorController.h"
33 #include "core/workers/DedicatedWorkerGlobalScope.h" 34 #include "core/workers/DedicatedWorkerGlobalScope.h"
34 #include "core/workers/WorkerClients.h" 35 #include "core/workers/WorkerClients.h"
35 #include "core/workers/WorkerReportingProxy.h" 36 #include "core/workers/WorkerReportingProxy.h"
36 #include "core/workers/WorkerThreadStartupData.h" 37 #include "core/workers/WorkerThreadStartupData.h"
37 #include "platform/PlatformThreadData.h" 38 #include "platform/PlatformThreadData.h"
38 #include "platform/heap/ThreadState.h" 39 #include "platform/heap/ThreadState.h"
39 #include "platform/weborigin/KURL.h" 40 #include "platform/weborigin/KURL.h"
40 #include "public/platform/Platform.h" 41 #include "public/platform/Platform.h"
41 #include "public/platform/WebWaitableEvent.h" 42 #include "public/platform/WebWaitableEvent.h"
42 #include "public/platform/WebWorkerRunLoop.h" 43 #include "public/platform/WebWorkerRunLoop.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 m_threadID = createThread(WorkerThread::workerThreadStart, this, "WebCore: W orker"); 95 m_threadID = createThread(WorkerThread::workerThreadStart, this, "WebCore: W orker");
95 96
96 return m_threadID; 97 return m_threadID;
97 } 98 }
98 99
99 void WorkerThread::workerThreadStart(void* thread) 100 void WorkerThread::workerThreadStart(void* thread)
100 { 101 {
101 static_cast<WorkerThread*>(thread)->workerThread(); 102 static_cast<WorkerThread*>(thread)->workerThread();
102 } 103 }
103 104
105 void WorkerThread::interruptAndDispatchInspectorCommands()
106 {
107 MutexLocker locker(m_workerInspectorControllerMutex);
108 if (m_workerInspectorController)
109 m_workerInspectorController->interruptAndDispatchInspectorCommands();
110 }
111
104 void WorkerThread::workerThread() 112 void WorkerThread::workerThread()
105 { 113 {
106 KURL scriptURL = m_startupData->m_scriptURL; 114 KURL scriptURL = m_startupData->m_scriptURL;
107 String sourceCode = m_startupData->m_sourceCode; 115 String sourceCode = m_startupData->m_sourceCode;
108 WorkerThreadStartMode startMode = m_startupData->m_startMode; 116 WorkerThreadStartMode startMode = m_startupData->m_startMode;
109 117
110 { 118 {
111 MutexLocker lock(m_threadCreationMutex); 119 MutexLocker lock(m_threadCreationMutex);
112 ThreadState::attach(); 120 ThreadState::attach();
113 m_workerGlobalScope = createWorkerGlobalScope(m_startupData.release()); 121 m_workerGlobalScope = createWorkerGlobalScope(m_startupData.release());
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return; 246 return;
239 } 247 }
240 m_runLoop.terminate(); 248 m_runLoop.terminate();
241 } 249 }
242 250
243 bool WorkerThread::isCurrentThread() const 251 bool WorkerThread::isCurrentThread() const
244 { 252 {
245 return m_threadID == currentThread(); 253 return m_threadID == currentThread();
246 } 254 }
247 255
256 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
257 {
258 MutexLocker locker(m_workerInspectorControllerMutex);
259 m_workerInspectorController = workerInspectorController;
260 }
261
248 } // namespace WebCore 262 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698