forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.h
208 lines (161 loc) · 7.53 KB
/
constants.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_UPDATER_CONSTANTS_H_
#define CHROME_UPDATER_CONSTANTS_H_
#include "build/build_config.h"
#include "components/update_client/update_client_errors.h"
namespace updater {
// The updater specific app ID.
extern const char kUpdaterAppId[];
// "0.0.0.0". Historically, a null version has been used to indicate a
// new install.
extern const char kNullVersion[];
// Command line switches.
//
// This switch starts the COM server. This switch is invoked by the COM runtime
// when CoCreate is called on one of several CLSIDs that the server supports.
// We expect to use the COM server for the following scenarios:
// * The Server for the UI when installing User applications, and as a fallback
// if the Service fails when installing Machine applications.
// * The On-Demand COM Server when running for User, and as a fallback if the
// Service fails.
// * COM Server for launching processes at Medium Integrity, i.e., de-elevating.
// * The On-Demand COM Server when the client requests read-only interfaces
// (say, Policy queries) at Medium Integrity.
// * A COM broker when running modes such as On-Demand for Machine. A COM broker
// is something that acts as an intermediary, allowing creating one of several
// possible COM objects that can service a particular COM request, ranging
// from Privileged Services that can offer full functionality for a particular
// set of interfaces, to Medium Integrity processes that can offer limited
// (say, read-only) functionality for that same set of interfaces.
extern const char kServerSwitch[];
// This switch specifies the XPC service the server registers to listen to.
extern const char kServerServiceSwitch[];
// Valid values for the kServerServiceSwitch.
extern const char kServerControlServiceSwitchValue[];
extern const char kServerUpdateServiceSwitchValue[];
// This switch starts the COM service. This switch is invoked by the Service
// Manager when CoCreate is called on one of several CLSIDs that the server
// supports.
// We expect to use the COM service for the following scenarios:
// * The Server for the UI when installing Machine applications.
// * The On-Demand COM Server for Machine applications.
// * COM Server for launching processes at System Integrity, i.e., an Elevator.
extern const char kComServiceSwitch[];
// Crash the program for testing purposes.
extern const char kCrashMeSwitch[];
// Runs as the Crashpad handler.
extern const char kCrashHandlerSwitch[];
// Updates the updater.
extern const char kUpdateSwitch[];
// Installs the updater.
extern const char kInstallSwitch[];
// Contains the meta installer tag. The tag is a string of arguments, separated
// by a delimiter (in this case, the delimiter is =). The tag is typically
// embedded in the program image of the metainstaller, but for testing purposes,
// the tag could be passed directly as a command line argument. The tag is
// currently encoded as a ASCII string.
extern const char kTagSwitch[];
#if defined(OS_WIN)
// A debug switch to indicate that --install is running from the `out` directory
// of the build. When this switch is present, the setup picks up the run time
// dependencies of the updater from the `out` directory instead of using the
// metainstaller uncompressed archive.
extern const char kInstallFromOutDir[];
#endif // OS_WIN
// Uninstalls the updater.
extern const char kUninstallSwitch[];
// Kicks off the update service. This switch is typically used for by a
// scheduled to invoke the updater periodically.
extern const char kWakeSwitch[];
// The updater needs to operate in the system context.
extern const char kSystemSwitch[];
// Runs in test mode. Currently, it exits right away.
extern const char kTestSwitch[];
// Disables throttling for the crash reported until the following bug is fixed:
// https://bugs.chromium.org/p/crashpad/issues/detail?id=23
extern const char kNoRateLimitSwitch[];
// The handle of an event to signal when the initialization of the main process
// is complete.
extern const char kInitDoneNotifierSwitch[];
// Enables logging.
extern const char kEnableLoggingSwitch[];
// Specifies the logging module filter.
extern const char kLoggingModuleSwitch[];
// Specifies the application that the Updater needs to install.
extern const char kAppIdSwitch[];
// Specifies the version of the application that the updater needs to register.
extern const char kAppVersionSwitch[];
// URLs.
//
// Omaha server end point.
extern const char kUpdaterJSONDefaultUrl[];
// The URL where crash reports are uploaded.
extern const char kCrashUploadURL[];
extern const char kCrashStagingUploadURL[];
// DM server end point.
extern const char kDeviceManagementServerURL[];
// File system paths.
//
// The directory name where CRX apps get installed. This is provided for demo
// purposes, since products installed by this updater will be installed in
// their specific locations.
extern const char kAppsDir[];
// The name of the uninstall script which is invoked by the --uninstall switch.
extern const char kUninstallScript[];
// Developer override keys.
extern const char kDevOverrideKeyUrl[];
extern const char kDevOverrideKeyUseCUP[];
#if defined(OS_WIN)
// Timing constants.
//
// How long to wait for an application installer (such as
// chrome_installer.exe) to complete.
constexpr int kWaitForAppInstallerSec = 60;
// How often the installer progress from registry is sampled. This value may
// be changed to provide a smoother progress experience (crbug.com/1067475).
constexpr int kWaitForInstallerProgressSec = 1;
#endif // OS_WIN
// Install Errors.
//
// Specific install errors for the updater are reported in such a way that
// their range does not conflict with the range of generic errors defined by
// the |update_client| module.
constexpr int kCustomInstallErrorBase =
static_cast<int>(update_client::InstallError::CUSTOM_ERROR_BASE);
// The install directory for the application could not be created.
constexpr int kErrorCreateAppInstallDirectory = kCustomInstallErrorBase;
// The install params are missing. This usually means that the update
// response does not include the name of the installer and its command line
// arguments.
constexpr int kErrorMissingInstallParams = kCustomInstallErrorBase + 1;
// The file specified by the manifest |run| attribute could not be found
// inside the CRX.
constexpr int kErrorMissingRunableFile = kCustomInstallErrorBase + 2;
// Running the application installer failed.
constexpr int kErrorApplicationInstallerFailed = kCustomInstallErrorBase + 3;
// Server Errors.
//
// The server process may exit with any of these exit codes.
constexpr int kErrorOk = 0;
// The server could not acquire the lock needed to run.
constexpr int kErrorFailedToLockPrefsMutex = 1;
// The server candidate failed to promote itself to active.
constexpr int kErrorFailedToSwap = 2;
// Policy Management constants.
extern const char kProxyModeDirect[];
extern const char kProxyModeAutoDetect[];
extern const char kProxyModePacScript[];
extern const char kProxyModeFixedServers[];
extern const char kProxyModeSystem[];
extern const char kDownloadPreferenceCacheable[];
constexpr int kPolicyDisabled = 0;
constexpr int kPolicyEnabled = 1;
constexpr int kPolicyEnabledMachineOnly = 4;
constexpr int kPolicyManualUpdatesOnly = 2;
constexpr int kPolicyAutomaticUpdatesOnly = 3;
constexpr bool kInstallPolicyDefault = kPolicyEnabled;
constexpr bool kUpdatePolicyDefault = kPolicyEnabled;
} // namespace updater
#endif // CHROME_UPDATER_CONSTANTS_H_