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

Unified Diff: omaha_request_params.cc

Issue 4520001: AU: Add test-channel to the list of valid tracks. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: rename test-channel to canary-channel Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | omaha_request_params_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: omaha_request_params.cc
diff --git a/omaha_request_params.cc b/omaha_request_params.cc
index 4cc5426a02a90e526071492dd42e5414875d14d8..19bcc6a66ea057ecef5705e57bfa2c530e6f8f14 100644
--- a/omaha_request_params.cc
+++ b/omaha_request_params.cc
@@ -147,8 +147,20 @@ bool OmahaRequestDeviceParams::IsOfficialBuild() const {
}
bool OmahaRequestDeviceParams::IsValidTrack(const std::string& track) const {
- return IsOfficialBuild() ?
- (track == "beta-channel" || track == "dev-channel") : true;
+ static const char* kValidTracks[] = {
+ "canary-channel",
+ "beta-channel",
+ "dev-channel",
+ };
+ if (!IsOfficialBuild()) {
+ return true;
+ }
+ for (size_t t = 0; t < arraysize(kValidTracks); ++t) {
+ if (track == kValidTracks[t]) {
+ return true;
+ }
+ }
+ return false;
}
void OmahaRequestDeviceParams::SetBuildTypeOfficial(bool is_official) {
« no previous file with comments | « no previous file | omaha_request_params_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698