OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/allocator/allocator_shim.h" | 7 #include "base/allocator/allocator_shim.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "content/browser/browser_main_loop.h" | 12 #include "content/browser/browser_main_loop.h" |
13 #include "content/browser/notification_service_impl.h" | 13 #include "content/browser/notification_service_impl.h" |
14 #include "content/common/main_function_params.h" | |
15 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "content/public/common/main_function_params.h" |
16 | 16 |
17 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
18 #include "base/win/scoped_com_initializer.h" | 18 #include "base/win/scoped_com_initializer.h" |
19 #endif | 19 #endif |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 bool g_exited_main_message_loop = false; | 23 bool g_exited_main_message_loop = false; |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 bool ExitedMainMessageLoop() { | 29 bool ExitedMainMessageLoop() { |
30 return g_exited_main_message_loop; | 30 return g_exited_main_message_loop; |
31 } | 31 } |
32 | 32 |
33 } // namespace content | 33 } // namespace content |
34 | 34 |
35 // Main routine for running as the Browser process. | 35 // Main routine for running as the Browser process. |
36 int BrowserMain(const MainFunctionParams& parameters) { | 36 int BrowserMain(const content::MainFunctionParams& parameters) { |
37 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); | 37 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); |
38 | 38 |
39 NotificationServiceImpl main_notification_service; | 39 NotificationServiceImpl main_notification_service; |
40 | 40 |
41 scoped_ptr<content::BrowserMainLoop> main_loop( | 41 scoped_ptr<content::BrowserMainLoop> main_loop( |
42 new content::BrowserMainLoop(parameters)); | 42 new content::BrowserMainLoop(parameters)); |
43 | 43 |
44 main_loop->Init(); | 44 main_loop->Init(); |
45 | 45 |
46 main_loop->EarlyInitialization(); | 46 main_loop->EarlyInitialization(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 #endif // OS_WIN | 88 #endif // OS_WIN |
89 | 89 |
90 base::StatisticsRecorder statistics; | 90 base::StatisticsRecorder statistics; |
91 | 91 |
92 main_loop->RunMainMessageLoopParts(&g_exited_main_message_loop); | 92 main_loop->RunMainMessageLoopParts(&g_exited_main_message_loop); |
93 | 93 |
94 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 94 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
95 | 95 |
96 return main_loop->GetResultCode(); | 96 return main_loop->GetResultCode(); |
97 } | 97 } |
OLD | NEW |