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

Unified Diff: base/threading/thread_id_name_manager.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/threading/thread_collision_warner_unittest.cc ('k') | base/threading/thread_id_name_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_id_name_manager.h
diff --git a/base/threading/thread_id_name_manager.h b/base/threading/thread_id_name_manager.h
deleted file mode 100644
index 927d25fe1e8eda060393eba71d1af29e531bf56c..0000000000000000000000000000000000000000
--- a/base/threading/thread_id_name_manager.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_THREADING_THREAD_ID_NAME_MANAGER_H_
-#define BASE_THREADING_THREAD_ID_NAME_MANAGER_H_
-
-#include <map>
-#include <string>
-
-#include "base/base_export.h"
-#include "base/basictypes.h"
-#include "base/synchronization/lock.h"
-#include "base/threading/platform_thread.h"
-
-template <typename T> struct DefaultSingletonTraits;
-
-namespace base {
-
-class BASE_EXPORT ThreadIdNameManager {
- public:
- static ThreadIdNameManager* GetInstance();
-
- static const char* GetDefaultInternedString();
-
- // Register the mapping between a thread |id| and |handle|.
- void RegisterThread(PlatformThreadHandle::Handle handle, PlatformThreadId id);
-
- // Set the name for the given id.
- void SetName(PlatformThreadId id, const std::string& name);
-
- // Get the name for the given id.
- const char* GetName(PlatformThreadId id);
-
- // Remove the name for the given id.
- void RemoveName(PlatformThreadHandle::Handle handle, PlatformThreadId id);
-
- private:
- friend struct DefaultSingletonTraits<ThreadIdNameManager>;
-
- typedef std::map<PlatformThreadId, PlatformThreadHandle::Handle>
- ThreadIdToHandleMap;
- typedef std::map<PlatformThreadHandle::Handle, std::string*>
- ThreadHandleToInternedNameMap;
- typedef std::map<std::string, std::string*> NameToInternedNameMap;
-
- ThreadIdNameManager();
- ~ThreadIdNameManager();
-
- // lock_ protects the name_to_interned_name_, thread_id_to_handle_ and
- // thread_handle_to_interned_name_ maps.
- Lock lock_;
-
- NameToInternedNameMap name_to_interned_name_;
- ThreadIdToHandleMap thread_id_to_handle_;
- ThreadHandleToInternedNameMap thread_handle_to_interned_name_;
-
- // Treat the main process specially as there is no PlatformThreadHandle.
- std::string* main_process_name_;
- PlatformThreadId main_process_id_;
-
- DISALLOW_COPY_AND_ASSIGN(ThreadIdNameManager);
-};
-
-} // namespace base
-
-#endif // BASE_THREADING_THREAD_ID_NAME_MANAGER_H_
« no previous file with comments | « base/threading/thread_collision_warner_unittest.cc ('k') | base/threading/thread_id_name_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698