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

Unified Diff: content/child/worker_task_runner.cc

Issue 886593002: workers: Map the current thread-id to the WorkerRunLoop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « content/child/worker_task_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/worker_task_runner.cc
diff --git a/content/child/worker_task_runner.cc b/content/child/worker_task_runner.cc
index df4e03132e3873fc1a47020c4e5554ed467a9e3c..45b3619982fb197b0b226962c96707e435f0790e 100644
--- a/content/child/worker_task_runner.cc
+++ b/content/child/worker_task_runner.cc
@@ -36,9 +36,6 @@ struct WorkerTaskRunner::ThreadLocalState {
};
WorkerTaskRunner::WorkerTaskRunner() {
- // Start worker ids at 1, 0 is reserved for the main thread.
- int id = id_sequence_.GetNext();
- DCHECK(!id);
}
bool WorkerTaskRunner::PostTask(
@@ -86,7 +83,8 @@ WorkerTaskRunner::~WorkerTaskRunner() {
void WorkerTaskRunner::OnWorkerRunLoopStarted(const WebWorkerRunLoop& loop) {
DCHECK(!current_tls_.Get());
- int id = id_sequence_.GetNext();
+ DCHECK(!base::PlatformThread::CurrentRef().is_null());
+ int id = base::PlatformThread::CurrentId();
current_tls_.Set(new ThreadLocalState(id));
base::AutoLock locker_(loop_map_lock_);
« no previous file with comments | « content/child/worker_task_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698