parentGUID -> parentid
authorDan Mills <thunder@mozilla.com>
Fri, 05 Dec 2008 03:36:27 -0800
changeset 45085 c94b8dad69eca2c395e3cd1cac52feeaba4138e2
parent 45084 63bc16770eba3b3f6ddbb297380e3ffe290037c0
child 45086 1827ebccb1ddcafa193ffec758d26bbcd7e55837
push idunknown
push userunknown
push dateunknown
parentGUID -> parentid
services/sync/modules/engines.js
services/sync/modules/engines/cookies.js
services/sync/modules/engines/history.js
services/sync/modules/stores.js
services/sync/modules/syncCores.js
--- a/services/sync/modules/engines.js
+++ b/services/sync/modules/engines.js
@@ -299,22 +299,18 @@ SyncEngine.prototype = {
   _createRecord: function SyncEngine__newCryptoWrapper(id, encrypt) {
     let self = yield;
 
     let record = new CryptoWrapper();
     record.uri = this.engineURL + id;
     record.encryption = this.cryptoMetaURL;
     record.cleartext = yield this._serializeItem.async(this, self.cb, id);
 
-    if (record.cleartext) {
-      if (record.cleartext.parentid)
+    if (record.cleartext && record.cleartext.parentid)
         record.parentid = record.cleartext.parentid;
-      else if (record.cleartext.parentGUID) // FIXME: bookmarks-specific
-        record.parentid = record.cleartext.parentGUID;
-    }
 
     if (encrypt || encrypt == undefined)
       yield record.encrypt(self.cb, ID.get('WeaveCryptoID').password);
 
     self.done(record);
   },
 
   // Serialize an item.  This will become the encrypted field in the payload of
--- a/services/sync/modules/engines/cookies.js
+++ b/services/sync/modules/engines/cookies.js
@@ -252,28 +252,28 @@ CookieStore.prototype = {
 	      // String used to identify cookies is
 	      // host:path:name
 	      if ( cookie.isSession ) {
 	        /* Skip session-only cookies, sync only persistent cookies. */
 	        continue;
 	      }
 
 	      let key = cookie.host + ":" + cookie.path + ":" + cookie.name;
-	      items[ key ] = { parentGUID: '',
-			                    name: cookie.name,
-			                    value: cookie.value,
-			                    isDomain: cookie.isDomain,
-			                    host: cookie.host,
-			                    path: cookie.path,
-			                    isSecure: cookie.isSecure,
-			                    // nsICookie2 values:
-			                    rawHost: cookie.rawHost,
-			                    isSession: cookie.isSession,
-			                    expiry: cookie.expiry,
-			                    isHttpOnly: cookie.isHttpOnly };
+	      items[ key ] = { parentid: '',
+			       name: cookie.name,
+			       value: cookie.value,
+			       isDomain: cookie.isDomain,
+			       host: cookie.host,
+			       path: cookie.path,
+			       isSecure: cookie.isSecure,
+			       // nsICookie2 values:
+			       rawHost: cookie.rawHost,
+			       isSession: cookie.isSession,
+			       expiry: cookie.expiry,
+			       isHttpOnly: cookie.isHttpOnly };
 
 	      /* See http://developer.mozilla.org/en/docs/nsICookie
 	         Note: not syncing "expires", "status", or "policy"
 	         since they're deprecated. */
 
       }
     }
     this._lookup = items;
--- a/services/sync/modules/engines/history.js
+++ b/services/sync/modules/engines/history.js
@@ -221,22 +221,21 @@ HistoryStore.prototype = {
   wrap: function HistStore_wrap() {
     let root = this._historyRoot();
     root.containerOpen = true;
     let items = {};
     for (let i = 0; i < root.childCount; i++) {
       let item = root.getChild(i);
       let guid = item.time + ":" + item.uri;
       let vType = this._getVisitType(item.uri);
-      items[guid] = {parentGUID: '',
-			 title: item.title,
-			 URI: item.uri,
-			 time: item.time,
-			 transition: vType
-			};
+      items[guid] = {parentid: '',
+		     title: item.title,
+		     URI: item.uri,
+		     time: item.time,
+		     transition: vType};
     }
     
     this._lookup = items;
     return items;
   },
 
   wipe: function HistStore_wipe() {
     this._hsvc.removeAllPages();
--- a/services/sync/modules/stores.js
+++ b/services/sync/modules/stores.js
@@ -196,19 +196,19 @@ SnapshotStore.prototype = {
       // special-case guid changes
       let newGUID = command.data.GUID,
           oldGUID = command.GUID;
 
       this._data[newGUID] = this._data[oldGUID];
       delete this._data[oldGUID];
 
       for (let GUID in this._data) {
-        if (("parentGUID" in this._data[GUID]) &&
-            (this._data[GUID].parentGUID == oldGUID))
-          this._data[GUID].parentGUID = newGUID;
+        if (("parentid" in this._data[GUID]) &&
+            (this._data[GUID].parentid == oldGUID))
+          this._data[GUID].parentid = newGUID;
       }
     }
     for (let prop in command.data) {
       if (prop == "GUID")
         continue;
       if (command.GUID in this._data)
         this._data[command.GUID][prop] = command.data[prop];
       else
@@ -256,17 +256,17 @@ SnapshotStore.prototype = {
       this._log.debug("Exception: " + e);
     }
   },
 
   serialize: function SStore_serialize() {
     let json = this._json.encode(this.data);
     json = json.replace(/:{type/g, ":\n\t{type");
     json = json.replace(/}, /g, "},\n  ");
-    json = json.replace(/, parentGUID/g, ",\n\t parentGUID");
+    json = json.replace(/, parentid/g, ",\n\t parentid");
     json = json.replace(/, index/g, ",\n\t index");
     json = json.replace(/, title/g, ",\n\t title");
     json = json.replace(/, URI/g, ",\n\t URI");
     json = json.replace(/, tags/g, ",\n\t tags");
     json = json.replace(/, keyword/g, ",\n\t keyword");
     return json;
   },
 
--- a/services/sync/modules/syncCores.js
+++ b/services/sync/modules/syncCores.js
@@ -83,20 +83,20 @@ SyncCore.prototype = {
     return ret;
   },
 
   _nodeParents: function SC__nodeParents(GUID, tree) {
     return this._nodeParentsInt(GUID, tree, []);
   },
 
   _nodeParentsInt: function SC__nodeParentsInt(GUID, tree, parents) {
-    if (!tree[GUID] || !tree[GUID].parentGUID)
+    if (!tree[GUID] || !tree[GUID].parentid)
       return parents;
-    parents.push(tree[GUID].parentGUID);
-    return this._nodeParentsInt(tree[GUID].parentGUID, tree, parents);
+    parents.push(tree[GUID].parentid);
+    return this._nodeParentsInt(tree[GUID].parentid, tree, parents);
   },
 
   _detectUpdates: function SC__detectUpdates(a, b) {
     let self = yield;
 
     let cmds = [];
 
     try {
@@ -175,19 +175,19 @@ SyncCore.prototype = {
 
   // When we change the GUID of a local item (because we detect it as
   // being the same item as a remote one), we need to fix any other
   // local items that have it as their parent
   _fixParents: function SC__fixParents(list, oldGUID, newGUID) {
     for (let i = 0; i < list.length; i++) {
       if (!list[i])
         continue;
-      if (list[i].data && list[i].data.parentGUID &&
-          list[i].data.parentGUID == oldGUID)
-        list[i].data.parentGUID = newGUID;
+      if (list[i].data && list[i].data.parentid &&
+          list[i].data.parentid == oldGUID)
+        list[i].data.parentid = newGUID;
       for (let j = 0; j < list[i].parents.length; j++) {
         if (list[i].parents[j] == oldGUID)
           list[i].parents[j] = newGUID;
       }
     }
   },
 
   _conflicts: function SC__conflicts(a, b) {