Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 contains helper functions which provide information about the | 5 // This file contains helper functions which provide information about the |
| 6 // current version of Chrome. This includes channel information, version | 6 // current version of Chrome. This includes channel information, version |
| 7 // information etc. This functionality is provided by using functions in | 7 // information etc. This functionality is provided by using functions in |
| 8 // kernel32 and advapi32. No other dependencies are allowed in this file. | 8 // kernel32 and advapi32. No other dependencies are allowed in this file. |
| 9 | 9 |
| 10 #ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 10 #ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| 11 #define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 11 #define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 namespace version_info { | 16 namespace version_info { |
| 17 enum class Channel; | 17 enum class Channel; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace install_static { | 20 namespace install_static { |
| 21 | 21 |
| 22 struct InstallConstants; | 22 struct InstallConstants; |
| 23 | 23 |
| 24 enum class ProcessType { | 24 enum class ProcessType { |
| 25 UNINITIALIZED, | 25 UNINITIALIZED, |
| 26 NON_BROWSER_PROCESS, | 26 OTHER_PROCESS, |
| 27 BROWSER_PROCESS, | 27 BROWSER_PROCESS, |
| 28 CLOUD_PRINT_SERVICE_PROCESS, | |
| 29 NACL_BROKER_PROCESS, | |
| 30 NACL_LOADER_PROCESS, | |
| 28 }; | 31 }; |
| 29 | 32 |
| 30 // Registry key to store the stats/crash sampling state of Chrome. If set to 1, | 33 // Registry key to store the stats/crash sampling state of Chrome. If set to 1, |
| 31 // stats and crash reports will be uploaded in line with the user's consent, | 34 // stats and crash reports will be uploaded in line with the user's consent, |
| 32 // otherwise, uploads will be disabled. It is used to sample clients, to reduce | 35 // otherwise, uploads will be disabled. It is used to sample clients, to reduce |
| 33 // server load for metics and crashes. This is controlled by the | 36 // server load for metics and crashes. This is controlled by the |
| 34 // MetricsReporting feature in chrome_metrics_services_manager_client.cc and is | 37 // MetricsReporting feature in chrome_metrics_services_manager_client.cc and is |
| 35 // written when metrics services are started up and when consent changes. | 38 // written when metrics services are started up and when consent changes. |
| 36 extern const wchar_t kRegValueChromeStatsSample[]; | 39 extern const wchar_t kRegValueChromeStatsSample[]; |
| 37 | 40 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 bool ReportingIsEnforcedByPolicy(bool* crash_reporting_enabled); | 154 bool ReportingIsEnforcedByPolicy(bool* crash_reporting_enabled); |
| 152 | 155 |
| 153 // Initializes |g_process_type| which stores whether or not the current | 156 // Initializes |g_process_type| which stores whether or not the current |
| 154 // process is the main browser process. | 157 // process is the main browser process. |
| 155 void InitializeProcessType(); | 158 void InitializeProcessType(); |
| 156 | 159 |
| 157 // Returns true if invoked in a Chrome process other than the main browser | 160 // Returns true if invoked in a Chrome process other than the main browser |
| 158 // process. False otherwise. | 161 // process. False otherwise. |
| 159 bool IsNonBrowserProcess(); | 162 bool IsNonBrowserProcess(); |
| 160 | 163 |
| 164 // Returns true if the |process_type| has the rights to access the profile. | |
| 165 // False otherwise. | |
| 166 bool ProcessNeedsProfileDir(const std::string& process_type); | |
| 167 | |
| 161 // Populates |crash_dir| with the crash dump location, respecting modifications | 168 // Populates |crash_dir| with the crash dump location, respecting modifications |
| 162 // to user-data-dir. | 169 // to user-data-dir. |
| 163 // TODO(ananta) | 170 // TODO(ananta) |
| 164 // http://crbug.com/604923 | 171 // http://crbug.com/604923 |
| 165 // Unify this with the Browser Distribution code. | 172 // Unify this with the Browser Distribution code. |
| 166 std::wstring GetCrashDumpLocation(); | 173 std::wstring GetCrashDumpLocation(); |
| 167 | 174 |
| 168 // Returns the contents of the specified |variable_name| from the environment | 175 // Returns the contents of the specified |variable_name| from the environment |
| 169 // block of the calling process. Returns an empty string if the variable does | 176 // block of the calling process. Returns an empty string if the variable does |
| 170 // not exist. | 177 // not exist. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 // from Chrome's ClientState key in the registry. |update_cohort_name|, if not | 254 // from Chrome's ClientState key in the registry. |update_cohort_name|, if not |
| 248 // null, is set to the raw "cohort\name" value read from Chrome's ClientState | 255 // null, is set to the raw "cohort\name" value read from Chrome's ClientState |
| 249 // key in the registry. | 256 // key in the registry. |
| 250 std::wstring DetermineChannel(const InstallConstants& mode, | 257 std::wstring DetermineChannel(const InstallConstants& mode, |
| 251 bool system_level, | 258 bool system_level, |
| 252 bool from_binaries, | 259 bool from_binaries, |
| 253 std::wstring* update_ap, | 260 std::wstring* update_ap, |
| 254 std::wstring* update_cohort_name); | 261 std::wstring* update_cohort_name); |
| 255 | 262 |
| 256 // Caches the |ProcessType| of the current process. | 263 // Caches the |ProcessType| of the current process. |
| 257 extern ProcessType g_process_type; | 264 extern ProcessType g_process_type; |
|
grt (UTC plus 2)
2017/05/17 20:10:36
it looks like neither this nor the enum are used o
manzagop (departed)
2017/05/17 21:15:56
Done.
| |
| 258 | 265 |
| 259 } // namespace install_static | 266 } // namespace install_static |
| 260 | 267 |
| 261 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ | 268 #endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_ |
| OLD | NEW |