OLD | NEW |
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 bool isCurrentThread() const; | 77 bool isCurrentThread() const; |
78 WorkerLoaderProxy* workerLoaderProxy() const | 78 WorkerLoaderProxy* workerLoaderProxy() const |
79 { | 79 { |
80 RELEASE_ASSERT(m_workerLoaderProxy); | 80 RELEASE_ASSERT(m_workerLoaderProxy); |
81 return m_workerLoaderProxy.get(); | 81 return m_workerLoaderProxy.get(); |
82 } | 82 } |
83 | 83 |
84 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin
gProxy; } | 84 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin
gProxy; } |
85 | 85 |
86 void postTask(PassOwnPtr<ExecutionContextTask>); | 86 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>); |
87 void postDebuggerTask(PassOwnPtr<ExecutionContextTask>); | 87 void postDebuggerTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTa
sk>); |
88 | 88 |
89 enum WaitMode { WaitForMessage, DontWaitForMessage }; | 89 enum WaitMode { WaitForMessage, DontWaitForMessage }; |
90 MessageQueueWaitResult runDebuggerTask(WaitMode = WaitForMessage); | 90 MessageQueueWaitResult runDebuggerTask(WaitMode = WaitForMessage); |
91 | 91 |
92 // These methods should be called if the holder of the thread is | 92 // These methods should be called if the holder of the thread is |
93 // going to call runDebuggerTask in a loop. | 93 // going to call runDebuggerTask in a loop. |
94 void willEnterNestedLoop(); | 94 void willEnterNestedLoop(); |
95 void didLeaveNestedLoop(); | 95 void didLeaveNestedLoop(); |
96 | 96 |
97 WorkerGlobalScope* workerGlobalScope() const { return m_workerGlobalScope.ge
t(); } | 97 WorkerGlobalScope* workerGlobalScope() const { return m_workerGlobalScope.ge
t(); } |
(...skipping 18 matching lines...) Expand all Loading... |
116 private: | 116 private: |
117 friend class WorkerSharedTimer; | 117 friend class WorkerSharedTimer; |
118 friend class WorkerThreadShutdownFinishTask; | 118 friend class WorkerThreadShutdownFinishTask; |
119 | 119 |
120 void stopInShutdownSequence(); | 120 void stopInShutdownSequence(); |
121 void stopInternal(); | 121 void stopInternal(); |
122 | 122 |
123 void initialize(); | 123 void initialize(); |
124 void cleanup(); | 124 void cleanup(); |
125 void idleHandler(); | 125 void idleHandler(); |
126 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs); | 126 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas
k>, long long delayMs); |
127 | 127 |
128 bool m_terminated; | 128 bool m_terminated; |
129 OwnPtr<WorkerSharedTimer> m_sharedTimer; | 129 OwnPtr<WorkerSharedTimer> m_sharedTimer; |
130 MessageQueue<WorkerThreadTask> m_debuggerMessageQueue; | 130 MessageQueue<WorkerThreadTask> m_debuggerMessageQueue; |
131 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; | 131 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; |
132 | 132 |
133 RefPtr<WorkerLoaderProxy> m_workerLoaderProxy; | 133 RefPtr<WorkerLoaderProxy> m_workerLoaderProxy; |
134 WorkerReportingProxy& m_workerReportingProxy; | 134 WorkerReportingProxy& m_workerReportingProxy; |
135 | 135 |
136 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorControlle
r; | 136 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorControlle
r; |
(...skipping 13 matching lines...) Expand all Loading... |
150 // WorkerThread might get deleted before it had a chance to properly | 150 // WorkerThread might get deleted before it had a chance to properly |
151 // shut down. By deleting the WebThread first, we can guarantee that | 151 // shut down. By deleting the WebThread first, we can guarantee that |
152 // no pending tasks on the thread might want to access any of the other | 152 // no pending tasks on the thread might want to access any of the other |
153 // members during the WorkerThread's destruction. | 153 // members during the WorkerThread's destruction. |
154 OwnPtr<WebThreadSupportingGC> m_thread; | 154 OwnPtr<WebThreadSupportingGC> m_thread; |
155 }; | 155 }; |
156 | 156 |
157 } // namespace blink | 157 } // namespace blink |
158 | 158 |
159 #endif // WorkerThread_h | 159 #endif // WorkerThread_h |
OLD | NEW |