Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/installer/setup/setup_main.cc

Issue 1537743006: Persist setup metrics and have Chrome report them during UMA upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared-histograms
Patch Set: address (many) comments by Greg Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/installer/setup/setup_main.h" 5 #include "chrome/installer/setup/setup_main.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <msi.h> 8 #include <msi.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 27 matching lines...) Expand all
38 #include "base/win/scoped_handle.h" 38 #include "base/win/scoped_handle.h"
39 #include "base/win/win_util.h" 39 #include "base/win/win_util.h"
40 #include "base/win/windows_version.h" 40 #include "base/win/windows_version.h"
41 #include "chrome/common/chrome_constants.h" 41 #include "chrome/common/chrome_constants.h"
42 #include "chrome/common/chrome_paths.h" 42 #include "chrome/common/chrome_paths.h"
43 #include "chrome/common/chrome_switches.h" 43 #include "chrome/common/chrome_switches.h"
44 #include "chrome/installer/setup/archive_patch_helper.h" 44 #include "chrome/installer/setup/archive_patch_helper.h"
45 #include "chrome/installer/setup/install.h" 45 #include "chrome/installer/setup/install.h"
46 #include "chrome/installer/setup/install_worker.h" 46 #include "chrome/installer/setup/install_worker.h"
47 #include "chrome/installer/setup/installer_crash_reporting.h" 47 #include "chrome/installer/setup/installer_crash_reporting.h"
48 #include "chrome/installer/setup/installer_metrics.h"
48 #include "chrome/installer/setup/setup_constants.h" 49 #include "chrome/installer/setup/setup_constants.h"
49 #include "chrome/installer/setup/setup_util.h" 50 #include "chrome/installer/setup/setup_util.h"
50 #include "chrome/installer/setup/uninstall.h" 51 #include "chrome/installer/setup/uninstall.h"
51 #include "chrome/installer/util/browser_distribution.h" 52 #include "chrome/installer/util/browser_distribution.h"
52 #include "chrome/installer/util/delete_after_reboot_helper.h" 53 #include "chrome/installer/util/delete_after_reboot_helper.h"
53 #include "chrome/installer/util/delete_tree_work_item.h" 54 #include "chrome/installer/util/delete_tree_work_item.h"
54 #include "chrome/installer/util/google_update_constants.h" 55 #include "chrome/installer/util/google_update_constants.h"
55 #include "chrome/installer/util/google_update_settings.h" 56 #include "chrome/installer/util/google_update_settings.h"
56 #include "chrome/installer/util/google_update_util.h" 57 #include "chrome/installer/util/google_update_util.h"
57 #include "chrome/installer/util/helper.h" 58 #include "chrome/installer/util/helper.h"
58 #include "chrome/installer/util/html_dialog.h" 59 #include "chrome/installer/util/html_dialog.h"
59 #include "chrome/installer/util/install_util.h" 60 #include "chrome/installer/util/install_util.h"
60 #include "chrome/installer/util/installation_state.h" 61 #include "chrome/installer/util/installation_state.h"
61 #include "chrome/installer/util/installation_validator.h" 62 #include "chrome/installer/util/installation_validator.h"
62 #include "chrome/installer/util/installer_state.h" 63 #include "chrome/installer/util/installer_state.h"
63 #include "chrome/installer/util/installer_util_strings.h" 64 #include "chrome/installer/util/installer_util_strings.h"
64 #include "chrome/installer/util/l10n_string_util.h" 65 #include "chrome/installer/util/l10n_string_util.h"
65 #include "chrome/installer/util/logging_installer.h" 66 #include "chrome/installer/util/logging_installer.h"
66 #include "chrome/installer/util/lzma_util.h" 67 #include "chrome/installer/util/lzma_util.h"
67 #include "chrome/installer/util/master_preferences.h" 68 #include "chrome/installer/util/master_preferences.h"
68 #include "chrome/installer/util/master_preferences_constants.h" 69 #include "chrome/installer/util/master_preferences_constants.h"
69 #include "chrome/installer/util/self_cleaning_temp_dir.h" 70 #include "chrome/installer/util/self_cleaning_temp_dir.h"
70 #include "chrome/installer/util/shell_util.h" 71 #include "chrome/installer/util/shell_util.h"
71 #include "chrome/installer/util/user_experiment.h" 72 #include "chrome/installer/util/user_experiment.h"
73 #include "chrome/installer/util/util_constants.h"
72 74
73 #if defined(GOOGLE_CHROME_BUILD) 75 #if defined(GOOGLE_CHROME_BUILD)
74 #include "chrome/installer/util/updating_app_registration_data.h" 76 #include "chrome/installer/util/updating_app_registration_data.h"
75 #endif 77 #endif
76 78
77 using installer::InstallerState; 79 using installer::InstallerState;
78 using installer::InstallationState; 80 using installer::InstallationState;
79 using installer::InstallationValidator; 81 using installer::InstallationValidator;
80 using installer::MasterPreferences; 82 using installer::MasterPreferences;
81 using installer::Product; 83 using installer::Product;
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 } // namespace installer 1616 } // namespace installer
1615 1617
1616 int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, 1618 int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
1617 wchar_t* command_line, int show_command) { 1619 wchar_t* command_line, int show_command) {
1618 // Check to see if the CPU is supported before doing anything else. There's 1620 // Check to see if the CPU is supported before doing anything else. There's
1619 // very little than can safely be accomplished if the CPU isn't supported 1621 // very little than can safely be accomplished if the CPU isn't supported
1620 // since dependent libraries (e.g., base) may use invalid instructions. 1622 // since dependent libraries (e.g., base) may use invalid instructions.
1621 if (!installer::IsProcessorSupported()) 1623 if (!installer::IsProcessorSupported())
1622 return installer::CPU_NOT_SUPPORTED; 1624 return installer::CPU_NOT_SUPPORTED;
1623 1625
1626 // Persist histograms so they can be uploaded later.
1627 installer::BeginPersistentHistogramStorage(
1628 installer::kSetupHistogramAllocatorName);
1629
1624 // The exit manager is in charge of calling the dtors of singletons. 1630 // The exit manager is in charge of calling the dtors of singletons.
1625 base::AtExitManager exit_manager; 1631 base::AtExitManager exit_manager;
1626 base::CommandLine::Init(0, NULL); 1632 base::CommandLine::Init(0, NULL);
1627 1633
1628 // install_util uses chrome paths. 1634 // install_util uses chrome paths.
1629 chrome::RegisterPathProvider(); 1635 chrome::RegisterPathProvider();
1630 1636
1631 const MasterPreferences& prefs = MasterPreferences::ForCurrentProcess(); 1637 const MasterPreferences& prefs = MasterPreferences::ForCurrentProcess();
1632 installer::InitInstallerLogging(prefs); 1638 installer::InitInstallerLogging(prefs);
1633 1639
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 // MSI demands that custom actions always return 0 (ERROR_SUCCESS) or it will 1769 // MSI demands that custom actions always return 0 (ERROR_SUCCESS) or it will
1764 // rollback the action. If we're uninstalling we want to avoid this, so always 1770 // rollback the action. If we're uninstalling we want to avoid this, so always
1765 // report success, squashing any more informative return codes. 1771 // report success, squashing any more informative return codes.
1766 if (!(installer_state.is_msi() && is_uninstall)) { 1772 if (!(installer_state.is_msi() && is_uninstall)) {
1767 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1773 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1768 // to pass through, since this is only returned on uninstall which is 1774 // to pass through, since this is only returned on uninstall which is
1769 // never invoked directly by Google Update. 1775 // never invoked directly by Google Update.
1770 return_code = InstallUtil::GetInstallReturnCode(install_status); 1776 return_code = InstallUtil::GetInstallReturnCode(install_status);
1771 } 1777 }
1772 1778
1779 installer::EndPersistentHistogramStorage(installer_state.target_path());
1773 VLOG(1) << "Installation complete, returning: " << return_code; 1780 VLOG(1) << "Installation complete, returning: " << return_code;
1774 1781
1775 return return_code; 1782 return return_code;
1776 } 1783 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698