OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <ext/hashtable.h> |
| 6 #include <string.h> |
| 7 #include <string> |
| 8 #include <utility> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/logging.h" |
5 #include "base/metrics/stats_table.h" | 12 #include "base/metrics/stats_table.h" |
6 | |
7 #include "base/logging.h" | |
8 #include "base/process_util.h" | 13 #include "base/process_util.h" |
9 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
10 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
11 #include "base/string_piece.h" | |
12 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/synchronization/lock.h" |
13 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
14 #include "base/threading/thread_local_storage.h" | 19 #include "base/threading/thread_local_storage.h" |
15 #include "base/utf_string_conversions.h" | 20 #include "build/build_config.h" |
16 | |
17 #if defined(OS_POSIX) | |
18 #include "errno.h" | |
19 #endif | |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 | 23 |
23 // The StatsTable uses a shared memory segment that is laid out as follows | 24 // The StatsTable uses a shared memory segment that is laid out as follows |
24 // | 25 // |
25 // +-------------------------------------------+ | 26 // +-------------------------------------------+ |
26 // | Version | Size | MaxCounters | MaxThreads | | 27 // | Version | Size | MaxCounters | MaxThreads | |
27 // +-------------------------------------------+ | 28 // +-------------------------------------------+ |
28 // | Thread names table | | 29 // | Thread names table | |
29 // +-------------------------------------------+ | 30 // +-------------------------------------------+ |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 static_cast<TLSData*>(tls_index_.Get()); | 545 static_cast<TLSData*>(tls_index_.Get()); |
545 if (!data) | 546 if (!data) |
546 return NULL; | 547 return NULL; |
547 | 548 |
548 DCHECK(data->slot); | 549 DCHECK(data->slot); |
549 DCHECK_EQ(data->table, this); | 550 DCHECK_EQ(data->table, this); |
550 return data; | 551 return data; |
551 } | 552 } |
552 | 553 |
553 } // namespace base | 554 } // namespace base |
OLD | NEW |