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

Unified Diff: omaha_request_params.cc

Issue 3048008: Add support to update_engine_client for -app_version and -omaha_url. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Don't use ?: shorthand. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « omaha_request_params.h ('k') | 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 1ab6f2cb5e2a6d12466fe3c6a86fee5f5e65e0de..33281ee39a5164a9424a3f5ef5aa1caf1819e02e 100644
--- a/omaha_request_params.cc
+++ b/omaha_request_params.cc
@@ -27,27 +27,37 @@ const string OmahaIdPath() {
namespace chromeos_update_engine {
-bool OmahaRequestDeviceParams::Init() {
+const char* const OmahaRequestParams::kAppId(
+ "{87efface-864d-49a5-9bb3-4b050a7c227a}");
+const char* const OmahaRequestParams::kOsPlatform("Chrome OS");
+const char* const OmahaRequestParams::kOsVersion("Indy");
+const char* const OmahaRequestParams::kUpdateUrl(
+ "https://tools.google.com/service/update2");
+
+bool OmahaRequestDeviceParams::Init(const std::string& in_app_version,
+ const std::string& in_update_url) {
TEST_AND_RETURN_FALSE(GetMachineId(&machine_id));
user_id = machine_id;
os_platform = OmahaRequestParams::kOsPlatform;
os_version = OmahaRequestParams::kOsVersion;
- app_version = GetLsbValue("CHROMEOS_RELEASE_VERSION", "");
+ app_version = in_app_version.empty() ?
+ GetLsbValue("CHROMEOS_RELEASE_VERSION", "") : in_app_version;
os_sp = app_version + "_" + GetMachineType();
os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", "");
app_id = OmahaRequestParams::kAppId;
app_lang = "en-US";
app_track = GetLsbValue("CHROMEOS_RELEASE_TRACK", "");
struct stat stbuf;
-
+
// Deltas are only okay if the /.nodelta file does not exist.
// If we don't know (i.e. stat() returns some unexpected error),
// then err on the side of caution and say deltas are not okay
delta_okay = (stat((root_ + "/.nodelta").c_str(), &stbuf) < 0) &&
(errno == ENOENT);
- update_url = GetLsbValue("CHROMEOS_AUSERVER",
- OmahaRequestParams::kUpdateUrl);
+ update_url = in_update_url.empty() ?
+ GetLsbValue("CHROMEOS_AUSERVER", OmahaRequestParams::kUpdateUrl) :
+ in_update_url;
return true;
}
« 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