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

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

Issue 1274023003: compositor-worker: Get the thread to run compositor-workers from the Platform. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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
« no previous file with comments | « Source/core/workers/SharedWorkerThread.cpp ('k') | Source/core/workers/WorkerThread.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) 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 virtual ~WorkerThread(); 61 virtual ~WorkerThread();
62 62
63 // Called on the main thread. 63 // Called on the main thread.
64 void start(PassOwnPtr<WorkerThreadStartupData>); 64 void start(PassOwnPtr<WorkerThreadStartupData>);
65 void terminate(); 65 void terminate();
66 66
67 // Returns the thread this worker runs on. Some implementations can create 67 // Returns the thread this worker runs on. Some implementations can create
68 // a new thread on the first call (e.g. shared, dedicated workers), whereas 68 // a new thread on the first call (e.g. shared, dedicated workers), whereas
69 // some implementations can use an existing thread that is already being 69 // some implementations can use an existing thread that is already being
70 // used by other workers (e.g. compositor workers). 70 // used by other workers (e.g. compositor workers).
71 virtual WebThreadSupportingGC& backingThread() = 0; 71 virtual WebThread& backingThread() = 0;
72 72
73 virtual void didStartRunLoop(); 73 virtual void didStartRunLoop();
74 virtual void didStopRunLoop(); 74 virtual void didStopRunLoop();
75 75
76 v8::Isolate* isolate() const { return m_isolate; } 76 v8::Isolate* isolate() const { return m_isolate; }
77 77
78 // Can be used to wait for this worker thread to shut down. 78 // Can be used to wait for this worker thread to shut down.
79 // (This is signaled on the main thread, so it's assumed to be waited on 79 // (This is signaled on the main thread, so it's assumed to be waited on
80 // the worker context thread) 80 // the worker context thread)
81 WebWaitableEvent* shutdownEvent() { return m_shutdownEvent.get(); } 81 WebWaitableEvent* shutdownEvent() { return m_shutdownEvent.get(); }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 friend class WorkerMicrotaskRunner; 143 friend class WorkerMicrotaskRunner;
144 144
145 // Called on the main thread. 145 // Called on the main thread.
146 void terminateInternal(); 146 void terminateInternal();
147 147
148 // Called on the worker thread. 148 // Called on the worker thread.
149 void initialize(PassOwnPtr<WorkerThreadStartupData>); 149 void initialize(PassOwnPtr<WorkerThreadStartupData>);
150 void shutdown(); 150 void shutdown();
151 void performShutdownTask(); 151 void performShutdownTask();
152 void performIdleWork(double deadlineSeconds); 152 void performIdleWork(double deadlineSeconds);
153 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas k>, long long delayMs);
154 153
155 bool m_started; 154 bool m_started;
156 bool m_terminated; 155 bool m_terminated;
157 bool m_shutdown; 156 bool m_shutdown;
158 MessageQueue<WebThread::Task> m_debuggerMessageQueue; 157 MessageQueue<WebThread::Task> m_debuggerMessageQueue;
159 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; 158 OwnPtr<WebThread::TaskObserver> m_microtaskRunner;
160 159
161 RefPtr<WorkerLoaderProxy> m_workerLoaderProxy; 160 RefPtr<WorkerLoaderProxy> m_workerLoaderProxy;
162 WorkerReportingProxy& m_workerReportingProxy; 161 WorkerReportingProxy& m_workerReportingProxy;
163 RawPtr<WebScheduler> m_webScheduler; // Not owned. 162 RawPtr<WebScheduler> m_webScheduler; // Not owned.
164 163
165 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorControlle r; 164 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorControlle r;
166 Mutex m_workerInspectorControllerMutex; 165 Mutex m_workerInspectorControllerMutex;
167 166
168 // This lock protects |m_workerGlobalScope|, |m_terminated|, |m_isolate| and |m_microtaskRunner|. 167 // This lock protects |m_workerGlobalScope|, |m_terminated|, |m_isolate| and |m_microtaskRunner|.
169 Mutex m_threadStateMutex; 168 Mutex m_threadStateMutex;
170 169
171 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; 170 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope;
172 171
172 OwnPtr<GCSupportForWebThread> m_gcSupport;
kinuko 2015/08/10 05:01:21 I'm a bit confused. Regular workers own WebThreadS
sadrul 2015/08/10 06:51:20 Oh crud. You are right. Sorry, I meant to clean th
173 v8::Isolate* m_isolate; 173 v8::Isolate* m_isolate;
174 174
175 // Used to signal thread shutdown. 175 // Used to signal thread shutdown.
176 OwnPtr<WebWaitableEvent> m_shutdownEvent; 176 OwnPtr<WebWaitableEvent> m_shutdownEvent;
177 177
178 // Used to signal thread termination. 178 // Used to signal thread termination.
179 OwnPtr<WebWaitableEvent> m_terminationEvent; 179 OwnPtr<WebWaitableEvent> m_terminationEvent;
180 }; 180 };
181 181
182 } // namespace blink 182 } // namespace blink
183 183
184 #endif // WorkerThread_h 184 #endif // WorkerThread_h
OLDNEW
« no previous file with comments | « Source/core/workers/SharedWorkerThread.cpp ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698