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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 #include "chrome/browser/downgrade/user_data_downgrade.h" | 205 #include "chrome/browser/downgrade/user_data_downgrade.h" |
206 #include "chrome/browser/first_run/try_chrome_dialog_view.h" | 206 #include "chrome/browser/first_run/try_chrome_dialog_view.h" |
207 #include "chrome/browser/first_run/upgrade_util_win.h" | 207 #include "chrome/browser/first_run/upgrade_util_win.h" |
208 #include "chrome/browser/ui/network_profile_bubble.h" | 208 #include "chrome/browser/ui/network_profile_bubble.h" |
209 #include "chrome/browser/win/browser_util.h" | 209 #include "chrome/browser/win/browser_util.h" |
210 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" | 210 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" |
211 #include "chrome/installer/util/browser_distribution.h" | 211 #include "chrome/installer/util/browser_distribution.h" |
212 #include "chrome/installer/util/helper.h" | 212 #include "chrome/installer/util/helper.h" |
213 #include "chrome/installer/util/install_util.h" | 213 #include "chrome/installer/util/install_util.h" |
214 #include "chrome/installer/util/shell_util.h" | 214 #include "chrome/installer/util/shell_util.h" |
| 215 #include "components/crash/content/app/crashpad.h" |
215 #include "ui/base/l10n/l10n_util_win.h" | 216 #include "ui/base/l10n/l10n_util_win.h" |
216 #include "ui/shell_dialogs/select_file_dialog.h" | 217 #include "ui/shell_dialogs/select_file_dialog.h" |
217 #endif // defined(OS_WIN) | 218 #endif // defined(OS_WIN) |
218 | 219 |
219 #if defined(OS_MACOSX) | 220 #if defined(OS_MACOSX) |
220 #include <Security/Security.h> | 221 #include <Security/Security.h> |
221 | 222 |
222 #include "base/mac/scoped_nsautorelease_pool.h" | 223 #include "base/mac/scoped_nsautorelease_pool.h" |
223 #include "chrome/browser/mac/keystone_glue.h" | 224 #include "chrome/browser/mac/keystone_glue.h" |
224 #endif // defined(OS_MACOSX) | 225 #endif // defined(OS_MACOSX) |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 // browser windows and tabs, but no progress has been made in loading | 1396 // browser windows and tabs, but no progress has been made in loading |
1396 // content as the main message loop hasn't started processing tasks yet. | 1397 // content as the main message loop hasn't started processing tasks yet. |
1397 // We setup to observe to the initial page load here to defer running | 1398 // We setup to observe to the initial page load here to defer running |
1398 // task posted via PostAfterStartupTask until its complete. | 1399 // task posted via PostAfterStartupTask until its complete. |
1399 AfterStartupTaskUtils::StartMonitoringStartup(); | 1400 AfterStartupTaskUtils::StartMonitoringStartup(); |
1400 } | 1401 } |
1401 | 1402 |
1402 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { | 1403 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
1403 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); | 1404 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); |
1404 | 1405 |
| 1406 #if defined(OS_WIN) |
| 1407 HMODULE chrome_elf = GetModuleHandle(chrome::kChromeElfDllName); |
| 1408 if (chrome_elf) { |
| 1409 auto block_until_handler_started = reinterpret_cast<void (*)()>( |
| 1410 GetProcAddress(chrome_elf, "BlockUntilHandlerStartedImpl")); |
| 1411 if (block_until_handler_started) { |
| 1412 SCOPED_UMA_HISTOGRAM_TIMER("Startup.BlockForCrashpadHandlerStartupTime"); |
| 1413 block_until_handler_started(); |
| 1414 } |
| 1415 } |
| 1416 #endif |
| 1417 |
1405 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); | 1418 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); |
1406 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); | 1419 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); |
1407 | 1420 |
1408 // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the | 1421 // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the |
1409 // blocking pool, which is disabled until the CreateThreads phase of startup. | 1422 // blocking pool, which is disabled until the CreateThreads phase of startup. |
1410 SetupMetrics(); | 1423 SetupMetrics(); |
1411 | 1424 |
1412 #if defined(OS_WIN) | 1425 #if defined(OS_WIN) |
1413 // Windows parental controls calls can be slow, so we do an early init here | 1426 // Windows parental controls calls can be slow, so we do an early init here |
1414 // that calculates this value off of the UI thread. | 1427 // that calculates this value off of the UI thread. |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 chromeos::CrosSettings::Shutdown(); | 2092 chromeos::CrosSettings::Shutdown(); |
2080 #endif // defined(OS_CHROMEOS) | 2093 #endif // defined(OS_CHROMEOS) |
2081 #endif // defined(OS_ANDROID) | 2094 #endif // defined(OS_ANDROID) |
2082 } | 2095 } |
2083 | 2096 |
2084 // Public members: | 2097 // Public members: |
2085 | 2098 |
2086 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2099 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2087 chrome_extra_parts_.push_back(parts); | 2100 chrome_extra_parts_.push_back(parts); |
2088 } | 2101 } |
OLD | NEW |