| 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" | |
| 217 #include "ui/base/l10n/l10n_util_win.h" | 216 #include "ui/base/l10n/l10n_util_win.h" |
| 218 #include "ui/shell_dialogs/select_file_dialog.h" | 217 #include "ui/shell_dialogs/select_file_dialog.h" |
| 219 #endif // defined(OS_WIN) | 218 #endif // defined(OS_WIN) |
| 220 | 219 |
| 221 #if defined(OS_MACOSX) | 220 #if defined(OS_MACOSX) |
| 222 #include <Security/Security.h> | 221 #include <Security/Security.h> |
| 223 | 222 |
| 224 #include "base/mac/scoped_nsautorelease_pool.h" | 223 #include "base/mac/scoped_nsautorelease_pool.h" |
| 225 #include "chrome/browser/mac/keystone_glue.h" | 224 #include "chrome/browser/mac/keystone_glue.h" |
| 226 #endif // defined(OS_MACOSX) | 225 #endif // defined(OS_MACOSX) |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 // browser windows and tabs, but no progress has been made in loading | 1398 // browser windows and tabs, but no progress has been made in loading |
| 1400 // content as the main message loop hasn't started processing tasks yet. | 1399 // content as the main message loop hasn't started processing tasks yet. |
| 1401 // We setup to observe to the initial page load here to defer running | 1400 // We setup to observe to the initial page load here to defer running |
| 1402 // task posted via PostAfterStartupTask until its complete. | 1401 // task posted via PostAfterStartupTask until its complete. |
| 1403 AfterStartupTaskUtils::StartMonitoringStartup(); | 1402 AfterStartupTaskUtils::StartMonitoringStartup(); |
| 1404 } | 1403 } |
| 1405 | 1404 |
| 1406 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { | 1405 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
| 1407 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); | 1406 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); |
| 1408 | 1407 |
| 1409 #if defined(OS_WIN) | |
| 1410 HMODULE chrome_elf = GetModuleHandle(chrome::kChromeElfDllName); | |
| 1411 if (chrome_elf) { | |
| 1412 auto block_until_handler_started = reinterpret_cast<void (*)()>( | |
| 1413 GetProcAddress(chrome_elf, "BlockUntilHandlerStartedImpl")); | |
| 1414 if (block_until_handler_started) { | |
| 1415 SCOPED_UMA_HISTOGRAM_TIMER("Startup.BlockForCrashpadHandlerStartupTime"); | |
| 1416 block_until_handler_started(); | |
| 1417 } | |
| 1418 } | |
| 1419 #endif | |
| 1420 | |
| 1421 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); | 1408 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); |
| 1422 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); | 1409 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); |
| 1423 | 1410 |
| 1424 // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the | 1411 // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the |
| 1425 // blocking pool, which is disabled until the CreateThreads phase of startup. | 1412 // blocking pool, which is disabled until the CreateThreads phase of startup. |
| 1426 SetupMetrics(); | 1413 SetupMetrics(); |
| 1427 | 1414 |
| 1428 #if defined(OS_WIN) | 1415 #if defined(OS_WIN) |
| 1429 // Windows parental controls calls can be slow, so we do an early init here | 1416 // Windows parental controls calls can be slow, so we do an early init here |
| 1430 // that calculates this value off of the UI thread. | 1417 // that calculates this value off of the UI thread. |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2100 chromeos::CrosSettings::Shutdown(); | 2087 chromeos::CrosSettings::Shutdown(); |
| 2101 #endif // defined(OS_CHROMEOS) | 2088 #endif // defined(OS_CHROMEOS) |
| 2102 #endif // defined(OS_ANDROID) | 2089 #endif // defined(OS_ANDROID) |
| 2103 } | 2090 } |
| 2104 | 2091 |
| 2105 // Public members: | 2092 // Public members: |
| 2106 | 2093 |
| 2107 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2094 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2108 chrome_extra_parts_.push_back(parts); | 2095 chrome_extra_parts_.push_back(parts); |
| 2109 } | 2096 } |
| OLD | NEW |