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

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

Issue 2015453002: Worker: Reorder function definitions of WorkerThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 6 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 | « no previous file | third_party/WebKit/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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 virtual WorkerBackingThread& workerBackingThread() = 0; 77 virtual WorkerBackingThread& workerBackingThread() = 0;
78 virtual bool shouldAttachThreadDebugger() const { return true; } 78 virtual bool shouldAttachThreadDebugger() const { return true; }
79 v8::Isolate* isolate(); 79 v8::Isolate* isolate();
80 80
81 // Can be used to wait for this worker thread to terminate. 81 // Can be used to wait for this worker thread to terminate.
82 // (This is signaled on the main thread, so it's assumed to be waited on 82 // (This is signaled on the main thread, so it's assumed to be waited on
83 // the worker context thread) 83 // the worker context thread)
84 WaitableEvent* terminationEvent() { return m_terminationEvent.get(); } 84 WaitableEvent* terminationEvent() { return m_terminationEvent.get(); }
85 85
86 bool isCurrentThread(); 86 bool isCurrentThread();
87
87 WorkerLoaderProxy* workerLoaderProxy() const 88 WorkerLoaderProxy* workerLoaderProxy() const
88 { 89 {
89 RELEASE_ASSERT(m_workerLoaderProxy); 90 RELEASE_ASSERT(m_workerLoaderProxy);
90 return m_workerLoaderProxy.get(); 91 return m_workerLoaderProxy.get();
91 } 92 }
92 93
93 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin gProxy; } 94 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin gProxy; }
94 95
95 void postTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask> ); 96 void postTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask> );
96 void appendDebuggerTask(std::unique_ptr<CrossThreadClosure>); 97 void appendDebuggerTask(std::unique_ptr<CrossThreadClosure>);
(...skipping 24 matching lines...) Expand all
121 virtual WorkerGlobalScope* createWorkerGlobalScope(PassOwnPtr<WorkerThreadSt artupData>) = 0; 122 virtual WorkerGlobalScope* createWorkerGlobalScope(PassOwnPtr<WorkerThreadSt artupData>) = 0;
122 123
123 // Called on the worker thread. 124 // Called on the worker thread.
124 virtual void postInitialize() { } 125 virtual void postInitialize() { }
125 126
126 private: 127 private:
127 class WorkerMicrotaskRunner; 128 class WorkerMicrotaskRunner;
128 129
129 std::unique_ptr<CrossThreadClosure> createWorkerThreadTask(std::unique_ptr<E xecutionContextTask>, bool isInstrumented); 130 std::unique_ptr<CrossThreadClosure> createWorkerThreadTask(std::unique_ptr<E xecutionContextTask>, bool isInstrumented);
130 131
131 // Called on the worker thread. 132 void initializeOnWorkerThread(PassOwnPtr<WorkerThreadStartupData>);
132 void initialize(PassOwnPtr<WorkerThreadStartupData>); 133 void prepareForShutdownOnWorkerThread();
133 void performTask(std::unique_ptr<ExecutionContextTask>, bool isInstrumented) ; 134 void performShutdownOnWorkerThread();
134 void prepareForShutdown(); 135 void performTaskOnWorkerThread(std::unique_ptr<ExecutionContextTask>, bool i sInstrumented);
135 void performShutdown(); 136 void runDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure>);
136 void runDebuggerTask(std::unique_ptr<CrossThreadClosure>); 137 void runDebuggerTaskDontWaitOnWorkerThread();
137 void runDebuggerTaskDontWait();
138 138
139 bool m_started = false; 139 bool m_started = false;
140 bool m_terminated = false; 140 bool m_terminated = false;
141 bool m_readyToShutdown = false; 141 bool m_readyToShutdown = false;
142 bool m_pausedInDebugger = false; 142 bool m_pausedInDebugger = false;
143 bool m_runningDebuggerTask = false; 143 bool m_runningDebuggerTask = false;
144 bool m_shouldTerminateV8Execution = false; 144 bool m_shouldTerminateV8Execution = false;
145 145
146 OwnPtr<InspectorTaskRunner> m_inspectorTaskRunner; 146 OwnPtr<InspectorTaskRunner> m_inspectorTaskRunner;
147 OwnPtr<WorkerMicrotaskRunner> m_microtaskRunner; 147 OwnPtr<WorkerMicrotaskRunner> m_microtaskRunner;
(...skipping 11 matching lines...) Expand all
159 // Signaled when the thread starts termination on the main thread. 159 // Signaled when the thread starts termination on the main thread.
160 OwnPtr<WaitableEvent> m_terminationEvent; 160 OwnPtr<WaitableEvent> m_terminationEvent;
161 161
162 // Signaled when the thread completes termination on the worker thread. 162 // Signaled when the thread completes termination on the worker thread.
163 OwnPtr<WaitableEvent> m_shutdownEvent; 163 OwnPtr<WaitableEvent> m_shutdownEvent;
164 }; 164 };
165 165
166 } // namespace blink 166 } // namespace blink
167 167
168 #endif // WorkerThread_h 168 #endif // WorkerThread_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698