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_); |