0
Files
src/content/browser/browser_main.cc
Etienne Bergeron 666d5a233e Fix renderer/browser trace events scoped id.
This CL is fixing passing to TRACE_ID_WITH_SCOPE a TRACE_ID_LOCAL.
As described on crbug/1269403, we currently emit all the RendererMain
trace event into the browser process, as the same context.

The macro TRACE_ID_WITH_SCOPE is taking an ID which can be of three
kind:
  1) Raw (raw integer) : You know what you are doing.
  2) LocalId : Use this for ids that are unique within a single process.
  3) GlobalId : Use this for ids that are unique across processes.

The proposal is to create these events with a the local scope.

R=eseckler,gab

Bug: 1269403
Change-Id: Ie2d16711163e4fff316da037e2323658643eb142
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276036
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943535}
2021-11-19 16:08:46 +00:00

38 lines
1.1 KiB
C++

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/browser_main.h"
#include <memory>
#include "base/trace_event/trace_event.h"
#include "content/browser/browser_main_runner_impl.h"
#include "content/common/content_constants_internal.h"
namespace content {
// Main routine for running as the Browser process.
int BrowserMain(MainFunctionParams parameters) {
TRACE_EVENT_INSTANT0("startup", "BrowserMain", TRACE_EVENT_SCOPE_THREAD);
base::trace_event::TraceLog::GetInstance()->set_process_name("Browser");
base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex(
kTraceEventBrowserProcessSortIndex);
std::unique_ptr<BrowserMainRunnerImpl> main_runner(
BrowserMainRunnerImpl::Create());
int exit_code = main_runner->Initialize(std::move(parameters));
if (exit_code >= 0)
return exit_code;
exit_code = main_runner->Run();
main_runner->Shutdown();
return exit_code;
}
} // namespace content