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

Side by Side Diff: omaha_request_prep_action.cc

Issue 2981008: Initial implementation of sending an install success even to Omaha. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Fix indentation. 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 | Annotate | Revision Log
« no previous file with comments | « omaha_request_action_unittest.cc ('k') | update_attempter.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium 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_prep_action.h" 5 #include "update_engine/omaha_request_prep_action.h"
6 #include <sys/utsname.h> 6 #include <sys/utsname.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 21 matching lines...) Expand all
32 string machine_id; 32 string machine_id;
33 TEST_AND_RETURN(GetMachineId(&machine_id)); 33 TEST_AND_RETURN(GetMachineId(&machine_id));
34 const string version(GetLsbValue("CHROMEOS_RELEASE_VERSION", "")); 34 const string version(GetLsbValue("CHROMEOS_RELEASE_VERSION", ""));
35 const string sp(version + "_" + GetMachineType()); 35 const string sp(version + "_" + GetMachineType());
36 const string track(GetLsbValue("CHROMEOS_RELEASE_TRACK", "")); 36 const string track(GetLsbValue("CHROMEOS_RELEASE_TRACK", ""));
37 const string update_url(GetLsbValue("CHROMEOS_AUSERVER", 37 const string update_url(GetLsbValue("CHROMEOS_AUSERVER",
38 OmahaRequestParams::kUpdateUrl)); 38 OmahaRequestParams::kUpdateUrl));
39 const string board(GetLsbValue("CHROMEOS_RELEASE_BOARD", "")); 39 const string board(GetLsbValue("CHROMEOS_RELEASE_BOARD", ""));
40 40
41 OmahaRequestParams out(machine_id, // machine_id 41 OmahaRequestParams out(machine_id, // machine_id
42 machine_id, // user_id (use machine_id) 42 machine_id, // user_id (use machine_id)
43 OmahaRequestParams::kOsPlatform, 43 OmahaRequestParams::kOsPlatform,
44 OmahaRequestParams::kOsVersion, 44 OmahaRequestParams::kOsVersion,
45 sp, // e.g. 0.2.3.3_i686 45 sp, // e.g. 0.2.3.3_i686
46 board, // e.g. x86-generic 46 board, // e.g. x86-generic
47 OmahaRequestParams::kAppId, 47 OmahaRequestParams::kAppId,
48 version, // app version (from lsb-release) 48 version, // app version (from lsb-release)
49 "en-US", // lang 49 "en-US", // lang
50 track, // track 50 track, // track
51 update_url); 51 update_url);
52 52
53 CHECK(HasOutputPipe()); 53 CHECK(HasOutputPipe());
54 SetOutputObject(out); 54 SetOutputObject(out);
55 completer.set_success(true); 55 completer.set_success(true);
56 } 56 }
57 57
58 namespace { 58 namespace {
59 const size_t kGuidDataByteLength = 128 / 8; 59 const size_t kGuidDataByteLength = 128 / 8;
60 const string::size_type kGuidStringLength = 38; 60 const string::size_type kGuidStringLength = 38;
61 // Formats 16 bytes (128 bits) of data as a GUID: 61 // Formats 16 bytes (128 bits) of data as a GUID:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 string OmahaRequestPrepAction::GetMachineType() const { 119 string OmahaRequestPrepAction::GetMachineType() const {
120 struct utsname buf; 120 struct utsname buf;
121 string ret; 121 string ret;
122 if (uname(&buf) == 0) 122 if (uname(&buf) == 0)
123 ret = buf.machine; 123 ret = buf.machine;
124 return ret; 124 return ret;
125 } 125 }
126 126
127 } // namespace chromeos_update_engine 127 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « omaha_request_action_unittest.cc ('k') | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698