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

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

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/core/workers/WorkerInspectorProxy.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool isCurrentThread(); 89 bool isCurrentThread();
90 WorkerLoaderProxy* workerLoaderProxy() const 90 WorkerLoaderProxy* workerLoaderProxy() const
91 { 91 {
92 RELEASE_ASSERT(m_workerLoaderProxy); 92 RELEASE_ASSERT(m_workerLoaderProxy);
93 return m_workerLoaderProxy.get(); 93 return m_workerLoaderProxy.get();
94 } 94 }
95 95
96 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin gProxy; } 96 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin gProxy; }
97 97
98 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>); 98 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>);
99 void appendDebuggerTask(PassOwnPtr<WebThread::Task>); 99 void appendDebuggerTask(PassOwnPtr<WebTaskRunner::Task>);
100 100
101 enum WaitMode { WaitForMessage, DontWaitForMessage }; 101 enum WaitMode { WaitForMessage, DontWaitForMessage };
102 MessageQueueWaitResult runDebuggerTask(WaitMode = WaitForMessage); 102 MessageQueueWaitResult runDebuggerTask(WaitMode = WaitForMessage);
103 103
104 // These methods should be called if the holder of the thread is 104 // These methods should be called if the holder of the thread is
105 // going to call runDebuggerTask in a loop. 105 // going to call runDebuggerTask in a loop.
106 void willEnterNestedLoop(); 106 void willEnterNestedLoop();
107 void didLeaveNestedLoop(); 107 void didLeaveNestedLoop();
108 108
109 // Can be called only on the worker thread, WorkerGlobalScope is not thread safe. 109 // Can be called only on the worker thread, WorkerGlobalScope is not thread safe.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Called on the worker thread. 149 // Called on the worker thread.
150 void initialize(PassOwnPtr<WorkerThreadStartupData>); 150 void initialize(PassOwnPtr<WorkerThreadStartupData>);
151 void shutdown(); 151 void shutdown();
152 void performShutdownTask(); 152 void performShutdownTask();
153 void performIdleWork(double deadlineSeconds); 153 void performIdleWork(double deadlineSeconds);
154 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas k>, long long delayMs); 154 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas k>, long long delayMs);
155 155
156 bool m_started; 156 bool m_started;
157 bool m_terminated; 157 bool m_terminated;
158 bool m_shutdown; 158 bool m_shutdown;
159 MessageQueue<WebThread::Task> m_debuggerMessageQueue; 159 MessageQueue<WebTaskRunner::Task> m_debuggerMessageQueue;
160 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; 160 OwnPtr<WebThread::TaskObserver> m_microtaskRunner;
161 161
162 RefPtr<WorkerLoaderProxy> m_workerLoaderProxy; 162 RefPtr<WorkerLoaderProxy> m_workerLoaderProxy;
163 WorkerReportingProxy& m_workerReportingProxy; 163 WorkerReportingProxy& m_workerReportingProxy;
164 RawPtr<WebScheduler> m_webScheduler; // Not owned. 164 RawPtr<WebScheduler> m_webScheduler; // Not owned.
165 165
166 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorControlle r; 166 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorControlle r;
167 Mutex m_workerInspectorControllerMutex; 167 Mutex m_workerInspectorControllerMutex;
168 168
169 // This lock protects |m_workerGlobalScope|, |m_terminated|, |m_isolate| and |m_microtaskRunner|. 169 // This lock protects |m_workerGlobalScope|, |m_terminated|, |m_isolate| and |m_microtaskRunner|.
170 Mutex m_threadStateMutex; 170 Mutex m_threadStateMutex;
171 171
172 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; 172 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope;
173 173
174 v8::Isolate* m_isolate; 174 v8::Isolate* m_isolate;
175 175
176 // Used to signal thread shutdown. 176 // Used to signal thread shutdown.
177 OwnPtr<WebWaitableEvent> m_shutdownEvent; 177 OwnPtr<WebWaitableEvent> m_shutdownEvent;
178 178
179 // Used to signal thread termination. 179 // Used to signal thread termination.
180 OwnPtr<WebWaitableEvent> m_terminationEvent; 180 OwnPtr<WebWaitableEvent> m_terminationEvent;
181 }; 181 };
182 182
183 } // namespace blink 183 } // namespace blink
184 184
185 #endif // WorkerThread_h 185 #endif // WorkerThread_h
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerInspectorProxy.cpp ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698