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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "chrome/browser/search_engines/template_url_service_factory.h" | 71 #include "chrome/browser/search_engines/template_url_service_factory.h" |
72 #include "chrome/browser/service/service_process_control.h" | 72 #include "chrome/browser/service/service_process_control.h" |
73 #include "chrome/browser/shell_integration.h" | 73 #include "chrome/browser/shell_integration.h" |
74 #include "chrome/browser/translate/translate_manager.h" | 74 #include "chrome/browser/translate/translate_manager.h" |
75 #include "chrome/browser/ui/browser.h" | 75 #include "chrome/browser/ui/browser.h" |
76 #include "chrome/browser/ui/browser_init.h" | 76 #include "chrome/browser/ui/browser_init.h" |
77 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 77 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
78 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" | 78 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" |
79 #include "chrome/common/chrome_constants.h" | 79 #include "chrome/common/chrome_constants.h" |
80 #include "chrome/common/chrome_paths.h" | 80 #include "chrome/common/chrome_paths.h" |
| 81 #include "chrome/common/chrome_result_codes.h" |
81 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
82 #include "chrome/common/chrome_version_info.h" | 83 #include "chrome/common/chrome_version_info.h" |
83 #include "chrome/common/env_vars.h" | 84 #include "chrome/common/env_vars.h" |
84 #include "chrome/common/json_pref_store.h" | 85 #include "chrome/common/json_pref_store.h" |
85 #include "chrome/common/jstemplate_builder.h" | 86 #include "chrome/common/jstemplate_builder.h" |
86 #include "chrome/common/logging_chrome.h" | 87 #include "chrome/common/logging_chrome.h" |
87 #include "chrome/common/net/net_resource_provider.h" | 88 #include "chrome/common/net/net_resource_provider.h" |
88 #include "chrome/common/pref_names.h" | 89 #include "chrome/common/pref_names.h" |
89 #include "chrome/common/profiling.h" | 90 #include "chrome/common/profiling.h" |
90 #include "chrome/installer/util/google_update_settings.h" | 91 #include "chrome/installer/util/google_update_settings.h" |
91 #include "content/browser/browser_thread.h" | 92 #include "content/browser/browser_thread.h" |
92 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 93 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
93 #include "content/common/child_process.h" | 94 #include "content/common/child_process.h" |
94 #include "content/common/content_client.h" | 95 #include "content/common/content_client.h" |
95 #include "content/common/hi_res_timer_manager.h" | 96 #include "content/common/hi_res_timer_manager.h" |
96 #include "content/common/main_function_params.h" | 97 #include "content/common/main_function_params.h" |
97 #include "content/common/result_codes.h" | |
98 #include "grit/app_locale_settings.h" | 98 #include "grit/app_locale_settings.h" |
99 #include "grit/chromium_strings.h" | 99 #include "grit/chromium_strings.h" |
100 #include "grit/generated_resources.h" | 100 #include "grit/generated_resources.h" |
101 #include "grit/platform_locale_settings.h" | 101 #include "grit/platform_locale_settings.h" |
102 #include "net/base/cookie_monster.h" | 102 #include "net/base/cookie_monster.h" |
103 #include "net/base/net_module.h" | 103 #include "net/base/net_module.h" |
104 #include "net/base/network_change_notifier.h" | 104 #include "net/base/network_change_notifier.h" |
105 #include "net/http/http_basic_stream.h" | 105 #include "net/http/http_basic_stream.h" |
106 #include "net/http/http_network_layer.h" | 106 #include "net/http/http_network_layer.h" |
107 #include "net/http/http_stream_factory.h" | 107 #include "net/http/http_stream_factory.h" |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 // It seems that we don't need to run the experiment since chrome | 1421 // It seems that we don't need to run the experiment since chrome |
1422 // in the same profile is already running. | 1422 // in the same profile is already running. |
1423 VLOG(1) << "Retention experiment not required"; | 1423 VLOG(1) << "Retention experiment not required"; |
1424 return TryChromeDialogView::NOT_NOW; | 1424 return TryChromeDialogView::NOT_NOW; |
1425 } | 1425 } |
1426 int try_chrome_int; | 1426 int try_chrome_int; |
1427 base::StringToInt(try_chrome, &try_chrome_int); | 1427 base::StringToInt(try_chrome, &try_chrome_int); |
1428 TryChromeDialogView::Result answer = | 1428 TryChromeDialogView::Result answer = |
1429 TryChromeDialogView::Show(try_chrome_int, &process_singleton); | 1429 TryChromeDialogView::Show(try_chrome_int, &process_singleton); |
1430 if (answer == TryChromeDialogView::NOT_NOW) | 1430 if (answer == TryChromeDialogView::NOT_NOW) |
1431 return ResultCodes::NORMAL_EXIT_CANCEL; | 1431 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; |
1432 if (answer == TryChromeDialogView::UNINSTALL_CHROME) | 1432 if (answer == TryChromeDialogView::UNINSTALL_CHROME) |
1433 return ResultCodes::NORMAL_EXIT_EXP2; | 1433 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; |
1434 #else | 1434 #else |
1435 // We don't support retention experiments on Mac or Linux. | 1435 // We don't support retention experiments on Mac or Linux. |
1436 return ResultCodes::NORMAL_EXIT; | 1436 return content::RESULT_CODE_NORMAL_EXIT; |
1437 #endif // defined(OS_WIN) | 1437 #endif // defined(OS_WIN) |
1438 } | 1438 } |
1439 | 1439 |
1440 #if defined(OS_CHROMEOS) | 1440 #if defined(OS_CHROMEOS) |
1441 // This needs to be called after the locale has been set. | 1441 // This needs to be called after the locale has been set. |
1442 RegisterTranslateableItems(); | 1442 RegisterTranslateableItems(); |
1443 #endif | 1443 #endif |
1444 | 1444 |
1445 #if defined(TOOLKIT_VIEWS) | 1445 #if defined(TOOLKIT_VIEWS) |
1446 views::Widget::SetPureViews( | 1446 views::Widget::SetPureViews( |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 // unless we detect another chrome browser running. | 1557 // unless we detect another chrome browser running. |
1558 if (parsed_command_line.HasSwitch(switches::kUninstall)) | 1558 if (parsed_command_line.HasSwitch(switches::kUninstall)) |
1559 return DoUninstallTasks(already_running); | 1559 return DoUninstallTasks(already_running); |
1560 #endif | 1560 #endif |
1561 | 1561 |
1562 if (parsed_command_line.HasSwitch(switches::kHideIcons) || | 1562 if (parsed_command_line.HasSwitch(switches::kHideIcons) || |
1563 parsed_command_line.HasSwitch(switches::kShowIcons)) | 1563 parsed_command_line.HasSwitch(switches::kShowIcons)) |
1564 return HandleIconsCommands(parsed_command_line); | 1564 return HandleIconsCommands(parsed_command_line); |
1565 if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { | 1565 if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { |
1566 return ShellIntegration::SetAsDefaultBrowser() ? | 1566 return ShellIntegration::SetAsDefaultBrowser() ? |
1567 ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; | 1567 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : |
| 1568 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); |
1568 } | 1569 } |
1569 | 1570 |
1570 // If the command line specifies --pack-extension, attempt the pack extension | 1571 // If the command line specifies --pack-extension, attempt the pack extension |
1571 // startup action and exit. | 1572 // startup action and exit. |
1572 if (parsed_command_line.HasSwitch(switches::kPackExtension)) { | 1573 if (parsed_command_line.HasSwitch(switches::kPackExtension)) { |
1573 ExtensionsStartupUtil extension_startup_util; | 1574 ExtensionsStartupUtil extension_startup_util; |
1574 if (extension_startup_util.PackExtension(parsed_command_line)) { | 1575 if (extension_startup_util.PackExtension(parsed_command_line)) { |
1575 return ResultCodes::NORMAL_EXIT; | 1576 return content::RESULT_CODE_NORMAL_EXIT; |
1576 } else { | 1577 } else { |
1577 return ResultCodes::PACK_EXTENSION_ERROR; | 1578 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; |
1578 } | 1579 } |
1579 } | 1580 } |
1580 | 1581 |
1581 #if !defined(OS_MACOSX) | 1582 #if !defined(OS_MACOSX) |
1582 // In environments other than Mac OS X we support import of settings | 1583 // In environments other than Mac OS X we support import of settings |
1583 // from other browsers. In case this process is a short-lived "import" | 1584 // from other browsers. In case this process is a short-lived "import" |
1584 // process that another browser runs just to import the settings, we | 1585 // process that another browser runs just to import the settings, we |
1585 // don't want to be checking for another browser process, by design. | 1586 // don't want to be checking for another browser process, by design. |
1586 if (!(parsed_command_line.HasSwitch(switches::kImport) || | 1587 if (!(parsed_command_line.HasSwitch(switches::kImport) || |
1587 parsed_command_line.HasSwitch(switches::kImportFromFile))) { | 1588 parsed_command_line.HasSwitch(switches::kImportFromFile))) { |
1588 #endif | 1589 #endif |
1589 // When another process is running, use that process instead of starting a | 1590 // When another process is running, use that process instead of starting a |
1590 // new one. NotifyOtherProcess will currently give the other process up to | 1591 // new one. NotifyOtherProcess will currently give the other process up to |
1591 // 20 seconds to respond. Note that this needs to be done before we attempt | 1592 // 20 seconds to respond. Note that this needs to be done before we attempt |
1592 // to read the profile. | 1593 // to read the profile. |
1593 switch (process_singleton.NotifyOtherProcessOrCreate()) { | 1594 switch (process_singleton.NotifyOtherProcessOrCreate()) { |
1594 case ProcessSingleton::PROCESS_NONE: | 1595 case ProcessSingleton::PROCESS_NONE: |
1595 // No process already running, fall through to starting a new one. | 1596 // No process already running, fall through to starting a new one. |
1596 break; | 1597 break; |
1597 | 1598 |
1598 case ProcessSingleton::PROCESS_NOTIFIED: | 1599 case ProcessSingleton::PROCESS_NOTIFIED: |
1599 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1600 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
1600 printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( | 1601 printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( |
1601 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); | 1602 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); |
1602 #endif | 1603 #endif |
1603 return ResultCodes::NORMAL_EXIT; | 1604 return content::RESULT_CODE_NORMAL_EXIT; |
1604 | 1605 |
1605 case ProcessSingleton::PROFILE_IN_USE: | 1606 case ProcessSingleton::PROFILE_IN_USE: |
1606 return ResultCodes::PROFILE_IN_USE; | 1607 return chrome::RESULT_CODE_PROFILE_IN_USE; |
1607 | 1608 |
1608 case ProcessSingleton::LOCK_ERROR: | 1609 case ProcessSingleton::LOCK_ERROR: |
1609 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " | 1610 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " |
1610 "directory. This means that running multiple instances " | 1611 "directory. This means that running multiple instances " |
1611 "would start multiple browser processes rather than " | 1612 "would start multiple browser processes rather than " |
1612 "opening a new window in the existing process. Aborting " | 1613 "opening a new window in the existing process. Aborting " |
1613 "now to avoid profile corruption."; | 1614 "now to avoid profile corruption."; |
1614 return ResultCodes::PROFILE_IN_USE; | 1615 return chrome::RESULT_CODE_PROFILE_IN_USE; |
1615 | 1616 |
1616 default: | 1617 default: |
1617 NOTREACHED(); | 1618 NOTREACHED(); |
1618 } | 1619 } |
1619 #if !defined(OS_MACOSX) // closing brace for if | 1620 #if !defined(OS_MACOSX) // closing brace for if |
1620 } | 1621 } |
1621 #endif | 1622 #endif |
1622 | 1623 |
1623 #if defined(USE_X11) | 1624 #if defined(USE_X11) |
1624 SetBrowserX11ErrorHandlers(); | 1625 SetBrowserX11ErrorHandlers(); |
(...skipping 27 matching lines...) Expand all Loading... |
1652 VLOG(1) << "Relaunching browser for user: " << username; | 1653 VLOG(1) << "Relaunching browser for user: " << username; |
1653 chromeos::UserManager::Get()->UserLoggedIn(username); | 1654 chromeos::UserManager::Get()->UserLoggedIn(username); |
1654 | 1655 |
1655 // Redirects Chrome logging to the user data dir. | 1656 // Redirects Chrome logging to the user data dir. |
1656 logging::RedirectChromeLogging(parsed_command_line); | 1657 logging::RedirectChromeLogging(parsed_command_line); |
1657 } | 1658 } |
1658 #endif | 1659 #endif |
1659 | 1660 |
1660 Profile* profile = CreateProfile(parameters, user_data_dir); | 1661 Profile* profile = CreateProfile(parameters, user_data_dir); |
1661 if (!profile) | 1662 if (!profile) |
1662 return ResultCodes::NORMAL_EXIT; | 1663 return content::RESULT_CODE_NORMAL_EXIT; |
1663 | 1664 |
1664 // Post-profile init --------------------------------------------------------- | 1665 // Post-profile init --------------------------------------------------------- |
1665 | 1666 |
1666 #if defined(OS_CHROMEOS) | 1667 #if defined(OS_CHROMEOS) |
1667 // Handling the user cloud policy initialization for case 2 mentioned above. | 1668 // Handling the user cloud policy initialization for case 2 mentioned above. |
1668 // We do this after the profile creation since we need the TokenService. | 1669 // We do this after the profile creation since we need the TokenService. |
1669 if (parsed_command_line.HasSwitch(switches::kLoginUser) && | 1670 if (parsed_command_line.HasSwitch(switches::kLoginUser) && |
1670 !parsed_command_line.HasSwitch(switches::kLoginPassword)) { | 1671 !parsed_command_line.HasSwitch(switches::kLoginPassword)) { |
1671 std::string username = | 1672 std::string username = |
1672 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser); | 1673 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser); |
(...skipping 21 matching lines...) Expand all Loading... |
1694 // replace this implementation. http://crbug.com/22142 | 1695 // replace this implementation. http://crbug.com/22142 |
1695 if (parsed_command_line.HasSwitch(switches::kImport) || | 1696 if (parsed_command_line.HasSwitch(switches::kImport) || |
1696 parsed_command_line.HasSwitch(switches::kImportFromFile)) { | 1697 parsed_command_line.HasSwitch(switches::kImportFromFile)) { |
1697 return FirstRun::ImportNow(profile, parsed_command_line); | 1698 return FirstRun::ImportNow(profile, parsed_command_line); |
1698 } | 1699 } |
1699 #endif | 1700 #endif |
1700 | 1701 |
1701 #if defined(OS_WIN) | 1702 #if defined(OS_WIN) |
1702 // Do the tasks if chrome has been upgraded while it was last running. | 1703 // Do the tasks if chrome has been upgraded while it was last running. |
1703 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line)) | 1704 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line)) |
1704 return ResultCodes::NORMAL_EXIT; | 1705 return content::RESULT_CODE_NORMAL_EXIT; |
1705 #endif | 1706 #endif |
1706 | 1707 |
1707 // Check if there is any machine level Chrome installed on the current | 1708 // Check if there is any machine level Chrome installed on the current |
1708 // machine. If yes and the current Chrome process is user level, we do not | 1709 // machine. If yes and the current Chrome process is user level, we do not |
1709 // allow the user level Chrome to run. So we notify the user and uninstall | 1710 // allow the user level Chrome to run. So we notify the user and uninstall |
1710 // user level Chrome. | 1711 // user level Chrome. |
1711 // Note this check should only happen here, after all the checks above | 1712 // Note this check should only happen here, after all the checks above |
1712 // (uninstall, resource bundle initialization, other chrome browser | 1713 // (uninstall, resource bundle initialization, other chrome browser |
1713 // processes etc). | 1714 // processes etc). |
1714 // Do not allow this to occur for Chrome Frame user-to-system handoffs. | 1715 // Do not allow this to occur for Chrome Frame user-to-system handoffs. |
1715 if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && | 1716 if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && |
1716 CheckMachineLevelInstall()) | 1717 CheckMachineLevelInstall()) |
1717 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; | 1718 return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; |
1718 | 1719 |
1719 // Create the TranslateManager singleton. | 1720 // Create the TranslateManager singleton. |
1720 TranslateManager* translate_manager = TranslateManager::GetInstance(); | 1721 TranslateManager* translate_manager = TranslateManager::GetInstance(); |
1721 DCHECK(translate_manager != NULL); | 1722 DCHECK(translate_manager != NULL); |
1722 | 1723 |
1723 #if defined(OS_MACOSX) | 1724 #if defined(OS_MACOSX) |
1724 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { | 1725 if (!parsed_command_line.HasSwitch(switches::kNoFirstRun)) { |
1725 // Disk image installation is sort of a first-run task, so it shares the | 1726 // Disk image installation is sort of a first-run task, so it shares the |
1726 // kNoFirstRun switch. | 1727 // kNoFirstRun switch. |
1727 if (MaybeInstallFromDiskImage()) { | 1728 if (MaybeInstallFromDiskImage()) { |
1728 // The application was installed and the installed copy has been | 1729 // The application was installed and the installed copy has been |
1729 // launched. This process is now obsolete. Exit. | 1730 // launched. This process is now obsolete. Exit. |
1730 return ResultCodes::NORMAL_EXIT; | 1731 return content::RESULT_CODE_NORMAL_EXIT; |
1731 } | 1732 } |
1732 } | 1733 } |
1733 #endif | 1734 #endif |
1734 | 1735 |
1735 // Show the First Run UI if this is the first time Chrome has been run on | 1736 // Show the First Run UI if this is the first time Chrome has been run on |
1736 // this computer, or we're being compelled to do so by a command line flag. | 1737 // this computer, or we're being compelled to do so by a command line flag. |
1737 // Note that this be done _after_ the PrefService is initialized and all | 1738 // Note that this be done _after_ the PrefService is initialized and all |
1738 // preferences are registered, since some of the code that the importer | 1739 // preferences are registered, since some of the code that the importer |
1739 // touches reads preferences. | 1740 // touches reads preferences. |
1740 if (is_first_run) { | 1741 if (is_first_run) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 // See issue 40144. | 1913 // See issue 40144. |
1913 profile->GetExtensionService()->InitEventRouters(); | 1914 profile->GetExtensionService()->InitEventRouters(); |
1914 } | 1915 } |
1915 | 1916 |
1916 // The extension service may be available at this point. If the command line | 1917 // The extension service may be available at this point. If the command line |
1917 // specifies --uninstall-extension, attempt the uninstall extension startup | 1918 // specifies --uninstall-extension, attempt the uninstall extension startup |
1918 // action. | 1919 // action. |
1919 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { | 1920 if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { |
1920 ExtensionsStartupUtil ext_startup_util; | 1921 ExtensionsStartupUtil ext_startup_util; |
1921 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { | 1922 if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { |
1922 return ResultCodes::NORMAL_EXIT; | 1923 return content::RESULT_CODE_NORMAL_EXIT; |
1923 } else { | 1924 } else { |
1924 return ResultCodes::UNINSTALL_EXTENSION_ERROR; | 1925 return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; |
1925 } | 1926 } |
1926 } | 1927 } |
1927 | 1928 |
1928 #if defined(OS_WIN) | 1929 #if defined(OS_WIN) |
1929 // We check this here because if the profile is OTR (chromeos possibility) | 1930 // We check this here because if the profile is OTR (chromeos possibility) |
1930 // it won't still be accessible after browser is destroyed. | 1931 // it won't still be accessible after browser is destroyed. |
1931 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); | 1932 bool record_search_engine = is_first_run && !profile->IsOffTheRecord(); |
1932 #endif | 1933 #endif |
1933 | 1934 |
1934 // ChildProcess:: is a misnomer unless you consider context. Use | 1935 // ChildProcess:: is a misnomer unless you consider context. Use |
(...skipping 24 matching lines...) Expand all Loading... |
1959 new GpuBlacklistUpdater(); | 1960 new GpuBlacklistUpdater(); |
1960 // Don't start auto update in tests. | 1961 // Don't start auto update in tests. |
1961 if (parsed_command_line.GetSwitchValueASCII(switches::kUseGL) != | 1962 if (parsed_command_line.GetSwitchValueASCII(switches::kUseGL) != |
1962 gfx::kGLImplementationOSMesaName) { | 1963 gfx::kGLImplementationOSMesaName) { |
1963 gpu_blacklist_updater->StartAfterDelay(); | 1964 gpu_blacklist_updater->StartAfterDelay(); |
1964 } | 1965 } |
1965 | 1966 |
1966 // Start watching all browser threads for responsiveness. | 1967 // Start watching all browser threads for responsiveness. |
1967 ThreadWatcherList::StartWatchingAll(parsed_command_line); | 1968 ThreadWatcherList::StartWatchingAll(parsed_command_line); |
1968 | 1969 |
1969 int result_code = ResultCodes::NORMAL_EXIT; | 1970 int result_code = content::RESULT_CODE_NORMAL_EXIT; |
1970 if (parameters.ui_task) { | 1971 if (parameters.ui_task) { |
1971 // We are in test mode. Run one task and enter the main message loop. | 1972 // We are in test mode. Run one task and enter the main message loop. |
1972 if (pool) | 1973 if (pool) |
1973 pool->Recycle(); | 1974 pool->Recycle(); |
1974 parameters.ui_task->Run(); | 1975 parameters.ui_task->Run(); |
1975 delete parameters.ui_task; | 1976 delete parameters.ui_task; |
1976 } else { | 1977 } else { |
1977 // Most general initialization is behind us, but opening a | 1978 // Most general initialization is behind us, but opening a |
1978 // tab and/or session restore and such is still to be done. | 1979 // tab and/or session restore and such is still to be done. |
1979 base::TimeTicks browser_open_start = base::TimeTicks::Now(); | 1980 base::TimeTicks browser_open_start = base::TimeTicks::Now(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 #if defined(OS_CHROMEOS) | 2087 #if defined(OS_CHROMEOS) |
2087 // To be precise, logout (browser shutdown) is not yet done, but the | 2088 // To be precise, logout (browser shutdown) is not yet done, but the |
2088 // remaining work is negligible, hence we say LogoutDone here. | 2089 // remaining work is negligible, hence we say LogoutDone here. |
2089 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 2090 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
2090 false); | 2091 false); |
2091 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 2092 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
2092 #endif | 2093 #endif |
2093 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 2094 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
2094 return result_code; | 2095 return result_code; |
2095 } | 2096 } |
OLD | NEW |