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

Unified Diff: base/trace_event/trace_event_memory.cc

Issue 1124493002: Cleanup: given that TLS slot can't fail to initialize, remove bool return values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@parchild
Patch Set: Created 5 years, 8 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
Index: base/trace_event/trace_event_memory.cc
diff --git a/base/trace_event/trace_event_memory.cc b/base/trace_event/trace_event_memory.cc
index 2bf6d38beab0d8659aa92729baee7e61327fddac..da03a50b6ab60c08d711f6dd4710e7b9dead27ad 100644
--- a/base/trace_event/trace_event_memory.cc
+++ b/base/trace_event/trace_event_memory.cc
@@ -70,13 +70,12 @@ void DeleteStackOnThreadCleanup(void* value) {
delete stack;
}
-// Initializes the thread-local TraceMemoryStack pointer. Returns true on
-// success or if it is already initialized.
-bool InitThreadLocalStorage() {
+// Initializes the thread-local TraceMemoryStack pointer.
+void InitThreadLocalStorage() {
if (tls_trace_memory_stack.initialized())
- return true;
- // Initialize the thread-local storage key, returning true on success.
- return tls_trace_memory_stack.Initialize(&DeleteStackOnThreadCleanup);
+ return;
+ // Initialize the thread-local storage key.
+ tls_trace_memory_stack.Initialize(&DeleteStackOnThreadCleanup);
}
// Clean up thread-local-storage in the main thread.
@@ -196,8 +195,7 @@ void TraceMemoryController::StartProfiling() {
if (dump_timer_.IsRunning())
return;
DVLOG(1) << "Starting trace memory";
- if (!InitThreadLocalStorage())
- return;
+ InitThreadLocalStorage();
ScopedTraceMemory::set_enabled(true);
// Call ::HeapProfilerWithPseudoStackStart().
heap_profiler_start_function_(&GetPseudoStack);

Powered by Google App Engine
This is Rietveld 408576698