diff options
author | asvitkine <asvitkine@chromium.org> | 2015-05-07 09:27:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-07 16:27:50 +0000 |
commit | d0abaa302dc62c1d10c7a934f23da0d4f5dc7f35 (patch) | |
tree | e330c82849ab6455a3ac8852ee2588d2c41a4162 /base/threading | |
parent | 0e2478e3ed2649c07e6f244dce921dbb95fca51a (diff) | |
download | chromium_src-d0abaa302dc62c1d10c7a934f23da0d4f5dc7f35.zip chromium_src-d0abaa302dc62c1d10c7a934f23da0d4f5dc7f35.tar.gz chromium_src-d0abaa302dc62c1d10c7a934f23da0d4f5dc7f35.tar.bz2 |
Cleanup base profiler initialization code.
Given that TLS slot can't fail to initialize, remove bool return values
from initialization functions that actually can't fail.
Based off of vadimt@'s CL here:
https://codereview.chromium.org/1124493002/
BUG=456354
Review URL: https://codereview.chromium.org/1128653002
Cr-Commit-Position: refs/heads/master@{#328774}
Diffstat (limited to 'base/threading')
-rw-r--r-- | base/threading/thread_local_android.cc | 5 | ||||
-rw-r--r-- | base/threading/thread_local_storage.cc | 3 | ||||
-rw-r--r-- | base/threading/thread_local_storage.h | 3 |
3 files changed, 3 insertions, 8 deletions
diff --git a/base/threading/thread_local_android.cc b/base/threading/thread_local_android.cc index c890237..813dd78 100644 --- a/base/threading/thread_local_android.cc +++ b/base/threading/thread_local_android.cc @@ -4,15 +4,12 @@ #include "base/threading/thread_local.h" -#include "base/logging.h" - namespace base { namespace internal { // static void ThreadLocalPlatform::AllocateSlot(SlotType* slot) { - bool succeed = slot->Initialize(NULL); - CHECK(succeed); + slot->Initialize(nullptr); } // static diff --git a/base/threading/thread_local_storage.cc b/base/threading/thread_local_storage.cc index 54928ed..0bb396c 100644 --- a/base/threading/thread_local_storage.cc +++ b/base/threading/thread_local_storage.cc @@ -197,7 +197,7 @@ ThreadLocalStorage::Slot::Slot(TLSDestructorFunc destructor) { Initialize(destructor); } -bool ThreadLocalStorage::StaticSlot::Initialize(TLSDestructorFunc destructor) { +void ThreadLocalStorage::StaticSlot::Initialize(TLSDestructorFunc destructor) { PlatformThreadLocalStorage::TLSKey key = base::subtle::NoBarrier_Load(&g_native_tls_key); if (key == PlatformThreadLocalStorage::TLS_KEY_OUT_OF_INDEXES || @@ -212,7 +212,6 @@ bool ThreadLocalStorage::StaticSlot::Initialize(TLSDestructorFunc destructor) { // Setup our destructor. g_tls_destructors[slot_] = destructor; initialized_ = true; - return true; } void ThreadLocalStorage::StaticSlot::Free() { diff --git a/base/threading/thread_local_storage.h b/base/threading/thread_local_storage.h index ea41b34..50f8868 100644 --- a/base/threading/thread_local_storage.h +++ b/base/threading/thread_local_storage.h @@ -98,8 +98,7 @@ class BASE_EXPORT ThreadLocalStorage { // Set up the TLS slot. Called by the constructor. // 'destructor' is a pointer to a function to perform per-thread cleanup of // this object. If set to NULL, no cleanup is done for this TLS slot. - // Returns false on error. - bool Initialize(TLSDestructorFunc destructor); + void Initialize(TLSDestructorFunc destructor); // Free a previously allocated TLS 'slot'. // If a destructor was set for this slot, removes |