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

Unified Diff: content/browser/browser_main.cc

Issue 1386193002: Stop using the TRACE_EVENT_*_ETW macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-review (fix a comment) Created 5 years, 2 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: content/browser/browser_main.cc
diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc
index 4c114b436133f6823324dc4be39bfe72e79de093..d0897f1d650d3baa6d8a4e8298d2cbe6ec2a7d8a 100644
--- a/content/browser/browser_main.cc
+++ b/content/browser/browser_main.cc
@@ -10,9 +10,27 @@
namespace content {
+namespace {
+
+// Generates a pair of BrowserMain async events. We don't use the TRACE_EVENT0
+// macro because the tracing infrastructure doesn't expect synchronous events
+// around the main loop of a thread.
+class ScopedBrowserMainEvent {
+ public:
+ ScopedBrowserMainEvent() {
+ TRACE_EVENT_ASYNC_BEGIN0("startup", "BrowserMain", 0);
+ }
+ ~ScopedBrowserMainEvent() {
+ TRACE_EVENT_ASYNC_END0("startup", "BrowserMain", 0);
+ }
+};
+
+} // namespace
+
// Main routine for running as the Browser process.
int BrowserMain(const MainFunctionParams& parameters) {
- TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, "");
+ ScopedBrowserMainEvent scoped_browser_main_event;
+
base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser");
base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex(
kTraceEventBrowserProcessSortIndex);
@@ -27,8 +45,6 @@ int BrowserMain(const MainFunctionParams& parameters) {
main_runner->Shutdown();
- TRACE_EVENT_END_ETW("BrowserMain", 0, 0);
-
return exit_code;
}

Powered by Google App Engine
This is Rietveld 408576698