OLD | NEW |
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/threading/thread_id_name_manager.h" | 5 #include "base/threading/thread_id_name_manager.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "base/string_util.h" | 12 #include "base/strings/string_util.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 namespace { | 15 namespace { |
16 | 16 |
17 static const char kDefaultName[] = ""; | 17 static const char kDefaultName[] = ""; |
18 static std::string* g_default_name; | 18 static std::string* g_default_name; |
19 | 19 |
20 } | 20 } |
21 | 21 |
22 ThreadIdNameManager::ThreadIdNameManager() | 22 ThreadIdNameManager::ThreadIdNameManager() |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 DCHECK((id_to_handle_iter!= thread_id_to_handle_.end())); | 103 DCHECK((id_to_handle_iter!= thread_id_to_handle_.end())); |
104 // The given |id| may have been re-used by the system. Make sure the | 104 // The given |id| may have been re-used by the system. Make sure the |
105 // mapping points to the provided |handle| before removal. | 105 // mapping points to the provided |handle| before removal. |
106 if (id_to_handle_iter->second != handle) | 106 if (id_to_handle_iter->second != handle) |
107 return; | 107 return; |
108 | 108 |
109 thread_id_to_handle_.erase(id_to_handle_iter); | 109 thread_id_to_handle_.erase(id_to_handle_iter); |
110 } | 110 } |
111 | 111 |
112 } // namespace base | 112 } // namespace base |
OLD | NEW |