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 "chrome/browser/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "app/hi_res_timer_manager.h" | |
12 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
13 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
14 #include "app/system_monitor.h" | |
15 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
16 #include "base/command_line.h" | 14 #include "base/command_line.h" |
17 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
18 #include "base/file_path.h" | 16 #include "base/file_path.h" |
19 #include "base/file_util.h" | 17 #include "base/file_util.h" |
20 #include "base/mac/scoped_nsautorelease_pool.h" | 18 #include "base/mac/scoped_nsautorelease_pool.h" |
21 #include "base/metrics/field_trial.h" | 19 #include "base/metrics/field_trial.h" |
22 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
23 #include "base/path_service.h" | 21 #include "base/path_service.h" |
24 #include "base/threading/platform_thread.h" | 22 #include "base/threading/platform_thread.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "chrome/browser/service/service_process_control_manager.h" | 69 #include "chrome/browser/service/service_process_control_manager.h" |
72 #include "chrome/browser/shell_integration.h" | 70 #include "chrome/browser/shell_integration.h" |
73 #include "chrome/browser/translate/translate_manager.h" | 71 #include "chrome/browser/translate/translate_manager.h" |
74 #include "chrome/browser/ui/browser.h" | 72 #include "chrome/browser/ui/browser.h" |
75 #include "chrome/browser/ui/browser_init.h" | 73 #include "chrome/browser/ui/browser_init.h" |
76 #include "chrome/common/child_process.h" | 74 #include "chrome/common/child_process.h" |
77 #include "chrome/common/chrome_constants.h" | 75 #include "chrome/common/chrome_constants.h" |
78 #include "chrome/common/chrome_paths.h" | 76 #include "chrome/common/chrome_paths.h" |
79 #include "chrome/common/chrome_switches.h" | 77 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/env_vars.h" | 78 #include "chrome/common/env_vars.h" |
| 79 #include "chrome/common/hi_res_timer_manager.h" |
81 #include "chrome/common/json_pref_store.h" | 80 #include "chrome/common/json_pref_store.h" |
82 #include "chrome/common/jstemplate_builder.h" | 81 #include "chrome/common/jstemplate_builder.h" |
83 #include "chrome/common/logging_chrome.h" | 82 #include "chrome/common/logging_chrome.h" |
84 #include "chrome/common/main_function_params.h" | 83 #include "chrome/common/main_function_params.h" |
85 #include "chrome/common/net/net_resource_provider.h" | 84 #include "chrome/common/net/net_resource_provider.h" |
86 #include "chrome/common/pref_names.h" | 85 #include "chrome/common/pref_names.h" |
87 #include "chrome/common/result_codes.h" | 86 #include "chrome/common/result_codes.h" |
88 #include "chrome/installer/util/google_update_settings.h" | 87 #include "chrome/installer/util/google_update_settings.h" |
89 #include "grit/app_locale_settings.h" | 88 #include "grit/app_locale_settings.h" |
90 #include "grit/chromium_strings.h" | 89 #include "grit/chromium_strings.h" |
91 #include "grit/generated_resources.h" | 90 #include "grit/generated_resources.h" |
92 #include "net/base/cookie_monster.h" | 91 #include "net/base/cookie_monster.h" |
93 #include "net/base/net_module.h" | 92 #include "net/base/net_module.h" |
94 #include "net/base/network_change_notifier.h" | 93 #include "net/base/network_change_notifier.h" |
95 #include "net/http/http_network_layer.h" | 94 #include "net/http/http_network_layer.h" |
96 #include "net/http/http_stream_factory.h" | 95 #include "net/http/http_stream_factory.h" |
97 #include "net/socket/client_socket_pool_base.h" | 96 #include "net/socket/client_socket_pool_base.h" |
98 #include "net/socket/client_socket_pool_manager.h" | 97 #include "net/socket/client_socket_pool_manager.h" |
99 #include "net/socket/tcp_client_socket.h" | 98 #include "net/socket/tcp_client_socket.h" |
100 #include "net/spdy/spdy_session.h" | 99 #include "net/spdy/spdy_session.h" |
101 #include "net/spdy/spdy_session_pool.h" | 100 #include "net/spdy/spdy_session_pool.h" |
102 #include "net/url_request/url_request.h" | 101 #include "net/url_request/url_request.h" |
103 #include "net/url_request/url_request_throttler_manager.h" | 102 #include "net/url_request/url_request_throttler_manager.h" |
| 103 #include "ui/base/system_monitor/system_monitor.h" |
104 | 104 |
105 #if defined(USE_LINUX_BREAKPAD) | 105 #if defined(USE_LINUX_BREAKPAD) |
106 #include "base/linux_util.h" | 106 #include "base/linux_util.h" |
107 #include "chrome/app/breakpad_linux.h" | 107 #include "chrome/app/breakpad_linux.h" |
108 #endif | 108 #endif |
109 | 109 |
110 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 110 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
111 #include <dbus/dbus-glib.h> | 111 #include <dbus/dbus-glib.h> |
112 #include "chrome/browser/browser_main_gtk.h" | 112 #include "chrome/browser/browser_main_gtk.h" |
113 #include "chrome/browser/gtk/gtk_util.h" | 113 #include "chrome/browser/gtk/gtk_util.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 462 } |
463 | 463 |
464 // BrowserMainParts: |MainMessageLoopStart()| and related ---------------------- | 464 // BrowserMainParts: |MainMessageLoopStart()| and related ---------------------- |
465 | 465 |
466 void BrowserMainParts::MainMessageLoopStart() { | 466 void BrowserMainParts::MainMessageLoopStart() { |
467 PreMainMessageLoopStart(); | 467 PreMainMessageLoopStart(); |
468 | 468 |
469 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 469 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
470 | 470 |
471 // TODO(viettrungluu): should these really go before setting the thread name? | 471 // TODO(viettrungluu): should these really go before setting the thread name? |
472 system_monitor_.reset(new SystemMonitor); | 472 system_monitor_.reset(new ui::SystemMonitor); |
473 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 473 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
474 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 474 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
475 | 475 |
476 InitializeMainThread(); | 476 InitializeMainThread(); |
477 | 477 |
478 PostMainMessageLoopStart(); | 478 PostMainMessageLoopStart(); |
479 } | 479 } |
480 | 480 |
481 void BrowserMainParts::InitializeMainThread() { | 481 void BrowserMainParts::InitializeMainThread() { |
482 const char* kThreadName = "CrBrowserMain"; | 482 const char* kThreadName = "CrBrowserMain"; |
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 #if defined(OS_CHROMEOS) | 1735 #if defined(OS_CHROMEOS) |
1736 // To be precise, logout (browser shutdown) is not yet done, but the | 1736 // To be precise, logout (browser shutdown) is not yet done, but the |
1737 // remaining work is negligible, hence we say LogoutDone here. | 1737 // remaining work is negligible, hence we say LogoutDone here. |
1738 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1738 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1739 false); | 1739 false); |
1740 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1740 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1741 #endif | 1741 #endif |
1742 TRACE_EVENT_END("BrowserMain", 0, 0); | 1742 TRACE_EVENT_END("BrowserMain", 0, 0); |
1743 return result_code; | 1743 return result_code; |
1744 } | 1744 } |
OLD | NEW |