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

Unified Diff: base/tracked_objects.cc

Issue 1845753006: Don't create redundant ThreadData for Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Early return in InitializeThreadContext Created 4 years, 8 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
« base/tracked_objects.h ('K') | « base/tracked_objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index d24cedf159241d58a92909650de374f187dd85ae..49f90e64e64041e0697d92d7077780c57ae2adda 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -354,11 +354,12 @@ ThreadData* ThreadData::first() {
ThreadData* ThreadData::next() const { return next_; }
// static
-void ThreadData::InitializeThreadContext(const std::string& suggested_name) {
+void ThreadData::InitializeThreadContext(const std::string& suggested_name,
+ bool is_worker_thread) {
Initialize();
ThreadData* current_thread_data =
reinterpret_cast<ThreadData*>(tls_index_.Get());
- if (current_thread_data)
+ if (current_thread_data or is_worker_thread)
jar (doing other things) 2016/04/20 04:34:51 The test for is_worker_thread should be done betwe
Zhenyu Shan 2016/05/04 23:33:03 Done.
return; // Browser tests instigate this.
current_thread_data = new ThreadData(suggested_name);
tls_index_.Set(current_thread_data);
« base/tracked_objects.h ('K') | « base/tracked_objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698