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/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/system_monitor/system_monitor.h" | 13 #include "base/system_monitor/system_monitor.h" |
14 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
15 #include "base/tracked_objects.h" | 15 #include "base/tracked_objects.h" |
16 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
| 17 #include "content/browser/notification_service_impl.h" |
17 #include "content/common/hi_res_timer_manager.h" | 18 #include "content/common/hi_res_timer_manager.h" |
18 #include "content/common/main_function_params.h" | 19 #include "content/common/main_function_params.h" |
19 #include "content/common/notification_service.h" | |
20 #include "content/common/result_codes.h" | 20 #include "content/common/result_codes.h" |
21 #include "content/common/sandbox_policy.h" | 21 #include "content/common/sandbox_policy.h" |
22 #include "content/public/browser/content_browser_client.h" | 22 #include "content/public/browser/content_browser_client.h" |
23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
24 #include "crypto/nss_util.h" | 24 #include "crypto/nss_util.h" |
25 #include "net/base/network_change_notifier.h" | 25 #include "net/base/network_change_notifier.h" |
26 #include "net/base/ssl_config_service.h" | 26 #include "net/base/ssl_config_service.h" |
27 #include "net/socket/client_socket_factory.h" | 27 #include "net/socket/client_socket_factory.h" |
28 #include "net/socket/tcp_client_socket.h" | 28 #include "net/socket/tcp_client_socket.h" |
29 | 29 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 bool ExitedMainMessageLoop() { | 368 bool ExitedMainMessageLoop() { |
369 return g_exited_main_message_loop; | 369 return g_exited_main_message_loop; |
370 } | 370 } |
371 | 371 |
372 } // namespace content | 372 } // namespace content |
373 | 373 |
374 // Main routine for running as the Browser process. | 374 // Main routine for running as the Browser process. |
375 int BrowserMain(const MainFunctionParams& parameters) { | 375 int BrowserMain(const MainFunctionParams& parameters) { |
376 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); | 376 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); |
377 | 377 |
378 NotificationService main_notification_service; | 378 NotificationServiceImpl main_notification_service; |
379 | 379 |
380 scoped_ptr<content::BrowserMainParts> parts( | 380 scoped_ptr<content::BrowserMainParts> parts( |
381 content::GetContentClient()->browser()->CreateBrowserMainParts( | 381 content::GetContentClient()->browser()->CreateBrowserMainParts( |
382 parameters)); | 382 parameters)); |
383 if (!parts.get()) | 383 if (!parts.get()) |
384 parts.reset(new content::BrowserMainParts(parameters)); | 384 parts.reset(new content::BrowserMainParts(parameters)); |
385 | 385 |
386 parts->EarlyInitialization(); | 386 parts->EarlyInitialization(); |
387 | 387 |
388 // Must happen before we try to use a message loop or display any UI. | 388 // Must happen before we try to use a message loop or display any UI. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 base::win::ScopedCOMInitializer com_initializer; | 432 base::win::ScopedCOMInitializer com_initializer; |
433 #endif // OS_WIN | 433 #endif // OS_WIN |
434 | 434 |
435 base::StatisticsRecorder statistics; | 435 base::StatisticsRecorder statistics; |
436 | 436 |
437 parts->RunMainMessageLoopParts(); | 437 parts->RunMainMessageLoopParts(); |
438 | 438 |
439 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 439 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
440 return parts->result_code(); | 440 return parts->result_code(); |
441 } | 441 } |
OLD | NEW |