OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // to WorkerContext. | 115 // to WorkerContext. |
116 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; | 116 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; |
117 | 117 |
118 // We retain ownership of this one which is for use on the | 118 // We retain ownership of this one which is for use on the |
119 // main thread only. | 119 // main thread only. |
120 std::unique_ptr<WebServiceWorkerNetworkProvider> m_networkProvider; | 120 std::unique_ptr<WebServiceWorkerNetworkProvider> m_networkProvider; |
121 | 121 |
122 // Kept around only while main script loading is ongoing. | 122 // Kept around only while main script loading is ongoing. |
123 RefPtr<WorkerScriptLoader> m_mainScriptLoader; | 123 RefPtr<WorkerScriptLoader> m_mainScriptLoader; |
124 | 124 |
125 Persistent<ParentFrameTaskRunners> m_mainThreadTaskRunners; | 125 // Owned by the main thread, but will be accessed by the worker when |
126 // posting tasks. | |
127 CrossThreadPersistent<ParentFrameTaskRunners> m_mainThreadTaskRunners; | |
126 | 128 |
127 std::unique_ptr<WorkerThread> m_workerThread; | 129 std::unique_ptr<WorkerThread> m_workerThread; |
128 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 130 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
129 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; | 131 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; |
130 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; | 132 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; |
131 | 133 |
132 // 'shadow page' - created to proxy loading requests from the worker. | 134 // 'shadow page' - created to proxy loading requests from the worker. |
133 // Both WebView and WebFrame objects are close()'ed (where they're | 135 // Both WebView and WebFrame objects are close()'ed (where they're |
134 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they | 136 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they |
135 // are guaranteed to exist while this object is around. | 137 // are guaranteed to exist while this object is around. |
136 WebView* m_webView; | 138 WebView* m_webView; |
137 Persistent<WebLocalFrameImpl> m_mainFrame; | 139 |
140 // Accessed cross-thread when worker thread posts tasks to the parent. | |
141 CrossThreadPersistent<WebLocalFrameImpl> m_mainFrame; | |
haraken
2017/02/20 23:57:18
Ditto.
| |
138 | 142 |
139 bool m_loadingShadowPage; | 143 bool m_loadingShadowPage; |
140 bool m_askedToTerminate; | 144 bool m_askedToTerminate; |
141 | 145 |
142 enum WaitingForDebuggerState { WaitingForDebugger, NotWaitingForDebugger }; | 146 enum WaitingForDebuggerState { WaitingForDebugger, NotWaitingForDebugger }; |
143 | 147 |
144 enum { | 148 enum { |
145 DontPauseAfterDownload, | 149 DontPauseAfterDownload, |
146 DoPauseAfterDownload, | 150 DoPauseAfterDownload, |
147 IsPausedAfterDownload | 151 IsPausedAfterDownload |
148 } m_pauseAfterDownloadState; | 152 } m_pauseAfterDownloadState; |
149 | 153 |
150 WaitingForDebuggerState m_waitingForDebuggerState; | 154 WaitingForDebuggerState m_waitingForDebuggerState; |
151 }; | 155 }; |
152 | 156 |
153 } // namespace blink | 157 } // namespace blink |
154 | 158 |
155 #endif // WebEmbeddedWorkerImpl_h | 159 #endif // WebEmbeddedWorkerImpl_h |
OLD | NEW |