Chromium Code Reviews| 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 // This file declares util functions for setup project. It also declares a | 5 // This file declares util functions for setup project. It also declares a |
| 6 // few functions that the Chrome component updater uses for patching binary | 6 // few functions that the Chrome component updater uses for patching binary |
| 7 // deltas. | 7 // deltas. |
| 8 | 8 |
| 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 bool IsDowngradeAllowed(const MasterPreferences& prefs); | 137 bool IsDowngradeAllowed(const MasterPreferences& prefs); |
| 138 | 138 |
| 139 // Returns true if Chrome has been run within the last 28 days. | 139 // Returns true if Chrome has been run within the last 28 days. |
| 140 bool IsChromeActivelyUsed(const InstallerState& installer_state); | 140 bool IsChromeActivelyUsed(const InstallerState& installer_state); |
| 141 | 141 |
| 142 // Records UMA metrics for unpack result. | 142 // Records UMA metrics for unpack result. |
| 143 void RecordUnPackMetrics(UnPackStatus unpack_status, | 143 void RecordUnPackMetrics(UnPackStatus unpack_status, |
| 144 int32_t status, | 144 int32_t status, |
| 145 UnPackConsumer consumer); | 145 UnPackConsumer consumer); |
| 146 | 146 |
| 147 // Register Chrome's EventLog message provider dll. | |
| 148 void RegisterEventLogProvider(const base::FilePath& chrome_exe); | |
|
grt (UTC plus 2)
2016/11/18 11:38:12
please add a unittest for these functions. in the
| |
| 149 | |
| 150 // Register Chrome's EventLog message provider dll. | |
|
grt (UTC plus 2)
2016/11/18 11:38:12
nit: fix comment
pastarmovj
2016/11/21 15:48:41
Done.
| |
| 151 void DeRegisterEventLogProvider(); | |
| 152 | |
| 147 // This class will enable the privilege defined by |privilege_name| on the | 153 // This class will enable the privilege defined by |privilege_name| on the |
| 148 // current process' token. The privilege will be disabled upon the | 154 // current process' token. The privilege will be disabled upon the |
| 149 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 155 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
| 150 // ScopedTokenPrivilege object was constructed). | 156 // ScopedTokenPrivilege object was constructed). |
| 151 // Some privileges might require admin rights to be enabled (check is_enabled() | 157 // Some privileges might require admin rights to be enabled (check is_enabled() |
| 152 // to know whether |privilege_name| was successfully enabled). | 158 // to know whether |privilege_name| was successfully enabled). |
| 153 class ScopedTokenPrivilege { | 159 class ScopedTokenPrivilege { |
| 154 public: | 160 public: |
| 155 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 161 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
| 156 ~ScopedTokenPrivilege(); | 162 ~ScopedTokenPrivilege(); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 169 // The previous state of the privilege this object is responsible for. As set | 175 // The previous state of the privilege this object is responsible for. As set |
| 170 // by AdjustTokenPrivileges() upon construction. | 176 // by AdjustTokenPrivileges() upon construction. |
| 171 TOKEN_PRIVILEGES previous_privileges_; | 177 TOKEN_PRIVILEGES previous_privileges_; |
| 172 | 178 |
| 173 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 179 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
| 174 }; | 180 }; |
| 175 | 181 |
| 176 } // namespace installer | 182 } // namespace installer |
| 177 | 183 |
| 178 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 184 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |