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

Unified Diff: base/trace_event/trace_event_memory.cc

Issue 1128653002: Cleanup base profiler initialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update thread_local_android.cc Created 5 years, 7 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_local_storage.cc ('k') | base/tracked_objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ab8ba0d33373ed1c7ef2d421b72edb5a5cb3b00f..89595890aec54030196028121956e501b0536662 100644
--- a/base/trace_event/trace_event_memory.cc
+++ b/base/trace_event/trace_event_memory.cc
@@ -71,13 +71,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.
@@ -195,8 +194,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);
« no previous file with comments | « base/threading/thread_local_storage.cc ('k') | base/tracked_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698