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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | omaha_request_params_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 "update_engine/omaha_request_params.h" 5 #include "update_engine/omaha_request_params.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <sys/utsname.h> 9 #include <sys/utsname.h>
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 TrimWhitespaceASCII(hwid, TRIM_ALL, &hwid); 141 TrimWhitespaceASCII(hwid, TRIM_ALL, &hwid);
142 return hwid; 142 return hwid;
143 } 143 }
144 144
145 bool OmahaRequestDeviceParams::IsOfficialBuild() const { 145 bool OmahaRequestDeviceParams::IsOfficialBuild() const {
146 return force_build_type_ ? forced_official_build_ : utils::IsOfficialBuild(); 146 return force_build_type_ ? forced_official_build_ : utils::IsOfficialBuild();
147 } 147 }
148 148
149 bool OmahaRequestDeviceParams::IsValidTrack(const std::string& track) const { 149 bool OmahaRequestDeviceParams::IsValidTrack(const std::string& track) const {
150 return IsOfficialBuild() ? 150 static const char* kValidTracks[] = {
151 (track == "beta-channel" || track == "dev-channel") : true; 151 "canary-channel",
152 "beta-channel",
153 "dev-channel",
154 };
155 if (!IsOfficialBuild()) {
156 return true;
157 }
158 for (size_t t = 0; t < arraysize(kValidTracks); ++t) {
159 if (track == kValidTracks[t]) {
160 return true;
161 }
162 }
163 return false;
152 } 164 }
153 165
154 void OmahaRequestDeviceParams::SetBuildTypeOfficial(bool is_official) { 166 void OmahaRequestDeviceParams::SetBuildTypeOfficial(bool is_official) {
155 force_build_type_ = true; 167 force_build_type_ = true;
156 forced_official_build_ = is_official; 168 forced_official_build_ = is_official;
157 } 169 }
158 170
159 } // namespace chromeos_update_engine 171 } // namespace chromeos_update_engine
OLDNEW
« 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