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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp

Issue 2706903002: Worker: Add comments about thread restriction to WorkerLoaderProxy (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp
index 7c21c93d3b0d3d3a01aeb5a8d1f1df566ea110bf..dd8655f571c7bfb72956c3472964114519b8b6ad 100644
--- a/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerLoaderProxy.cpp
@@ -19,7 +19,8 @@ WorkerLoaderProxy::~WorkerLoaderProxy() {
void WorkerLoaderProxy::detachProvider(
WorkerLoaderProxyProvider* proxyProvider) {
MutexLocker locker(m_lock);
- DCHECK(proxyProvider == m_loaderProxyProvider);
+ DCHECK(isMainThread());
+ DCHECK_EQ(proxyProvider, m_loaderProxyProvider);
m_loaderProxyProvider = nullptr;
}
@@ -27,6 +28,7 @@ void WorkerLoaderProxy::postTaskToLoader(
const WebTraceLocation& location,
std::unique_ptr<ExecutionContextTask> task) {
MutexLocker locker(m_lock);
+ DCHECK(!isMainThread());
if (!m_loaderProxyProvider)
return;
m_loaderProxyProvider->postTaskToLoader(location, std::move(task));
@@ -36,6 +38,7 @@ void WorkerLoaderProxy::postTaskToWorkerGlobalScope(
const WebTraceLocation& location,
std::unique_ptr<WTF::CrossThreadClosure> task) {
MutexLocker locker(m_lock);
+ DCHECK(isMainThread());
if (!m_loaderProxyProvider)
return;
m_loaderProxyProvider->postTaskToWorkerGlobalScope(location, std::move(task));
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerLoaderProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698