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

Side by Side Diff: omaha_request_params.cc

Issue 3017006: AU: pass whether or not we can tolerate a delta to the server (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: merge master (which has petkov's CL in) Created 10 years, 5 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
« no previous file with comments | « omaha_request_params.h ('k') | 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 20 matching lines...) Expand all
31 TEST_AND_RETURN_FALSE(GetMachineId(&machine_id)); 31 TEST_AND_RETURN_FALSE(GetMachineId(&machine_id));
32 user_id = machine_id; 32 user_id = machine_id;
33 os_platform = OmahaRequestParams::kOsPlatform; 33 os_platform = OmahaRequestParams::kOsPlatform;
34 os_version = OmahaRequestParams::kOsVersion; 34 os_version = OmahaRequestParams::kOsVersion;
35 app_version = GetLsbValue("CHROMEOS_RELEASE_VERSION", ""); 35 app_version = GetLsbValue("CHROMEOS_RELEASE_VERSION", "");
36 os_sp = app_version + "_" + GetMachineType(); 36 os_sp = app_version + "_" + GetMachineType();
37 os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", ""); 37 os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", "");
38 app_id = OmahaRequestParams::kAppId; 38 app_id = OmahaRequestParams::kAppId;
39 app_lang = "en-US"; 39 app_lang = "en-US";
40 app_track = GetLsbValue("CHROMEOS_RELEASE_TRACK", ""); 40 app_track = GetLsbValue("CHROMEOS_RELEASE_TRACK", "");
41 struct stat stbuf;
42
43 // Deltas are only okay if the /.nodelta file does not exist.
44 // If we don't know (i.e. stat() returns some unexpected error),
45 // then err on the side of caution and say deltas are not okay
46 delta_okay = (stat((root_ + "/.nodelta").c_str(), &stbuf) < 0) &&
47 (errno == ENOENT);
48
41 update_url = GetLsbValue("CHROMEOS_AUSERVER", 49 update_url = GetLsbValue("CHROMEOS_AUSERVER",
42 OmahaRequestParams::kUpdateUrl); 50 OmahaRequestParams::kUpdateUrl);
43 return true; 51 return true;
44 } 52 }
45 53
46 namespace { 54 namespace {
47 const size_t kGuidDataByteLength = 128 / 8; 55 const size_t kGuidDataByteLength = 128 / 8;
48 const string::size_type kGuidStringLength = 38; 56 const string::size_type kGuidStringLength = 38;
49 // Formats 16 bytes (128 bits) of data as a GUID: 57 // Formats 16 bytes (128 bits) of data as a GUID:
50 // "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" where X is a hex digit 58 // "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" where X is a hex digit
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 114
107 string OmahaRequestDeviceParams::GetMachineType() const { 115 string OmahaRequestDeviceParams::GetMachineType() const {
108 struct utsname buf; 116 struct utsname buf;
109 string ret; 117 string ret;
110 if (uname(&buf) == 0) 118 if (uname(&buf) == 0)
111 ret = buf.machine; 119 ret = buf.machine;
112 return ret; 120 return ret;
113 } 121 }
114 122
115 } // namespace chromeos_update_engine 123 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « omaha_request_params.h ('k') | omaha_request_params_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698