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

Unified Diff: content/child/worker_task_runner.cc

Issue 898803003: workers: Remove dead code. (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 | « no previous file | content/child/worker_thread_task_runner.h » ('j') | 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 45b3619982fb197b0b226962c96707e435f0790e..4fc5bde308ac6e0bd125f34ddd2c0bbbb3759dd0 100644
--- a/content/child/worker_task_runner.cc
+++ b/content/child/worker_task_runner.cc
@@ -30,8 +30,7 @@ class RunClosureTask : public WebWorkerRunLoop::Task {
} // namespace
struct WorkerTaskRunner::ThreadLocalState {
- explicit ThreadLocalState(int id) : id_(id) {}
- int id_;
+ ThreadLocalState() {}
ObserverList<WorkerTaskRunner::Observer> stop_observers_;
};
@@ -59,7 +58,7 @@ int WorkerTaskRunner::PostTaskToAllThreads(const base::Closure& closure) {
int WorkerTaskRunner::CurrentWorkerId() {
if (!current_tls_.Get())
return 0;
- return current_tls_.Get()->id_;
+ return base::PlatformThread::CurrentId();
}
WorkerTaskRunner* WorkerTaskRunner::Instance() {
@@ -84,9 +83,9 @@ WorkerTaskRunner::~WorkerTaskRunner() {
void WorkerTaskRunner::OnWorkerRunLoopStarted(const WebWorkerRunLoop& loop) {
DCHECK(!current_tls_.Get());
DCHECK(!base::PlatformThread::CurrentRef().is_null());
- int id = base::PlatformThread::CurrentId();
- current_tls_.Set(new ThreadLocalState(id));
+ current_tls_.Set(new ThreadLocalState());
+ int id = base::PlatformThread::CurrentId();
base::AutoLock locker_(loop_map_lock_);
loop_map_[id] = loop;
}
« no previous file with comments | « no previous file | content/child/worker_thread_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698