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

Unified Diff: base/thread_local.h

Issue 4744002: Move base::ThreadLocalPlatform to base::internal::ThreadLocalPlatform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update crash signature. Created 10 years, 1 month 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 | « no previous file | base/thread_local_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/thread_local.h
diff --git a/base/thread_local.h b/base/thread_local.h
index 075e209063a5e9a8c9de378328c09436addfd3bb..eba48d215ba83378b9cd046981020244ee901c78 100644
--- a/base/thread_local.h
+++ b/base/thread_local.h
@@ -57,6 +57,8 @@
namespace base {
+namespace internal {
+
// Helper functions that abstract the cross-platform APIs. Do not use directly.
struct ThreadLocalPlatform {
#if defined(OS_WIN)
@@ -71,27 +73,30 @@ struct ThreadLocalPlatform {
static void SetValueInSlot(SlotType& slot, void* value);
};
+} // namespace internal
+
template <typename Type>
class ThreadLocalPointer {
public:
ThreadLocalPointer() : slot_() {
- ThreadLocalPlatform::AllocateSlot(slot_);
+ internal::ThreadLocalPlatform::AllocateSlot(slot_);
}
~ThreadLocalPointer() {
- ThreadLocalPlatform::FreeSlot(slot_);
+ internal::ThreadLocalPlatform::FreeSlot(slot_);
}
Type* Get() {
- return static_cast<Type*>(ThreadLocalPlatform::GetValueFromSlot(slot_));
+ return static_cast<Type*>(
+ internal::ThreadLocalPlatform::GetValueFromSlot(slot_));
}
void Set(Type* ptr) {
- ThreadLocalPlatform::SetValueInSlot(slot_, ptr);
+ internal::ThreadLocalPlatform::SetValueInSlot(slot_, ptr);
}
private:
- typedef ThreadLocalPlatform::SlotType SlotType;
+ typedef internal::ThreadLocalPlatform::SlotType SlotType;
SlotType slot_;
« no previous file with comments | « no previous file | base/thread_local_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698