summaryrefslogtreecommitdiffstats
path: root/base/stats_table.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
commitfa87a2527ca8c0bcef92d8e44791332782936911 (patch)
tree04dc5d1e6881f8356f91203a386648057b20d924 /base/stats_table.cc
parent4f64d0af5908e36d356c834005d08cca98d579fe (diff)
downloadchromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.zip
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.gz
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.bz2
Revert. Failing unit tests.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/stats_table.cc')
-rw-r--r--base/stats_table.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/base/stats_table.cc b/base/stats_table.cc
index 8b10662..23c736a 100644
--- a/base/stats_table.cc
+++ b/base/stats_table.cc
@@ -254,7 +254,7 @@ StatsTable* StatsTable::global_table_ = NULL;
StatsTable::StatsTable(const std::wstring& name, int max_threads,
int max_counters)
- : tls_index_(SlotReturnFunction) {
+ : tls_index_(ThreadLocalStorage::Alloc(SlotReturnFunction)) {
int table_size =
AlignedSize(sizeof(TableHeader)) +
AlignedSize((max_counters * sizeof(wchar_t) * kMaxCounterNameLength)) +
@@ -285,7 +285,7 @@ StatsTable::~StatsTable() {
// Return ThreadLocalStorage. At this point, if any registered threads
// still exist, they cannot Unregister.
- tls_index_.Free();
+ ThreadLocalStorage::Free(tls_index_);
// Cleanup our shared memory.
delete impl_;
@@ -329,13 +329,13 @@ int StatsTable::RegisterThread(const std::wstring& name) {
StatsTableTLSData* data = new StatsTableTLSData;
data->table = this;
data->slot = slot;
- tls_index_.Set(data);
+ ThreadLocalStorage::Set(tls_index_, data);
return slot;
}
StatsTableTLSData* StatsTable::GetTLSData() const {
StatsTableTLSData* data =
- static_cast<StatsTableTLSData*>(tls_index_.Get());
+ static_cast<StatsTableTLSData*>(ThreadLocalStorage::Get(tls_index_));
if (!data)
return NULL;
@@ -355,7 +355,7 @@ void StatsTable::UnregisterThread() {
*name = L'\0';
// Remove the calling thread's TLS so that it cannot use the slot.
- tls_index_.Set(NULL);
+ ThreadLocalStorage::Set(tls_index_, NULL);
delete data;
}