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 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
79 #include "chrome/common/env_vars.h" | 79 #include "chrome/common/env_vars.h" |
80 #include "chrome/common/gfx_resource_provider.h" | 80 #include "chrome/common/gfx_resource_provider.h" |
81 #include "chrome/common/hi_res_timer_manager.h" | 81 #include "chrome/common/hi_res_timer_manager.h" |
82 #include "chrome/common/json_pref_store.h" | 82 #include "chrome/common/json_pref_store.h" |
83 #include "chrome/common/jstemplate_builder.h" | 83 #include "chrome/common/jstemplate_builder.h" |
84 #include "chrome/common/logging_chrome.h" | 84 #include "chrome/common/logging_chrome.h" |
85 #include "chrome/common/main_function_params.h" | 85 #include "chrome/common/main_function_params.h" |
86 #include "chrome/common/net/net_resource_provider.h" | 86 #include "chrome/common/net/net_resource_provider.h" |
87 #include "chrome/common/pref_names.h" | 87 #include "chrome/common/pref_names.h" |
| 88 #include "chrome/common/profiling.h" |
88 #include "chrome/common/result_codes.h" | 89 #include "chrome/common/result_codes.h" |
89 #include "chrome/installer/util/google_update_settings.h" | 90 #include "chrome/installer/util/google_update_settings.h" |
90 #include "gfx/gfx_module.h" | 91 #include "gfx/gfx_module.h" |
91 #include "grit/app_locale_settings.h" | 92 #include "grit/app_locale_settings.h" |
92 #include "grit/chromium_strings.h" | 93 #include "grit/chromium_strings.h" |
93 #include "grit/generated_resources.h" | 94 #include "grit/generated_resources.h" |
94 #include "net/base/cookie_monster.h" | 95 #include "net/base/cookie_monster.h" |
95 #include "net/base/net_module.h" | 96 #include "net/base/net_module.h" |
96 #include "net/base/network_change_notifier.h" | 97 #include "net/base/network_change_notifier.h" |
97 #include "net/http/http_network_layer.h" | 98 #include "net/http/http_network_layer.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 500 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
500 | 501 |
501 // TODO(viettrungluu): should these really go before setting the thread name? | 502 // TODO(viettrungluu): should these really go before setting the thread name? |
502 system_monitor_.reset(new ui::SystemMonitor); | 503 system_monitor_.reset(new ui::SystemMonitor); |
503 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 504 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
504 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 505 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
505 | 506 |
506 InitializeMainThread(); | 507 InitializeMainThread(); |
507 | 508 |
508 PostMainMessageLoopStart(); | 509 PostMainMessageLoopStart(); |
| 510 Profiling::MainMessageLoopStarted(); |
509 } | 511 } |
510 | 512 |
511 void BrowserMainParts::InitializeMainThread() { | 513 void BrowserMainParts::InitializeMainThread() { |
512 const char* kThreadName = "CrBrowserMain"; | 514 const char* kThreadName = "CrBrowserMain"; |
513 base::PlatformThread::SetName(kThreadName); | 515 base::PlatformThread::SetName(kThreadName); |
514 main_message_loop().set_thread_name(kThreadName); | 516 main_message_loop().set_thread_name(kThreadName); |
515 | 517 |
516 // Register the main thread by instantiating it, but don't call any methods. | 518 // Register the main thread by instantiating it, but don't call any methods. |
517 main_thread_.reset(new BrowserThread(BrowserThread::UI, | 519 main_thread_.reset(new BrowserThread(BrowserThread::UI, |
518 MessageLoop::current())); | 520 MessageLoop::current())); |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 #if defined(OS_CHROMEOS) | 1799 #if defined(OS_CHROMEOS) |
1798 // To be precise, logout (browser shutdown) is not yet done, but the | 1800 // To be precise, logout (browser shutdown) is not yet done, but the |
1799 // remaining work is negligible, hence we say LogoutDone here. | 1801 // remaining work is negligible, hence we say LogoutDone here. |
1800 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1802 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1801 false); | 1803 false); |
1802 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1804 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1803 #endif | 1805 #endif |
1804 TRACE_EVENT_END("BrowserMain", 0, 0); | 1806 TRACE_EVENT_END("BrowserMain", 0, 0); |
1805 return result_code; | 1807 return result_code; |
1806 } | 1808 } |
OLD | NEW |