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

Unified Diff: chrome/browser/extensions/extension_sync_data.cc

Issue 6902054: [Sync] Rip out overly-complicated ExtensionData class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: chrome/browser/extensions/extension_sync_data.cc
diff --git a/chrome/browser/extensions/extension_sync_data.cc b/chrome/browser/extensions/extension_sync_data.cc
index 0ef75b62a4d4d3d986426d70753c3aeddd721937..3eb21e884141a5009d1a78ddd186d4aeae6f0059 100644
--- a/chrome/browser/extensions/extension_sync_data.cc
+++ b/chrome/browser/extensions/extension_sync_data.cc
@@ -4,7 +4,26 @@
#include "chrome/browser/extensions/extension_sync_data.h"
+#include "base/logging.h"
+
ExtensionSyncData::ExtensionSyncData()
: uninstalled(false), enabled(false), incognito_enabled(false) {}
ExtensionSyncData::~ExtensionSyncData() {}
+
+void ExtensionSyncData::Merge(const ExtensionSyncData& new_data) {
+ DCHECK_EQ(id, new_data.id);
asargent_no_longer_on_chrome 2011/04/27 18:48:43 nit: change this to a CHECK_EQ
akalin 2011/04/27 21:25:32 Done. Also changed the other DCHECKs.
+ DCHECK(!uninstalled);
+ DCHECK(!new_data.uninstalled);
+
+ // Copy version-independent properties.
+ enabled = new_data.enabled;
+ incognito_enabled = new_data.incognito_enabled;
+
+ // Copy version-dependent properties if version <= new_data.version.
+ if (version.CompareTo(new_data.version) <= 0) {
+ version = new_data.version;
+ update_url = new_data.update_url;
+ name = new_data.name;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698