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

Unified Diff: content/browser/browser_main_runner.cc

Issue 1814083002: [tracing] Add thread name to the pseudo stack of heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profiler
Patch Set: Add comment. Created 4 years, 9 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/trace_event/heap_profiler_allocation_context_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_runner.cc
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index ef2fcb08fdb929421f9fd56eed0cb9d8b3ddb911..de130940eff672b3df28563ea4c60f4933ffab6a 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -15,6 +15,7 @@
#include "base/profiler/scoped_profile.h"
#include "base/profiler/scoped_tracker.h"
#include "base/time/time.h"
+#include "base/trace_event/heap_profiler_allocation_context_tracker.h"
#include "base/trace_event/trace_event.h"
#include "base/tracked_objects.h"
#include "build/build_config.h"
@@ -44,6 +45,7 @@ namespace content {
namespace {
bool g_exited_main_message_loop = false;
+const char kMainThreadName[] = "CrBrowserMain";
} // namespace
@@ -63,7 +65,9 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
// TODO(vadimt, yiyaoliu): Remove all tracked_objects references below once
// crbug.com/453640 is fixed.
- tracked_objects::ThreadData::InitializeThreadContext("CrBrowserMain");
+ tracked_objects::ThreadData::InitializeThreadContext(kMainThreadName);
+ base::trace_event::AllocationContextTracker::SetCurrentThreadName(
+ kMainThreadName);
TRACK_SCOPED_REGION(
"Startup", "BrowserMainRunnerImpl::Initialize");
TRACE_EVENT0("startup", "BrowserMainRunnerImpl::Initialize");
« no previous file with comments | « base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698