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

Unified Diff: chrome/browser/extensions/updater/manifest_fetch_data.h

Issue 10689097: Enforce the 'requirements' field in manifests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
Index: chrome/browser/extensions/updater/manifest_fetch_data.h
diff --git a/chrome/browser/extensions/updater/manifest_fetch_data.h b/chrome/browser/extensions/updater/manifest_fetch_data.h
index 6468c1e3948dfb140cd2bda563012225cb4638cb..93da067ec0bebdf54443c7f75575d9eaf34f98ca 100644
--- a/chrome/browser/extensions/updater/manifest_fetch_data.h
+++ b/chrome/browser/extensions/updater/manifest_fetch_data.h
@@ -15,12 +15,29 @@
namespace extensions {
+struct ManifestFetchExtensionInfo {
+ ManifestFetchExtensionInfo(const std::string& id, const std::string& version,
+ const std::string& update_url_data,
+ const std::string& install_source,
+ bool is_sync);
+ ManifestFetchExtensionInfo();
+ ~ManifestFetchExtensionInfo();
+
+ std::string id;
+ std::string version;
+ std::string update_url_data;
+ std::string install_source;
+ bool is_sync;
+};
+
// To save on server resources we can request updates for multiple extensions
// in one manifest check. This class helps us keep track of the id's for a
// given fetch, building up the actual URL, and what if anything to include
// in the ping parameter.
class ManifestFetchData {
public:
+ typedef std::map<std::string, ManifestFetchExtensionInfo> ExtensionInfoMap;
+
static const int kNeverPinged = -1;
// Each ping type is sent at most once per day.
@@ -54,12 +71,13 @@ class ManifestFetchData {
bool AddExtension(std::string id, std::string version,
const PingData* ping_data,
const std::string& update_url_data,
- const std::string& install_source);
+ const std::string& install_source,
+ bool is_sync);
const GURL& base_url() const { return base_url_; }
const GURL& full_url() const { return full_url_; }
- int extension_count() { return extension_ids_.size(); }
- const std::set<std::string>& extension_ids() const { return extension_ids_; }
+ int extension_count() { return extension_infos_.size(); }
+ const ExtensionInfoMap& extension_infos() const { return extension_infos_; }
// Returns true if the given id is included in this manifest fetch.
bool Includes(const std::string& extension_id) const;
@@ -69,8 +87,8 @@ class ManifestFetchData {
bool DidPing(std::string extension_id, PingType type) const;
private:
- // The set of extension id's for this ManifestFetchData.
- std::set<std::string> extension_ids_;
+ // Map of the extension id's to their info.
+ ExtensionInfoMap extension_infos_;
// The set of ping data we actually sent.
std::map<std::string, PingData> pings_;

Powered by Google App Engine
This is Rietveld 408576698