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

Unified Diff: chrome/browser/component_updater/component_updater_service.cc

Issue 17419011: Implement coarse "on demand" functionality for update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync
Patch Set: Recompute diffs against Chromium LKGR. Created 7 years, 6 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 | « no previous file | chrome/browser/component_updater/test/component_updater_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/component_updater_service.cc
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index 367ff6e7d5ec326a0ca0d6807f36c76b4e5d3cd2..124c509f3f124e0697ffbccecf01803b3d0a7423 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -63,11 +63,15 @@ const CrxComponent::UrlSource kManifestSources[] = {
bool AddQueryString(const std::string& id,
const std::string& version,
const std::string& fingerprint,
+ bool ondemand,
size_t limit,
std::string* query) {
std::string additional =
- base::StringPrintf("id=%s&v=%s&fp=%s&uc",
- id.c_str(), version.c_str(), fingerprint.c_str());
+ base::StringPrintf("id=%s&v=%s&fp=%s&uc%s",
+ id.c_str(),
+ version.c_str(),
+ fingerprint.c_str(),
+ ondemand ? "&installsource=ondemand" : "");
additional = "x=" + net::EscapeQueryParamValue(additional, true);
if ((additional.size() + query->size() + 1) > limit)
return false;
@@ -575,7 +579,9 @@ bool CrxUpdateService::AddItemToUpdateCheck(CrxUpdateItem* item,
if (!AddQueryString(item->id,
item->component.version.GetString(),
item->component.fingerprint,
- config_->UrlSizeLimit(), query))
+ requested_work_items_.count(item),
Sorin Jianu 2013/06/24 17:25:57 I would consider using a const bool is_ondemand =
asargent_no_longer_on_chrome 2013/06/24 17:34:51 This is a good suggestion. A slightly more compact
waffles 2013/06/24 17:39:30 Done.
+ config_->UrlSizeLimit(),
+ query))
return false;
item->status = CrxUpdateItem::kChecking;
« no previous file with comments | « no previous file | chrome/browser/component_updater/test/component_updater_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698