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

Unified Diff: extensions/browser/updater/extension_downloader.h

Issue 2768573002: Send traffic-management headers from extension updater. (Closed)
Patch Set: Fix a compiler error in ChromeOS. Created 3 years, 9 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: extensions/browser/updater/extension_downloader.h
diff --git a/extensions/browser/updater/extension_downloader.h b/extensions/browser/updater/extension_downloader.h
index 9165a56dcea42eae8b98d75c9bbd261c04fd5838..bcf52208066a5d7956a3fc9544c17ad8d557bbcf 100644
--- a/extensions/browser/updater/extension_downloader.h
+++ b/extensions/browser/updater/extension_downloader.h
@@ -72,8 +72,12 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
// In that case, no callbacks will be performed on the |delegate_|.
// The |request_id| is passed on as is to the various |delegate_| callbacks.
// This is used for example by ExtensionUpdater to keep track of when
- // potentially concurrent update checks complete.
- bool AddExtension(const Extension& extension, int request_id);
+ // potentially concurrent update checks complete. |on_demand_update|
+ // parameter notifies the downloader that this extension update is an on
+ // demand update (if true).
+ bool AddExtension(const Extension& extension,
+ int request_id,
+ bool on_demand_update);
// Adds extension |id| to the list of extensions to check for updates.
// Returns false if the |id| can't be updated due to invalid details.
@@ -83,10 +87,13 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
// potentially concurrent update checks complete. The |is_corrupt_reinstall|
// parameter is used to indicate in the request that we detected corruption in
// the local copy of the extension and we want to perform a reinstall of it.
+ // |on_demand_update| parameter notifies the downloader that this extension
+ // update is an on demand update (if true).
bool AddPendingExtension(const std::string& id,
const GURL& update_url,
bool is_corrupt_reinstall,
- int request_id);
+ int request_id,
+ bool on_demand_update);
// Schedules a fetch of the manifest of all the extensions added with
// AddExtension() and AddPendingExtension().
@@ -128,6 +135,16 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
static const int kMaxRetries = 10;
+ // Names of the header fields used for traffic management for extension
+ // updater.
+ static const char kUpdateInteractivityHeader[];
+ static const char kUpdateAppIdHeader[];
+ static const char kUpdateUpdaterHeader[];
+
+ // Constans for foreground/background update requests in the header.
Sorin Jianu 2017/03/21 21:12:10 Constants. Or we can say "Header values for fore
Minh X. Nguyen 2017/03/21 21:42:34 Done.
+ static const char kUpdateInteractivityForeground[];
+ static const char kUpdateInteractivityBackground[];
+
private:
friend class ExtensionUpdaterTest;
@@ -197,7 +214,8 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
Manifest::Type extension_type,
const GURL& extension_update_url,
const ExtraParams& extra,
- int request_id);
+ int request_id,
+ bool on_demand_update);
// Adds all recorded stats taken so far to histogram counts.
void ReportStats() const;
@@ -283,7 +301,8 @@ class ExtensionDownloader : public net::URLFetcherDelegate,
const GoogleServiceAuthError& error) override;
ManifestFetchData* CreateManifestFetchData(const GURL& update_url,
- int request_id);
+ int request_id,
+ bool on_demand_update);
// The delegate that receives the crx files downloaded by the
// ExtensionDownloader, and that fills in optional ping and update url data.

Powered by Google App Engine
This is Rietveld 408576698