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

Side by Side Diff: omaha_request_params.cc

Issue 6823087: AU: stable channel (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Created 9 years, 8 months 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 bool OmahaRequestDeviceParams::ShouldLockDown() const { 178 bool OmahaRequestDeviceParams::ShouldLockDown() const {
179 if (force_lock_down_) { 179 if (force_lock_down_) {
180 return forced_lock_down_; 180 return forced_lock_down_;
181 } 181 }
182 return utils::IsOfficialBuild() && utils::IsNormalBootMode(); 182 return utils::IsOfficialBuild() && utils::IsNormalBootMode();
183 } 183 }
184 184
185 bool OmahaRequestDeviceParams::IsValidTrack(const std::string& track) const { 185 bool OmahaRequestDeviceParams::IsValidTrack(const std::string& track) const {
186 static const char* kValidTracks[] = { 186 static const char* kValidTracks[] = {
187 "canary-channel", 187 "canary-channel",
188 "stable-channel",
188 "beta-channel", 189 "beta-channel",
189 "dev-channel", 190 "dev-channel",
190 }; 191 };
191 if (!ShouldLockDown()) { 192 if (!ShouldLockDown()) {
192 return true; 193 return true;
193 } 194 }
194 for (size_t t = 0; t < arraysize(kValidTracks); ++t) { 195 for (size_t t = 0; t < arraysize(kValidTracks); ++t) {
195 if (track == kValidTracks[t]) { 196 if (track == kValidTracks[t]) {
196 return true; 197 return true;
197 } 198 }
198 } 199 }
199 return false; 200 return false;
200 } 201 }
201 202
202 void OmahaRequestDeviceParams::SetLockDown(bool lock) { 203 void OmahaRequestDeviceParams::SetLockDown(bool lock) {
203 force_lock_down_ = true; 204 force_lock_down_ = true;
204 forced_lock_down_ = lock; 205 forced_lock_down_ = lock;
205 } 206 }
206 207
207 } // namespace chromeos_update_engine 208 } // 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