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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 #include "chrome/browser/downgrade/user_data_downgrade.h" | 206 #include "chrome/browser/downgrade/user_data_downgrade.h" |
207 #include "chrome/browser/first_run/try_chrome_dialog_view.h" | 207 #include "chrome/browser/first_run/try_chrome_dialog_view.h" |
208 #include "chrome/browser/first_run/upgrade_util_win.h" | 208 #include "chrome/browser/first_run/upgrade_util_win.h" |
209 #include "chrome/browser/ui/network_profile_bubble.h" | 209 #include "chrome/browser/ui/network_profile_bubble.h" |
210 #include "chrome/browser/win/browser_util.h" | 210 #include "chrome/browser/win/browser_util.h" |
211 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" | 211 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" |
212 #include "chrome/installer/util/browser_distribution.h" | 212 #include "chrome/installer/util/browser_distribution.h" |
213 #include "chrome/installer/util/helper.h" | 213 #include "chrome/installer/util/helper.h" |
214 #include "chrome/installer/util/install_util.h" | 214 #include "chrome/installer/util/install_util.h" |
215 #include "chrome/installer/util/shell_util.h" | 215 #include "chrome/installer/util/shell_util.h" |
216 #include "components/crash/content/app/crashpad.h" | |
216 #include "ui/base/l10n/l10n_util_win.h" | 217 #include "ui/base/l10n/l10n_util_win.h" |
217 #include "ui/shell_dialogs/select_file_dialog.h" | 218 #include "ui/shell_dialogs/select_file_dialog.h" |
218 #endif // defined(OS_WIN) | 219 #endif // defined(OS_WIN) |
219 | 220 |
220 #if defined(OS_MACOSX) | 221 #if defined(OS_MACOSX) |
221 #include <Security/Security.h> | 222 #include <Security/Security.h> |
222 | 223 |
223 #include "base/mac/scoped_nsautorelease_pool.h" | 224 #include "base/mac/scoped_nsautorelease_pool.h" |
224 #include "chrome/browser/mac/keystone_glue.h" | 225 #include "chrome/browser/mac/keystone_glue.h" |
225 #endif // defined(OS_MACOSX) | 226 #endif // defined(OS_MACOSX) |
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1404 // browser windows and tabs, but no progress has been made in loading | 1405 // browser windows and tabs, but no progress has been made in loading |
1405 // content as the main message loop hasn't started processing tasks yet. | 1406 // content as the main message loop hasn't started processing tasks yet. |
1406 // We setup to observe to the initial page load here to defer running | 1407 // We setup to observe to the initial page load here to defer running |
1407 // task posted via PostAfterStartupTask until its complete. | 1408 // task posted via PostAfterStartupTask until its complete. |
1408 AfterStartupTaskUtils::StartMonitoringStartup(); | 1409 AfterStartupTaskUtils::StartMonitoringStartup(); |
1409 } | 1410 } |
1410 | 1411 |
1411 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { | 1412 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
1412 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); | 1413 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); |
1413 | 1414 |
1415 #if defined(OS_WIN) | |
1416 HMODULE chrome_elf = GetModuleHandle(chrome::kChromeElfDllName); | |
1417 if (chrome_elf) { | |
1418 auto block_until_handler_started = reinterpret_cast<void (*)()>( | |
1419 GetProcAddress(chrome_elf, "BlockUntilHandlerStartedImpl")); | |
robertshield
2016/12/09 01:56:44
This isn't in elf's .def file. Should it be?
scottmg
2016/12/09 20:23:14
We seem to have a mix of __declspec(dllexport) and
robertshield
2016/12/09 21:11:47
No worries, just thought it was a bit weird that w
scottmg
2016/12/13 18:46:59
Yeah, it's a bit messy. I think "Impl" has been us
| |
1420 if (block_until_handler_started) { | |
1421 SCOPED_UMA_HISTOGRAM_TIMER("Startup.BlockForCrashpadHandlerStartupTime"); | |
1422 block_until_handler_started(); | |
robertshield
2016/12/09 21:11:47
This is a WaitForSingleObject(.., INFINITE) at Chr
scottmg
2016/12/13 18:46:59
Updated so that it waits a maximum of 5s. There's
| |
1423 } | |
1424 } | |
1425 #endif | |
1426 | |
1414 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); | 1427 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); |
1415 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); | 1428 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); |
1416 | 1429 |
1417 // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the | 1430 // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the |
1418 // blocking pool, which is disabled until the CreateThreads phase of startup. | 1431 // blocking pool, which is disabled until the CreateThreads phase of startup. |
1419 SetupMetrics(); | 1432 SetupMetrics(); |
1420 | 1433 |
1421 #if defined(OS_WIN) | 1434 #if defined(OS_WIN) |
1422 // Windows parental controls calls can be slow, so we do an early init here | 1435 // Windows parental controls calls can be slow, so we do an early init here |
1423 // that calculates this value off of the UI thread. | 1436 // that calculates this value off of the UI thread. |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2095 chromeos::CrosSettings::Shutdown(); | 2108 chromeos::CrosSettings::Shutdown(); |
2096 #endif // defined(OS_CHROMEOS) | 2109 #endif // defined(OS_CHROMEOS) |
2097 #endif // defined(OS_ANDROID) | 2110 #endif // defined(OS_ANDROID) |
2098 } | 2111 } |
2099 | 2112 |
2100 // Public members: | 2113 // Public members: |
2101 | 2114 |
2102 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2115 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2103 chrome_extra_parts_.push_back(parts); | 2116 chrome_extra_parts_.push_back(parts); |
2104 } | 2117 } |
OLD | NEW |