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

Side by Side Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.h

Issue 2702243003: Disallow cross-thread Persistent<> read access. (Closed)
Patch Set: rebased upto r451733 Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void postMessageToPageInspectorOnMainThread(const String& message); 150 void postMessageToPageInspectorOnMainThread(const String& message);
151 151
152 // WorkerLoaderProxyProvider 152 // WorkerLoaderProxyProvider
153 void postTaskToLoader(const WebTraceLocation&, 153 void postTaskToLoader(const WebTraceLocation&,
154 std::unique_ptr<ExecutionContextTask>) override; 154 std::unique_ptr<ExecutionContextTask>) override;
155 void postTaskToWorkerGlobalScope( 155 void postTaskToWorkerGlobalScope(
156 const WebTraceLocation&, 156 const WebTraceLocation&,
157 std::unique_ptr<WTF::CrossThreadClosure>) override; 157 std::unique_ptr<WTF::CrossThreadClosure>) override;
158 158
159 // 'shadow page' - created to proxy loading requests from the worker. 159 // 'shadow page' - created to proxy loading requests from the worker.
160 Persistent<ExecutionContext> m_loadingDocument; 160 // Will be accessed by worker thread when posting tasks.
161 //
162 // TODO: it is undesirable to keep a cross-thread reference to this
163 // document; avoid reaching into the document when posting.
164 CrossThreadPersistent<ExecutionContext> m_loadingDocument;
161 WebView* m_webView; 165 WebView* m_webView;
162 Persistent<WebLocalFrameImpl> m_mainFrame; 166 Persistent<WebLocalFrameImpl> m_mainFrame;
163 bool m_askedToTerminate; 167 bool m_askedToTerminate;
164 168
165 // This one is bound to and used only on the main thread. 169 // This one is bound to and used only on the main thread.
166 std::unique_ptr<WebServiceWorkerNetworkProvider> m_networkProvider; 170 std::unique_ptr<WebServiceWorkerNetworkProvider> m_networkProvider;
167 171
168 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; 172 Persistent<WorkerInspectorProxy> m_workerInspectorProxy;
169 173
170 Persistent<ParentFrameTaskRunners> m_parentFrameTaskRunners; 174 // Owned by the main thread, but will be accessed by the worker.
175 CrossThreadPersistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
171 176
172 std::unique_ptr<WorkerThread> m_workerThread; 177 std::unique_ptr<WorkerThread> m_workerThread;
173 178
174 WebSharedWorkerClient* m_client; 179 WebSharedWorkerClient* m_client;
175 180
176 bool m_pauseWorkerContextOnStart; 181 bool m_pauseWorkerContextOnStart;
177 bool m_isPausedOnStart; 182 bool m_isPausedOnStart;
178 183
179 // Kept around only while main script loading is ongoing. 184 // Kept around only while main script loading is ongoing.
180 RefPtr<WorkerScriptLoader> m_mainScriptLoader; 185 RefPtr<WorkerScriptLoader> m_mainScriptLoader;
181 186
182 RefPtr<WorkerLoaderProxy> m_loaderProxy; 187 RefPtr<WorkerLoaderProxy> m_loaderProxy;
183 188
184 WebURL m_url; 189 WebURL m_url;
185 WebString m_name; 190 WebString m_name;
186 WebAddressSpace m_creationAddressSpace; 191 WebAddressSpace m_creationAddressSpace;
187 }; 192 };
188 193
189 } // namespace blink 194 } // namespace blink
190 195
191 #endif // WebSharedWorkerImpl_h 196 #endif // WebSharedWorkerImpl_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698