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

Unified Diff: omaha_request_action.cc

Issue 6836025: Add support to update_engine to poke Omaha after an update has been applied (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Change to use <ping> element with active=1 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 side-by-side diff with in-line comments
Download patch
Index: omaha_request_action.cc
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index a02387ebf5af08f1fca2d70dda1e7355a2d1dc83..ce9103d4a87c686521afc449b6d73e7f72247e8c 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -83,7 +83,7 @@ string GetPingBody(int ping_active_days, int ping_roll_call_days) {
string ping_active = GetPingAttribute("a", ping_active_days);
string ping_roll_call = GetPingAttribute("r", ping_roll_call_days);
if (!ping_active.empty() || !ping_roll_call.empty()) {
- return StringPrintf(" <o:ping%s%s></o:ping>\n",
+ return StringPrintf(" <o:ping active=\"1\"%s%s></o:ping>\n",
ping_active.c_str(),
ping_roll_call.c_str());
}
@@ -92,13 +92,15 @@ string GetPingBody(int ping_active_days, int ping_roll_call_days) {
string FormatRequest(const OmahaEvent* event,
const OmahaRequestParams& params,
+ bool ping_only,
int ping_active_days,
int ping_roll_call_days,
PrefsInterface* prefs) {
string body;
if (event == NULL) {
- body = GetPingBody(ping_active_days, ping_roll_call_days) +
- " <o:updatecheck></o:updatecheck>\n";
+ body = GetPingBody(ping_active_days, ping_roll_call_days);
+ if (!ping_only)
+ body += " <o:updatecheck></o:updatecheck>\n";
// If this is the first update check after a reboot following a previous
// update, generate an event containing the previous version number. If the
// previous version preference file doesn't exist the event is still
@@ -173,11 +175,13 @@ string XmlEncode(const string& input) {
OmahaRequestAction::OmahaRequestAction(PrefsInterface* prefs,
const OmahaRequestParams& params,
OmahaEvent* event,
- HttpFetcher* http_fetcher)
+ HttpFetcher* http_fetcher,
+ bool ping_only)
: prefs_(prefs),
params_(params),
event_(event),
http_fetcher_(http_fetcher),
+ ping_only_(ping_only),
ping_active_days_(0),
ping_roll_call_days_(0),
should_skip_(false) {}
@@ -225,6 +229,7 @@ void OmahaRequestAction::PerformAction() {
InitPingDays();
string request_post(FormatRequest(event_.get(),
params_,
+ ping_only_,
ping_active_days_,
ping_roll_call_days_,
prefs_));

Powered by Google App Engine
This is Rietveld 408576698