OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/browser_main.h" | 5 #include "content/browser/browser_main.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "content/common/content_constants_internal.h" | 8 #include "content/common/content_constants_internal.h" |
9 #include "content/public/browser/browser_main_runner.h" | 9 #include "content/public/browser/browser_main_runner.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // Main routine for running as the Browser process. | 13 // Main routine for running as the Browser process. |
14 int BrowserMain(const MainFunctionParams& parameters) { | 14 int BrowserMain(const MainFunctionParams& parameters) { |
15 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); | 15 // Don't use the TRACE_EVENT0 macro because the tracing infrastructure doesn't |
16 // expect synchronous events around the main loop of a thread. | |
17 TRACE_EVENT_ASYNC_BEGIN0("startup", "BrowserMain", 0); | |
18 | |
16 base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser"); | 19 base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser"); |
17 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( | 20 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( |
18 kTraceEventBrowserProcessSortIndex); | 21 kTraceEventBrowserProcessSortIndex); |
19 | 22 |
20 scoped_ptr<BrowserMainRunner> main_runner(BrowserMainRunner::Create()); | 23 scoped_ptr<BrowserMainRunner> main_runner(BrowserMainRunner::Create()); |
21 | 24 |
22 int exit_code = main_runner->Initialize(parameters); | 25 int exit_code = main_runner->Initialize(parameters); |
23 if (exit_code >= 0) | 26 if (exit_code >= 0) |
24 return exit_code; | 27 return exit_code; |
25 | 28 |
26 exit_code = main_runner->Run(); | 29 exit_code = main_runner->Run(); |
27 | 30 |
28 main_runner->Shutdown(); | 31 main_runner->Shutdown(); |
29 | 32 |
30 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 33 TRACE_EVENT_ASYNC_END0("startup", "BrowserMain", 0); |
beaudoin
2015/10/06 20:57:38
There's a "return" a couple of lines above that wi
brucedawson
2015/10/07 00:42:56
Seems worth fixing.
fdoray
2015/10/07 15:46:49
Done.
| |
31 | 34 |
32 return exit_code; | 35 return exit_code; |
33 } | 36 } |
34 | 37 |
35 } // namespace content | 38 } // namespace content |
OLD | NEW |