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

Side by Side Diff: base/tracked_objects.cc

Issue 9297010: Make it possible to use ThreadLocalStorage::Slot as a static without (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/tracked_objects.h ('k') | net/base/dns_reloader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/tracked_objects.h" 5 #include "base/tracked_objects.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // thread. 173 // thread.
174 174
175 // TODO(jar): We should pull all these static vars together, into a struct, and 175 // TODO(jar): We should pull all these static vars together, into a struct, and
176 // optimize layout so that we benefit from locality of reference during accesses 176 // optimize layout so that we benefit from locality of reference during accesses
177 // to them. 177 // to them.
178 178
179 // A TLS slot which points to the ThreadData instance for the current thread. We 179 // A TLS slot which points to the ThreadData instance for the current thread. We
180 // do a fake initialization here (zeroing out data), and then the real in-place 180 // do a fake initialization here (zeroing out data), and then the real in-place
181 // construction happens when we call tls_index_.Initialize(). 181 // construction happens when we call tls_index_.Initialize().
182 // static 182 // static
183 base::ThreadLocalStorage::Slot ThreadData::tls_index_(base::LINKER_INITIALIZED); 183 base::ThreadLocalStorage::StaticSlot ThreadData::tls_index_ = TLS_INITIALIZER;
184 184
185 // static 185 // static
186 int ThreadData::worker_thread_data_creation_count_ = 0; 186 int ThreadData::worker_thread_data_creation_count_ = 0;
187 187
188 // static 188 // static
189 int ThreadData::cleanup_count_ = 0; 189 int ThreadData::cleanup_count_ = 0;
190 190
191 // static 191 // static
192 int ThreadData::incarnation_counter_ = 0; 192 int ThreadData::incarnation_counter_ = 0;
193 193
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 ++it) { 827 ++it) {
828 base::DictionaryValue* parent_child = new base::DictionaryValue; 828 base::DictionaryValue* parent_child = new base::DictionaryValue;
829 it->first->ToValue("parent", parent_child); 829 it->first->ToValue("parent", parent_child);
830 it->second->ToValue("child", parent_child); 830 it->second->ToValue("child", parent_child);
831 descendants->Append(parent_child); 831 descendants->Append(parent_child);
832 } 832 }
833 dictionary->Set("descendants", descendants); 833 dictionary->Set("descendants", descendants);
834 } 834 }
835 835
836 } // namespace tracked_objects 836 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « base/tracked_objects.h ('k') | net/base/dns_reloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698