OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/metrics/stats_table.h" | 5 #include "base/metrics/stats_table.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 AlignedSize(sizeof(Private::TableHeader)) + | 258 AlignedSize(sizeof(Private::TableHeader)) + |
259 AlignedSize((max_counters * sizeof(char) * kMaxCounterNameLength)) + | 259 AlignedSize((max_counters * sizeof(char) * kMaxCounterNameLength)) + |
260 AlignedSize((max_threads * sizeof(char) * kMaxThreadNameLength)) + | 260 AlignedSize((max_threads * sizeof(char) * kMaxThreadNameLength)) + |
261 AlignedSize(max_threads * sizeof(int)) + | 261 AlignedSize(max_threads * sizeof(int)) + |
262 AlignedSize(max_threads * sizeof(int)) + | 262 AlignedSize(max_threads * sizeof(int)) + |
263 AlignedSize((sizeof(int) * (max_counters * max_threads))); | 263 AlignedSize((sizeof(int) * (max_counters * max_threads))); |
264 | 264 |
265 impl_ = Private::New(name, table_size, max_threads, max_counters); | 265 impl_ = Private::New(name, table_size, max_threads, max_counters); |
266 | 266 |
267 if (!impl_) | 267 if (!impl_) |
268 PLOG(ERROR) << "StatsTable did not initialize"; | 268 DPLOG(ERROR) << "StatsTable did not initialize"; |
269 } | 269 } |
270 | 270 |
271 StatsTable::~StatsTable() { | 271 StatsTable::~StatsTable() { |
272 // Before we tear down our copy of the table, be sure to | 272 // Before we tear down our copy of the table, be sure to |
273 // unregister our thread. | 273 // unregister our thread. |
274 UnregisterThread(); | 274 UnregisterThread(); |
275 | 275 |
276 // Return ThreadLocalStorage. At this point, if any registered threads | 276 // Return ThreadLocalStorage. At this point, if any registered threads |
277 // still exist, they cannot Unregister. | 277 // still exist, they cannot Unregister. |
278 tls_index_.Free(); | 278 tls_index_.Free(); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 static_cast<TLSData*>(tls_index_.Get()); | 551 static_cast<TLSData*>(tls_index_.Get()); |
552 if (!data) | 552 if (!data) |
553 return NULL; | 553 return NULL; |
554 | 554 |
555 DCHECK(data->slot); | 555 DCHECK(data->slot); |
556 DCHECK_EQ(data->table, this); | 556 DCHECK_EQ(data->table, this); |
557 return data; | 557 return data; |
558 } | 558 } |
559 | 559 |
560 } // namespace base | 560 } // namespace base |
OLD | NEW |