Bug 715355 - Deprecate and remove old style GUIDs. r=mak
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Thu, 12 Apr 2012 12:27:57 +0200
changeset 94846 05aa7f1962a3bb16c07baa1efa8aa0a0ba40d7f9
parent 94845 6a4d396a3c438d0279544a1e21a7cb7e1535678c
child 94847 233fa36796ed5c973ec1685d07535dbff3a61121
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs715355
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 715355 - Deprecate and remove old style GUIDs. r=mak
browser/components/places/tests/browser/Makefile.in
browser/components/places/tests/browser/browser_457473_no_copy_guid.js
services/sync/tests/unit/test_bookmark_smart_bookmarks.js
toolkit/components/places/Database.cpp
toolkit/components/places/Database.h
toolkit/components/places/PlacesDBUtils.jsm
toolkit/components/places/PlacesUtils.jsm
toolkit/components/places/nsINavBookmarksService.idl
toolkit/components/places/nsNavBookmarks.cpp
toolkit/components/places/nsNavBookmarks.h
toolkit/components/places/tests/bookmarks/test_360134.js
toolkit/components/places/tests/bookmarks/test_484026.js
toolkit/components/places/tests/bookmarks/test_restore_guids.js
toolkit/components/places/tests/bookmarks/xpcshell.ini
toolkit/components/places/tests/head_common.js
toolkit/components/places/tests/migration/places_v19.sqlite
toolkit/components/places/tests/migration/test_current_from_v19.js
toolkit/components/places/tests/migration/xpcshell.ini
toolkit/components/places/tests/unit/test_null_interfaces.js
toolkit/components/places/tests/unit/test_preventive_maintenance.js
toolkit/components/places/tests/unit/test_txnGUIDs.js
toolkit/components/places/tests/unit/xpcshell.ini
--- a/browser/components/places/tests/browser/Makefile.in
+++ b/browser/components/places/tests/browser/Makefile.in
@@ -46,17 +46,16 @@ include $(topsrcdir)/config/rules.mk
 _BROWSER_TEST_FILES = \
 	head.js \
 	browser_0_library_left_pane_migration.js \
 	browser_library_left_pane_fixnames.js \
 	browser_425884.js \
 	browser_475045.js \
 	browser_423515.js \
 	browser_410196_paste_into_tags.js \
-	browser_457473_no_copy_guid.js \
 	browser_sort_in_library.js \
 	browser_library_open_leak.js \
 	browser_library_panel_leak.js \
 	browser_library_search.js \
 	browser_history_sidebar_search.js \
 	browser_bookmarksProperties.js \
 	$(warning browser_forgetthissite_single.js temporarily disabled because of very frequent oranges, see bug 551540) \
 	browser_library_left_pane_commands.js \
deleted file mode 100644
--- a/browser/components/places/tests/browser/browser_457473_no_copy_guid.js
+++ /dev/null
@@ -1,146 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Places test code.
- *
- * The Initial Developer of the Original Code is the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Dietrich Ayala <dietrich@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-function test() {
-  // sanity check
-  ok(PlacesUtils, "checking PlacesUtils, running in chrome context?");
-  ok(PlacesUIUtils, "checking PlacesUIUtils, running in chrome context?");
-
-  /*
-  - create, a test folder, add bookmark, separator to it
-  - fetch guids for all
-  - copy the folder
-  - test that guids are all different
-  - undo copy
-  - redo copy
-  - test that guids for the copy stay the same
-  */
-
-  var toolbarId = PlacesUtils.toolbarFolderId;
-  var toolbarNode = PlacesUtils.getFolderContents(toolbarId).root;
-
-  var oldCount = toolbarNode.childCount;
-  var testRootId = PlacesUtils.bookmarks.createFolder(toolbarId, "test root", -1);
-  is(toolbarNode.childCount, oldCount+1, "confirm test root node is a container, and is empty");
-  var testRootNode = toolbarNode.getChild(toolbarNode.childCount-1);
-  PlacesUtils.asContainer(testRootNode);
-  testRootNode.containerOpen = true;
-  is(testRootNode.childCount, 0, "confirm test root node is a container, and is empty");
-
-  // create folder A, fill it w/ each item type
-  var folderAId = PlacesUtils.bookmarks.createFolder(testRootId, "A", -1);
-  PlacesUtils.bookmarks.insertBookmark(folderAId, PlacesUtils._uri("http://foo"),
-                                       -1, "test bookmark");
-  PlacesUtils.bookmarks.insertSeparator(folderAId, -1);
-  var folderANode = testRootNode.getChild(0);
-  var folderAGUIDs = getGUIDs(folderANode);
-
-  // test the test function
-  ok(checkGUIDs(folderANode, folderAGUIDs, true), "confirm guid test works");
-
-  // serialize the folder
-  var serializedNode = PlacesUtils.wrapNode(folderANode, PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER);
-  var rawNode = PlacesUtils.unwrapNodes(serializedNode, PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER).shift();
-  ok(rawNode.type, "confirm json node was made");
-
-  // Create a copy transaction from the serialization.
-  // this exercises the guid-filtering
-  var transaction = PlacesUIUtils.makeTransaction(rawNode,
-                                                  PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER,
-                                                  testRootId, -1, true);
-  ok(transaction, "create transaction");
-
-  // execute it, copying to the test root folder
-  PlacesUtils.transactionManager.doTransaction(transaction);
-  is(testRootNode.childCount, 2, "create test folder via copy");
-
-  // check GUIDs are different
-  var folderBNode = testRootNode.getChild(1);
-  ok(checkGUIDs(folderBNode, folderAGUIDs, false), "confirm folder A GUIDs don't match folder B GUIDs");
-  var folderBGUIDs = getGUIDs(folderBNode);
-  ok(checkGUIDs(folderBNode, folderBGUIDs, true), "confirm test of new GUIDs");
-
-  // undo the transaction, confirm the removal
-  PlacesUtils.transactionManager.undoTransaction();
-  is(testRootNode.childCount, 1, "confirm undo removed the copied folder");
-
-  // redo the transaction
-  // confirming GUIDs persist through undo/redo
-  PlacesUtils.transactionManager.redoTransaction();
-  is(testRootNode.childCount, 2, "confirm redo re-copied the folder");
-  folderBNode = testRootNode.getChild(1);
-  ok(checkGUIDs(folderBNode, folderAGUIDs, false), "folder B GUIDs after undo/redo don't match folder A GUIDs"); // sanity check
-  ok(checkGUIDs(folderBNode, folderBGUIDs, true), "folder B GUIDs after under/redo should match pre-undo/redo folder B GUIDs");
-
-  // Close containers, cleaning up their observers.
-  testRootNode.containerOpen = false;
-  toolbarNode.containerOpen = false;
-
-  // clean up
-  PlacesUtils.transactionManager.undoTransaction();
-  PlacesUtils.bookmarks.removeItem(testRootId);
-}
-
-function getGUIDs(aNode) {
-  PlacesUtils.asContainer(aNode);
-  aNode.containerOpen = true;
-  var GUIDs = {
-    folder: PlacesUtils.bookmarks.getItemGUID(aNode.itemId),
-    bookmark: PlacesUtils.bookmarks.getItemGUID(aNode.getChild(0).itemId),
-    separator: PlacesUtils.bookmarks.getItemGUID(aNode.getChild(1).itemId)
-  };
-  aNode.containerOpen = false;
-  return GUIDs;
-}
-
-function checkGUIDs(aFolderNode, aGUIDs, aShouldMatch) {
-
-  function check(aNode, aGUID, aEquals) {
-    var nodeGUID = PlacesUtils.bookmarks.getItemGUID(aNode.itemId);
-    return aEquals ? (nodeGUID == aGUID) : (nodeGUID != aGUID);
-  }
-
-  PlacesUtils.asContainer(aFolderNode);
-  aFolderNode.containerOpen = true;
-
-  var allMatch = check(aFolderNode, aGUIDs.folder, aShouldMatch) &&
-                 check(aFolderNode.getChild(0), aGUIDs.bookmark, aShouldMatch) &&
-                 check(aFolderNode.getChild(1), aGUIDs.separator, aShouldMatch)
-
-  aFolderNode.containerOpen = false;
-  return allMatch;
-}
--- a/services/sync/tests/unit/test_bookmark_smart_bookmarks.js
+++ b/services/sync/tests/unit/test_bookmark_smart_bookmarks.js
@@ -126,17 +126,16 @@ add_test(function test_annotation_upload
 
     _("We still have the right count.");
     do_check_eq(smartBookmarkCount(), startCount + 1);
 
     _("Clear local records; now we can't find it.");
     
     // "Clear" by changing attributes: if we delete it, apparently it sticks
     // around as a deleted record...
-    PlacesUtils.bookmarks.setItemGUID(mostVisitedID, "abcdefabcdef");
     PlacesUtils.bookmarks.setItemTitle(mostVisitedID, "Not Most Visited");
     PlacesUtils.bookmarks.changeBookmarkURI(
       mostVisitedID, Utils.makeURI("http://something/else"));
     PlacesUtils.annotations.removeItemAnnotation(mostVisitedID,
                                                  SMART_BOOKMARKS_ANNO);
     store.wipe();
     engine.resetClient();
     do_check_eq(smartBookmarkCount(), startCount);
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -755,16 +755,23 @@ Database::InitSchema(bool* aDatabaseMigr
 
       if (currentSchemaVersion < 19) {
         rv = MigrateV19Up();
         NS_ENSURE_SUCCESS(rv, rv);
       }
 
       // Firefox 13 uses schema version 19.
 
+      if (currentSchemaVersion < 20) {
+        rv = MigrateV20Up();
+        NS_ENSURE_SUCCESS(rv, rv);
+      }
+
+      // Firefox 14 uses schema version 20.
+
       // Schema Upgrades must add migration code here.
 
       rv = UpdateBookmarkRootTitles();
       // We don't want a broken localization to cause us to think
       // the database is corrupt and needs to be replaced.
       MOZ_ASSERT(NS_SUCCEEDED(rv));
     }
   }
@@ -1294,16 +1301,17 @@ Database::MigrateV7Up()
       ") "
       "WHERE type = :item_type "
       "AND parent = ("
         "SELECT folder_id "
         "FROM moz_bookmarks_roots "
         "WHERE root_name = :parent_name "
       ")"),
     getter_AddRefs(moveUnfiledBookmarks));
+  NS_ENSURE_SUCCESS(rv, rv);
   rv = moveUnfiledBookmarks->BindUTF8StringByName(
     NS_LITERAL_CSTRING("root_name"), NS_LITERAL_CSTRING("unfiled")
   );
   NS_ENSURE_SUCCESS(rv, rv);
   rv = moveUnfiledBookmarks->BindInt32ByName(
     NS_LITERAL_CSTRING("item_type"), nsINavBookmarksService::TYPE_BOOKMARK
   );
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1771,16 +1779,17 @@ Database::MigrateV19Up()
   nsresult rv = mMainConn->CreateStatement(NS_LITERAL_CSTRING(
     "DELETE FROM moz_bookmarks WHERE parent IN("
       "SELECT b.id FROM moz_bookmarks b "
       "JOIN moz_items_annos a ON a.item_id = b.id "
       "JOIN moz_anno_attributes n ON n.id = a.anno_attribute_id "
       "WHERE b.type = :item_type AND n.name = :anno_name "
     ")"
   ), getter_AddRefs(deleteLivemarksChildrenStmt));
+  NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksChildrenStmt->BindUTF8StringByName(
     NS_LITERAL_CSTRING("anno_name"), NS_LITERAL_CSTRING(LMANNO_FEEDURI)
   );
   NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksChildrenStmt->BindInt32ByName(
     NS_LITERAL_CSTRING("item_type"), nsINavBookmarksService::TYPE_FOLDER
   );
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1795,16 +1804,17 @@ Database::MigrateV19Up()
   // Remove the old status annotations.
   nsCOMPtr<mozIStorageStatement> deleteLivemarksAnnosStmt;
   rv = mMainConn->CreateStatement(NS_LITERAL_CSTRING(
     "DELETE FROM moz_items_annos WHERE anno_attribute_id IN("
       "SELECT id FROM moz_anno_attributes "
       "WHERE name IN (:anno_loading, :anno_loadfailed, :anno_expiration) "
     ")"
   ), getter_AddRefs(deleteLivemarksAnnosStmt));
+  NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksAnnosStmt->BindUTF8StringByName(
     NS_LITERAL_CSTRING("anno_loading"), NS_LITERAL_CSTRING("livemark/loading")
   );
   NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksAnnosStmt->BindUTF8StringByName(
     NS_LITERAL_CSTRING("anno_loadfailed"), NS_LITERAL_CSTRING("livemark/loadfailed")
   );
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1815,16 +1825,17 @@ Database::MigrateV19Up()
   rv = deleteLivemarksAnnosStmt->Execute();
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Remove orphan annotation names.
   rv = mMainConn->CreateStatement(NS_LITERAL_CSTRING(
     "DELETE FROM moz_anno_attributes "
       "WHERE name IN (:anno_loading, :anno_loadfailed, :anno_expiration) "
   ), getter_AddRefs(deleteLivemarksAnnosStmt));
+  NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksAnnosStmt->BindUTF8StringByName(
     NS_LITERAL_CSTRING("anno_loading"), NS_LITERAL_CSTRING("livemark/loading")
   );
   NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksAnnosStmt->BindUTF8StringByName(
     NS_LITERAL_CSTRING("anno_loadfailed"), NS_LITERAL_CSTRING("livemark/loadfailed")
   );
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1833,16 +1844,53 @@ Database::MigrateV19Up()
   );
   NS_ENSURE_SUCCESS(rv, rv);
   rv = deleteLivemarksAnnosStmt->Execute();
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
+nsresult
+Database::MigrateV20Up()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+
+  // Remove obsolete bookmark GUID annotations.
+  nsCOMPtr<mozIStorageStatement> deleteOldBookmarkGUIDAnnosStmt;
+  nsresult rv = mMainConn->CreateStatement(NS_LITERAL_CSTRING(
+    "DELETE FROM moz_items_annos WHERE anno_attribute_id = ("
+      "SELECT id FROM moz_anno_attributes "
+      "WHERE name = :anno_guid"
+    ")"
+  ), getter_AddRefs(deleteOldBookmarkGUIDAnnosStmt));
+  NS_ENSURE_SUCCESS(rv, rv);
+  rv = deleteOldBookmarkGUIDAnnosStmt->BindUTF8StringByName(
+    NS_LITERAL_CSTRING("anno_guid"), NS_LITERAL_CSTRING("placesInternal/GUID")
+  );
+  NS_ENSURE_SUCCESS(rv, rv);
+  rv = deleteOldBookmarkGUIDAnnosStmt->Execute();
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Remove the orphan annotation name.
+  rv = mMainConn->CreateStatement(NS_LITERAL_CSTRING(
+    "DELETE FROM moz_anno_attributes "
+      "WHERE name = :anno_guid"
+  ), getter_AddRefs(deleteOldBookmarkGUIDAnnosStmt));
+  NS_ENSURE_SUCCESS(rv, rv);
+  rv = deleteOldBookmarkGUIDAnnosStmt->BindUTF8StringByName(
+    NS_LITERAL_CSTRING("anno_guid"), NS_LITERAL_CSTRING("placesInternal/GUID")
+  );
+  NS_ENSURE_SUCCESS(rv, rv);
+  rv = deleteOldBookmarkGUIDAnnosStmt->Execute();
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  return NS_OK;
+}
+
 void
 Database::Shutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mShuttingDown);
 
   mMainThreadStatements.FinalizeStatements();
   mMainThreadAsyncStatements.FinalizeStatements();
--- a/toolkit/components/places/Database.h
+++ b/toolkit/components/places/Database.h
@@ -42,17 +42,17 @@
 #include "nsWeakReference.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIObserver.h"
 #include "mozilla/storage.h"
 #include "mozilla/storage/StatementCache.h"
 
 // This is the schema version. Update it at any schema change and add a
 // corresponding migrateVxx method below.
-#define DATABASE_SCHEMA_VERSION 19
+#define DATABASE_SCHEMA_VERSION 20
 
 // Fired after Places inited.
 #define TOPIC_PLACES_INIT_COMPLETE "places-init-complete"
 // Fired when initialization fails due to a locked database.
 #define TOPIC_DATABASE_LOCKED "places-database-locked"
 // This topic is received when the profile is about to be lost.  Places does
 // initial shutdown work and notifies TOPIC_PLACES_SHUTDOWN to all listeners.
 // Any shutdown work that requires the Places APIs should happen here.
@@ -297,16 +297,17 @@ protected:
   nsresult MigrateV11Up();
   nsresult MigrateV13Up();
   nsresult MigrateV14Up();
   nsresult MigrateV15Up();
   nsresult MigrateV16Up();
   nsresult MigrateV17Up();
   nsresult MigrateV18Up();
   nsresult MigrateV19Up();
+  nsresult MigrateV20Up();
 
   nsresult UpdateBookmarkRootTitles();
   nsresult CheckAndUpdateGUIDs();
 
 private:
   ~Database();
 
   /**
--- a/toolkit/components/places/PlacesDBUtils.jsm
+++ b/toolkit/components/places/PlacesDBUtils.jsm
@@ -336,16 +336,17 @@ let PlacesDBUtils = {
     cleanupStatements.push(deleteObsoleteAnnos);
 
     // A.2 remove obsolete annotations from moz_items_annos.
     let deleteObsoleteItemsAnnos = DBConn.createAsyncStatement(
       "DELETE FROM moz_items_annos "                +
       "WHERE anno_attribute_id IN ( "               +
       "  SELECT id FROM moz_anno_attributes "       +
       "  WHERE name = 'sync/children' "             +
+      "     OR name = 'placesInternal/GUID' "       +
       "     OR name BETWEEN 'weave/' AND 'weave0' " +
       ")");
     cleanupStatements.push(deleteObsoleteItemsAnnos);
 
     // A.3 remove unused attributes.
     let deleteUnusedAnnoAttributes = DBConn.createAsyncStatement(
       "DELETE FROM moz_anno_attributes WHERE id IN ( " +
         "SELECT id FROM moz_anno_attributes n " +
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -126,17 +126,16 @@ var PlacesUtils = {
   // Place entries formatted as HTML anchors
   TYPE_HTML: "text/html",
   // Place entries as raw URL text
   TYPE_UNICODE: "text/unicode",
   // Used to track the action that populated the clipboard.
   TYPE_X_MOZ_PLACE_ACTION: "text/x-moz-place-action",
 
   EXCLUDE_FROM_BACKUP_ANNO: "places/excludeFromBackup",
-  GUID_ANNO: "placesInternal/GUID",
   LMANNO_FEEDURI: "livemark/feedURI",
   LMANNO_SITEURI: "livemark/siteURI",
   LMANNO_EXPIRATION: "livemark/expiration",
   LMANNO_LOADFAILED: "livemark/loadfailed",
   LMANNO_LOADING: "livemark/loading",
   POST_DATA_ANNO: "bookmarkProperties/POSTData",
   READ_ONLY_ANNO: "placesInternal/READ_ONLY",
 
@@ -2297,17 +2296,16 @@ TransactionItemCache.prototype = {
   get id()
     this._id || -1,
   set parentId(v)
     this._parentId = (parseInt(v) > 0 ? v : null),
   get parentId()
     this._parentId || -1,
   keyword: null,
   title: null,
-  guid: null,
   dateAdded: null,
   lastModified: null,
   postData: null,
   itemType: null,
   set uri(v)
     this._uri = (v instanceof Ci.nsIURI ? NetUtil.newURI(v.spec) : null),
   get uri()
     this._uri || null,
@@ -2481,34 +2479,26 @@ PlacesCreateFolderTransaction.prototype 
       for (let i = 0; i < this.childTransactions.length; ++i) {
         this.childTransactions[i].item.parentId = this.item.id;
       }
 
       let txn = new PlacesAggregatedTransaction("Create folder childTxn",
                                                 this.childTransactions);
       txn.doTransaction();
     }
-
-    if (this.item.guid)
-      PlacesUtils.bookmarks.setItemGUID(this.item.id, this.item.guid);
   },
 
   undoTransaction: function CFTXN_undoTransaction()
   {
     if (this.childTransactions && this.childTransactions.length > 0) {
       let txn = new PlacesAggregatedTransaction("Create folder childTxn",
                                                 this.childTransactions);
       txn.undoTransaction();
     }
 
-    // If a GUID exists for this item, preserve it before removing the item.
-    if (PlacesUtils.annotations.itemHasAnnotation(this.item.id,
-                                                  PlacesUtils.GUID_ANNO))
-      this.item.guid = PlacesUtils.bookmarks.getItemGUID(this.item.id);
-
     // Remove item only after all child transactions have been reverted.
     PlacesUtils.bookmarks.removeItem(this.item.id);
   }
 };
 
 
 /**
  * Transaction for creating a new bookmark.
@@ -2569,34 +2559,27 @@ PlacesCreateBookmarkTransaction.prototyp
       // Set the new item id into child transactions.
       for (let i = 0; i < this.childTransactions.length; ++i) {
         this.childTransactions[i].item.id = this.item.id;
       }
       let txn = new PlacesAggregatedTransaction("Create item childTxn",
                                                 this.childTransactions);
       txn.doTransaction();
     }
-    if (this.item.guid)
-      PlacesUtils.bookmarks.setItemGUID(this.item.id, this.item.guid);
   },
 
   undoTransaction: function CITXN_undoTransaction()
   {
     if (this.childTransactions && this.childTransactions.length > 0) {
       // Undo transactions should always be done in reverse order.
       let txn = new PlacesAggregatedTransaction("Create item childTxn",
                                                 this.childTransactions);
       txn.undoTransaction();
     }
 
-    // If a GUID exists for this item, preserve it before removing the item.
-    if (PlacesUtils.annotations
-                   .itemHasAnnotation(this.item.id, PlacesUtils.GUID_ANNO))
-      this.item.guid = PlacesUtils.bookmarks.getItemGUID(this.item.id);
-
     // Remove item only after all child transactions have been reverted.
     PlacesUtils.bookmarks.removeItem(this.item.id);
   }
 };
 
 
 /**
  * Transaction for creating a new separator.
@@ -2617,27 +2600,20 @@ function PlacesCreateSeparatorTransactio
 
 PlacesCreateSeparatorTransaction.prototype = {
   __proto__: BaseTransaction.prototype,
 
   doTransaction: function CSTXN_doTransaction()
   {
     this.item.id =
       PlacesUtils.bookmarks.insertSeparator(this.item.parentId, this.item.index);
-    if (this.item.guid)
-      PlacesUtils.bookmarks.setItemGUID(this.item.id, this.item.guid);
   },
 
   undoTransaction: function CSTXN_undoTransaction()
   {
-    // If a GUID exists for this item, preserve it before removing the item.
-    if (PlacesUtils.annotations
-                   .itemHasAnnotation(this.item.id, PlacesUtils.GUID_ANNO))
-      this.item.guid = PlacesUtils.bookmarks.getItemGUID(this.item.id);
-
     PlacesUtils.bookmarks.removeItem(this.item.id);
   }
 };
 
 
 /**
  * Transaction for creating a new livemark item.
  *
@@ -2684,34 +2660,28 @@ PlacesCreateLivemarkTransaction.prototyp
       },
       (function(aStatus, aLivemark) {
         if (Components.isSuccessCode(aStatus)) {
           this.item.id = aLivemark.id;
           if (this.item.annotations && this.item.annotations.length > 0) {
             PlacesUtils.setAnnotationsForItem(this.item.id,
                                               this.item.annotations);
           }
-          if (this.item.guid)
-            PlacesUtils.bookmarks.setItemGUID(this.item.id, this.item.guid);
         }
       }).bind(this)
     );
   },
 
   undoTransaction: function CLTXN_undoTransaction()
   {
     // The getLivemark callback is expected to receive a failure status but it
     // is used just to serialize, so doesn't matter.
     PlacesUtils.livemarks.getLivemark(
       { id: this.item.id },
       (function (aStatus, aLivemark) {
-        // If a GUID exists for this item, preserve it before removing the item.
-        if (PlacesUtils.annotations.itemHasAnnotation(this.item.id, PlacesUtils.GUID_ANNO))
-          this.item.guid = PlacesUtils.bookmarks.getItemGUID(this.item.id);
-
         PlacesUtils.bookmarks.removeItem(this.item.id);
       }).bind(this)
     );
   }
 };
 
 
 /**
@@ -3432,30 +3402,23 @@ PlacesTagURITransaction.prototype = {
       // There is no bookmark for this uri, but we only allow to tag bookmarks.
       // Force an unfiled bookmark first.
       this.item.id =
         PlacesUtils.bookmarks
                    .insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
                                    this.item.uri,
                                    PlacesUtils.bookmarks.DEFAULT_INDEX,
                                    PlacesUtils.history.getPageTitle(this.item.uri));
-      if (this.item.guid)
-        PlacesUtils.bookmarks.setItemGUID(this.item.id, this.item.guid);
     }
     PlacesUtils.tagging.tagURI(this.item.uri, this.item.tags);
   },
 
   undoTransaction: function TUTXN_undoTransaction()
   {
     if (this.item.id != -1) {
-      // If a GUID exists for this item, preserve it before removing the item.
-      if (PlacesUtils.annotations
-                     .itemHasAnnotation(this.item.id, PlacesUtils.GUID_ANNO)) {
-        this.item.guid = PlacesUtils.bookmarks.getItemGUID(this.item.id);
-      }
       PlacesUtils.bookmarks.removeItem(this.item.id);
       this.item.id = -1;
     }
     PlacesUtils.tagging.untagURI(this.item.uri, this.item.tags);
   }
 };
 
 
--- a/toolkit/components/places/nsINavBookmarksService.idl
+++ b/toolkit/components/places/nsINavBookmarksService.idl
@@ -276,17 +276,17 @@ interface nsINavBookmarkObserver : nsISu
 };
 
 /**
  * The BookmarksService interface provides methods for managing bookmarked
  * history items.  Bookmarks consist of a set of user-customizable
  * folders.  A URI in history can be contained in one or more such folders.
  */
 
-[scriptable, uuid(5398fdee-72d8-4100-9863-6bb7f88274e0)]
+[scriptable, uuid(2299598b-8d83-4b67-9b13-b6d4707dcf7b)]
 interface nsINavBookmarksService : nsISupports
 {
   /**
    * The item ID of the Places root.
    */
   readonly attribute long long placesRoot;
 
   /**
@@ -421,46 +421,16 @@ interface nsINavBookmarksService : nsISu
    *  @param aIndex
    *         The index of the item within the parent folder.
    *         Pass DEFAULT_INDEX for the last item.
    *  @return The ID of the found item, -1 if the item does not exists.
    */
   long long getIdForItemAt(in long long aParentId, in long aIndex);
 
   /**
-   * Get a globally unique identifier for an item, meant to be used in
-   * sync scenarios.  Even if their contents are exactly the same
-   * (including an item in a different profile with the same ItemId),
-   * the GUID would be different.
-   *  @param   aItemId
-   *           The ID of the item to get the GUID for
-   *  @return The GUID string.
-   */
-  [deprecated] AString getItemGUID(in long long aItemId);
-
-  /**
-   * Set a globally unique identifier.  This can be useful when a sync
-   * algorithm deems two independently created items (on different
-   * profiles) to be the same item.
-   *  @param   aItemId
-   *           The id of the item to set the GUID of
-   *  @param   aGUID
-   *           The GUID string
-   */
-  [deprecated] void setItemGUID(in long long aItemId, in AString aGUID);
-
-  /**
-   * Get the ID of the item with the given GUID.
-   * @param   aGUID
-   *          The GUID string of the item to search for
-   * @return The item ID, or -1 if not found.
-   */
-  [deprecated] long long getItemIdForGUID(in AString aGUID);
-
-  /**
    * Set the title for an item.
    *  @param aItemId
    *         The id of the item whose title should be updated.
    *  @param aTitle
    *         The new title for the bookmark.
    *
    *  @note  aTitle will be truncated to TITLE_LENGTH_MAX.
    */
--- a/toolkit/components/places/nsNavBookmarks.cpp
+++ b/toolkit/components/places/nsNavBookmarks.cpp
@@ -45,17 +45,16 @@
 #include "nsAnnotationService.h"
 #include "nsPlacesMacros.h"
 #include "Helpers.h"
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsPrintfCString.h"
-#include "nsIUUIDGenerator.h"
 #include "prprf.h"
 #include "mozilla/storage.h"
 #include "mozilla/FunctionTimer.h"
 #include "mozilla/Util.h"
 
 #include "sampler.h"
 
 #define BOOKMARKS_TO_KEYWORDS_INITIAL_CACHE_SIZE 64
@@ -94,17 +93,16 @@ const PRInt32 nsNavBookmarks::kGetChildr
 const PRInt32 nsNavBookmarks::kGetChildrenIndex_Guid = 17;
 
 using namespace mozilla::places;
 
 PLACES_FACTORY_SINGLETON_IMPLEMENTATION(nsNavBookmarks, gBookmarksService)
 
 #define BOOKMARKS_ANNO_PREFIX "bookmarks/"
 #define BOOKMARKS_TOOLBAR_FOLDER_ANNO NS_LITERAL_CSTRING(BOOKMARKS_ANNO_PREFIX "toolbarFolder")
-#define GUID_ANNO NS_LITERAL_CSTRING("placesInternal/GUID")
 #define READ_ONLY_ANNO NS_LITERAL_CSTRING("placesInternal/READ_ONLY")
 
 
 namespace {
 
 struct keywordSearchData
 {
   PRInt64 itemId;
@@ -1661,114 +1659,16 @@ nsNavBookmarks::GetItemLastModified(PRIn
   nsresult rv = FetchItemInfo(aItemId, bookmark);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *_lastModified = bookmark.lastModified;
   return NS_OK;
 }
 
 
-nsresult
-nsNavBookmarks::GetGUIDBase(nsAString &aGUIDBase)
-{
-  if (!mGUIDBase.IsEmpty()) {
-    aGUIDBase = mGUIDBase;
-    return NS_OK;
-  }
-
-  // generate a new GUID base for this session
-  nsCOMPtr<nsIUUIDGenerator> uuidgen =
-    do_GetService("@mozilla.org/uuid-generator;1");
-  NS_ENSURE_TRUE(uuidgen, NS_ERROR_OUT_OF_MEMORY);
-  nsID GUID;
-  nsresult rv = uuidgen->GenerateUUIDInPlace(&GUID);
-  NS_ENSURE_SUCCESS(rv, rv);
-  char GUIDChars[NSID_LENGTH];
-  GUID.ToProvidedString(GUIDChars);
-  CopyASCIItoUTF16(GUIDChars, mGUIDBase);
-  aGUIDBase = mGUIDBase;
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsNavBookmarks::GetItemGUID(PRInt64 aItemId, nsAString& aGUID)
-{
-  NS_ENSURE_ARG_MIN(aItemId, 1);
-
-  nsAnnotationService* annosvc = nsAnnotationService::GetAnnotationService();
-  NS_ENSURE_TRUE(annosvc, NS_ERROR_OUT_OF_MEMORY);
-  nsresult rv = annosvc->GetItemAnnotationString(aItemId, GUID_ANNO, aGUID);
-  if (NS_SUCCEEDED(rv) || rv != NS_ERROR_NOT_AVAILABLE)
-    return rv;
-
-  nsAutoString tmp;
-  tmp.AppendInt(mItemCount++);
-  aGUID.SetCapacity(NSID_LENGTH - 1 + tmp.Length());
-  nsString GUIDBase;
-  rv = GetGUIDBase(GUIDBase);
-  NS_ENSURE_SUCCESS(rv, rv);
-  aGUID.Assign(GUIDBase);
-  aGUID.Append(tmp);
-
-  rv = SetItemGUID(aItemId, aGUID);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsNavBookmarks::SetItemGUID(PRInt64 aItemId, const nsAString& aGUID)
-{
-  NS_ENSURE_ARG_MIN(aItemId, 1);
-
-  PRInt64 checkId;
-  GetItemIdForGUID(aGUID, &checkId);
-  if (checkId != -1)
-    return NS_ERROR_INVALID_ARG; // invalid GUID, already exists
-
-  nsAnnotationService* annosvc = nsAnnotationService::GetAnnotationService();
-  NS_ENSURE_TRUE(annosvc, NS_ERROR_OUT_OF_MEMORY);
-  nsresult rv = annosvc->SetItemAnnotationString(aItemId, GUID_ANNO, aGUID, 0,
-                                                 nsIAnnotationService::EXPIRE_NEVER);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsNavBookmarks::GetItemIdForGUID(const nsAString& aGUID, PRInt64* aItemId)
-{
-  NS_ENSURE_ARG_POINTER(aItemId);
-
-  nsCOMPtr<mozIStorageStatement> stmt = mDB->GetStatement(
-    "SELECT item_id FROM moz_items_annos "
-    "WHERE content = :guid "
-    "LIMIT 1"
-  );
-  NS_ENSURE_STATE(stmt);
-  mozStorageStatementScoper scoper(stmt);
-
-  nsresult rv = stmt->BindStringByName(NS_LITERAL_CSTRING("guid"), aGUID);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool hasMore = false;
-  rv = stmt->ExecuteStep(&hasMore);
-  if (NS_FAILED(rv) || ! hasMore) {
-    *aItemId = -1;
-    return NS_OK; // not found: return -1
-  }
-
-  // found, get the itemId
-  rv = stmt->GetInt64(0, aItemId);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return NS_OK;
-}
-
-
 NS_IMETHODIMP
 nsNavBookmarks::SetItemTitle(PRInt64 aItemId, const nsACString& aTitle)
 {
   NS_ENSURE_ARG_MIN(aItemId, 1);
 
   BookmarkData bookmark;
   nsresult rv = FetchItemInfo(aItemId, bookmark);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/toolkit/components/places/nsNavBookmarks.h
+++ b/toolkit/components/places/nsNavBookmarks.h
@@ -303,19 +303,16 @@ private:
 
   nsresult GetLastChildId(PRInt64 aFolder, PRInt64* aItemId);
 
   /**
    * This is an handle to the Places database.
    */
   nsRefPtr<mozilla::places::Database> mDB;
 
-  nsString mGUIDBase;
-  nsresult GetGUIDBase(nsAString& aGUIDBase);
-
   PRInt32 mItemCount;
 
   nsMaybeWeakPtrArray<nsINavBookmarkObserver> mObservers;
 
   PRInt64 mRoot;
   PRInt64 mMenuRoot;
   PRInt64 mTagsRoot;
   PRInt64 mUnfiledRoot;
deleted file mode 100644
--- a/toolkit/components/places/tests/bookmarks/test_360134.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Bug 360134 (item guids) unit test code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Dan Mills <thunder@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// Get bookmark service
-try {
-  var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
-              getService(Ci.nsINavBookmarksService);
-} catch(ex) {
-  do_throw("Could not get nav-bookmarks-service\n");
-}
-
-// main
-function run_test() {
-  var URI = uri("http://foo.tld.com/");
-  var folderId = bmsvc.createFolder(bmsvc.placesRoot, "test folder",
-                                    bmsvc.DEFAULT_INDEX);
-  var bookmarkId = bmsvc.insertBookmark(folderId, URI, bmsvc.DEFAULT_INDEX, "a title");
-  var separatorId = bmsvc.insertSeparator(folderId, bmsvc.DEFAULT_INDEX);
-
-  // get & uniqueness
-  do_check_eq(bmsvc.getItemGUID(bookmarkId), bmsvc.getItemGUID(bookmarkId));
-
-  do_check_neq(bmsvc.getItemGUID(folderId), bmsvc.getItemGUID(bookmarkId));
-  do_check_neq(bmsvc.getItemGUID(folderId), "");
-
-  do_check_neq(bmsvc.getItemGUID(separatorId), bmsvc.getItemGUID(bookmarkId));
-  do_check_neq(bmsvc.getItemGUID(separatorId), "");
-
-  // set
-  bmsvc.setItemGUID(bookmarkId, "asdf123");
-  do_check_eq(bmsvc.getItemGUID(bookmarkId), "asdf123");
-
-  bmsvc.setItemGUID(folderId, "123asdf");
-  do_check_eq(bmsvc.getItemGUID(folderId), "123asdf");
-
-  try {
-    bmsvc.setItemGUID(bookmarkId, "123asdf"); // should fail
-  } catch (e) {
-    do_check_eq(e.result, Cr.NS_ERROR_ILLEGAL_VALUE);
-  }
-
-  // GUID -> itemId
-  do_check_eq(bmsvc.getItemIdForGUID("asdf123"), bookmarkId);
-  do_check_eq(bmsvc.getItemIdForGUID("123asdf"), folderId);
-
-}
deleted file mode 100644
--- a/toolkit/components/places/tests/bookmarks/test_484026.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Places Unit Test Code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Saint Wesonga <wesongathedeveloper@yahoo.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
-              getService(Ci.nsINavBookmarksService);
-
-function testThrowsOnDeletedItemId(aItemId) {
-  try {
-    bmsvc.getItemGUID(aItemId);
-    do_throw("getItemGUID should throw when called for a deleted item id");
-  } catch (e) {
-    do_check_eq(e.result, Cr.NS_ERROR_ILLEGAL_VALUE);
-  }
-}
-
-function run_test() {
-  var folderId = bmsvc.createFolder(bmsvc.placesRoot, "test folder",
-                                    bmsvc.DEFAULT_INDEX);
-  var bookmarkId = bmsvc.insertBookmark(folderId, uri("http://foo.tld.com/"),
-                                        bmsvc.DEFAULT_INDEX, "a title");
-  var separatorId = bmsvc.insertSeparator(folderId, bmsvc.DEFAULT_INDEX);
-
-  bmsvc.removeItem(folderId);
-
-  // getItemGUID should throw when called for a deleted item id
-  [folderId, bookmarkId, separatorId].forEach(testThrowsOnDeletedItemId);
-}
deleted file mode 100644
--- a/toolkit/components/places/tests/bookmarks/test_restore_guids.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Bug 384370 code.
- *
- * The Initial Developer of the Original Code is the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Dietrich Ayala <dietrich@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var tests = [];
-
-/*
-
-Backup/restore tests example:
-
-var myTest = {
-  populate: function () { ... add bookmarks ... },
-  validate: function () { ... query for your bookmarks ... }
-}
-
-this.push(myTest);
-
-*/
-
-const DEFAULT_INDEX = PlacesUtils.bookmarks.DEFAULT_INDEX;
-
-var test = {
-  _testBookmarkId: null,
-  _testBookmarkGUID: null, 
-
-  populate: function populate() {
-    var bookmarkURI = uri("http://bookmark");
-    this._testBookmarkId =
-      PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId, bookmarkURI,
-                                           DEFAULT_INDEX, "bookmark");
-    this._testBookmarkGUID = PlacesUtils.bookmarks.getItemGUID(this._testBookmarkId);
-  },
-
-  clean: function () {},
-
-  validate: function validate() {
-    var guid = PlacesUtils.bookmarks.getItemGUID(this._testBookmarkId);
-    do_check_eq(this._testBookmarkGUID, guid);
-  }
-}
-tests.push(test);
-
-function run_test() {
-  do_check_eq(typeof PlacesUtils, "object");
-
-  // make json file
-  var jsonFile = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
-  jsonFile.append("bookmarks.json");
-  if (jsonFile.exists())
-    jsonFile.remove(false);
-  jsonFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600);
-  if (!jsonFile.exists())
-    do_throw("couldn't create file: bookmarks.exported.json");
-
-  // populate db
-  tests.forEach(function(aTest) {
-    aTest.populate();
-    // sanity
-    aTest.validate();
-  });
-
-  // export json to file
-  try {
-    PlacesUtils.backups.saveBookmarksToJSONFile(jsonFile);
-  } catch(ex) { do_throw("couldn't export to file: " + ex); }
-
-  // clean
-  tests.forEach(function(aTest) {
-    aTest.clean();
-  });
-
-  // restore json file
-  try {
-    PlacesUtils.restoreBookmarksFromJSONFile(jsonFile);
-  } catch(ex) { do_throw("couldn't import the exported file: " + ex); }
-
-  // validate
-  tests.forEach(function(aTest) {
-    aTest.validate();
-  });
-
-  // clean up
-  jsonFile.remove(false);
-}
--- a/toolkit/components/places/tests/bookmarks/xpcshell.ini
+++ b/toolkit/components/places/tests/bookmarks/xpcshell.ini
@@ -1,35 +1,32 @@
 [DEFAULT]
 head = head_bookmarks.js
 tail = 
 
-[test_360134.js]
 [test_384228.js]
 [test_385829.js]
 [test_388695.js]
 [test_393498.js]
 [test_395101.js]
 [test_395593.js]
 [test_405938_restore_queries.js]
 [test_417228-exclude-from-backup.js]
 [test_417228-other-roots.js]
 [test_423515_forceCopyShortcuts.js]
 [test_424958-json-quoted-folders.js]
 [test_448584.js]
 [test_458683.js]
 [test_466303-json-remove-backups.js]
 [test_477583_json-backup-in-future.js]
-[test_484026.js]
 [test_async_observers.js]
 [test_bmindex.js]
 [test_bookmarks.js]
 [test_changeBookmarkURI.js]
 [test_getBookmarkedURIFor.js]
 [test_keywords.js]
 [test_livemarks.js]
 [test_nsINavBookmarkObserver.js]
 [test_onBeforeItemRemoved_observer.js]
 [test_removeItem.js]
-[test_restore_guids.js]
 [test_savedsearches.js]
 [test_675416.js]
 [test_711914.js]
--- a/toolkit/components/places/tests/head_common.js
+++ b/toolkit/components/places/tests/head_common.js
@@ -30,17 +30,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const CURRENT_SCHEMA_VERSION = 19;
+const CURRENT_SCHEMA_VERSION = 20;
 
 const NS_APP_USER_PROFILE_50_DIR = "ProfD";
 const NS_APP_PROFILE_DIR_STARTUP = "ProfDS";
 const NS_APP_BOOKMARKS_50_FILE = "BMarks";
 
 // Shortcuts to transitions type.
 const TRANSITION_LINK = Ci.nsINavHistoryService.TRANSITION_LINK;
 const TRANSITION_TYPED = Ci.nsINavHistoryService.TRANSITION_TYPED;
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..11e2e6247ba85f31d64cd59f3c1bc5d0e3d6be4e
GIT binary patch
literal 1179648
zc%1Fsdvsh^eJJ30=`o5GCxoCpfJ{j2;Ks6~$g-V;G?8P)Q7qfBEkDUxVl0j2u}2zt
zX7sQV``8Ywn^4-4q?G0sN_uIb3j&2jXw$|NTJtQALQBglgjZP5){p`Xa3O8(nHkBJ
zY&i+NtmTq^U)Jn>_HXZf_CEXUb9DSyHmvK(mNKaw`NB}TlxmM0jKpG*8&auABoYsQ
zmq$)`N%%`lD@ViMd68!pk2HVtvc~<7MJ~&2jU0Gz|2OY=eE*y8n0v>2_x)_&f_?AX
zTiE+=ds7n~6W<ws<@oo<8cXjkrHel-{zmbV!g~s>dwzG%IU}zfY0CdzJ~8~;!%ai?
z4n@M#000000000000000000000000000000006-A&!NjNt7}?!W%SV2?C?NlVkp0_
zFI&nC75mb|!}((6I9)0gvfD>Xnb}%ge&hPC&fc!n#x>pRHg=`D*R1H;l6v;Dq}HxE
zxmD`r<w9R}U}36U?mONg3@tb`_hofWD=&#2>N-A&>ZwO^>Hf^AGptlzcDlKpw(Hci
zCMQ&Bak?4BF0E_oz9M?)(&K|}&*yg!r3<@@eS@Rffxgk<?4HrgskJXV-Ly{Me`;RG
zTcloIZn9u3Ro8UmrO`v@A0MSM<=H1tt-ADdqo1bd)X>%H$#IL9)HQX6<DPr+xTA&K
z?8By>W!RHCo;+$;z2MNfFRg3Z5UzN~EGu5#JGpeRG?X96?#N~aPHl3@<P2t8?^%1#
zvgkW@FHDu&t)6VRVE;?%nyx?1CKyQ<GQ*`)D_;5x6Pea$mf@?l3sWQcVz!jc4=>pB
z;<~15!{HlGvm&R4U-B%g@Jv@;+B=e2a43FpxaV4?U-Hguv6L_D9m|HZD)tSer#*)=
zs$P7`*r(|^HU5n1)XOV*rByhKi=KHFI|})s*{d#omRTI{d74?2>-#E&1&5k0tZP~w
z&f@yh%%ZY=Pro1+J<C*Pc0bL0PQ0Y1t<QlA!q?@c)0b!RIV<npO1l}es#acj%5+ZK
z>E!3L+@f#V_(M%~P1l9vCr=)KM<LUn8SdYEQv8C`4Lzg%$)iqHF4*;=x~8SG4Of{`
ze|~hhbRyVvy0K0)K6#+(l~t-1WX`W^>Ilb*o;=phe6e&=>_w*=>Ui6eM=E5-DwPX{
zUKl>w;V@^NvV!TcY=3_Er11HtUBGG0Pg%ceUHQ-1s`F}_=FN+~vXtJQ%M|zI!goPm
zv6L>gO+S9&<RHDB%X_*~(`#N{+MZjO9hg{HE-g5G+Y9QNuDmk(>U`yNC;g#6sd(Ou
zlb-TXkV<6-!mH}-TG_Qeb?f@>)t&3NrdD-rU6`8uTsU62W^He3&BmUdS^ip2wON=N
z$_{1v$}h6irq1;@-rTwV<?UB3NUi9)sdHn`RQGU6O5uAp)w6cZ%E?v>Q#*3$!Q%0;
zraH7POl2lUvW0Z{bv#>bWvE%=<)@@`U?4LvTjlgWF{joqIK1lIx~5AmiM~2>e0h&A
zY~|nur!48SF6Pu*<bU339y(`kT~m8|^w7!~t9jyzi?f8znRSJyHF&1A9!?L<T(HTH
zqNycc&~;92)7JKAr1H>CK4$6BQod5|n`N}VwpoJb9%^Z<D?ikSFFk%`lTUnc`tjMP
zT+39=GhIaZMK=AGPF_RhR-{wQd)6*L&F+|Si_0fim@0o#rh2=!^e$L>c5TzDdCzp=
zQ&X#6@l<K<t#fM2FPyD2USFB;YjU{%<YMEjFR{tWmzVF&!mza9j)uzG9lG}T+U?Hl
z9nTjAiqntJI%VyqYEHj)sm_hPYrEHkJy&<F>0Owb>`_^P$z@!y^sHxFh^cX^3o%ui
zbEvMqx|=(W&-=s&ULl_^6=w-0Pq~Vd8k8@le9$*z>$WXfaQwFK$ma$!g=sH`1zpK!
z+r%dgQoWLsf(?gXP*>M<#TC&z`%k@~8HM`OU&J%*<LR%I@G^Fv@`k9s#j2m)CmK$D
zf}e<#vZY*R=38#^uFQC4PA*hs*zz5p<>fW|D{K05a_Ewp%3pxPjmH<I{LxT6eo%YL
zVpPJ<v=HS6)jc@%9y)PzC%?0%U2Hi0Q~y>>d#kq9);4ur@=SNXGNI}{uN>ALS`x2o
zYHp4mzU0JL!|=#xY4Usb<Z|NF?}ll$<tu%LziE}GGu~e(>PCy1>Zjg`%bou8PW#}l
zoMpj+>l3w28=9Z#TBpyfddbrxHIYapacE_%uBoLZdic5%w{-f4{waa@skeCMKMYQP
zt55tBX4-~6X|bmNbK>OK%x9*UDHf+a2@4Ldi`F$=dTI34L&vYA`oVePD0a%+r#?wj
z&-pLTtWVt3=kv_yw9oh1J`i?h!>4bS?~Q4DV&;CIt;LCN>1ogUNzcvkj?Hb;dY<%e
zr{j&MKk$v=7HPO+c_esyu<pQ<2kt-6eV}H4asSdgJ{1N500000000000000000000
z0000000000000000Dxc6p}K}Sk=whQllAq{Xzje6rP9bXEiL2Y<BNv!`?9%QdQrYG
z*fLVc@5=O-iY+^`h0KopL>R~vGPz8;m|3*5G?crk8cwar4(=@F_NKyev6NarI-I&S
zJ(w9R<QJuLx$M6D(4z90YX%~TBS&w0_@ZN5#<Tfi$I{I=we@VzCg()<N6Hh4`~nkc
zTfC?>-BvCZONG(lmXpV-4)xGo`!m~Gm#pdRShcmcJ$p_4oXEOJq&`_6sgKO7{6FTe
zDgUqBuUj&|m@kyBYg;^jC_S-0Qyk5eir2NZj;u*<*wV9haOb8K%MQ)0Ym6M)ds6Qm
z`P@LJaNY8?YgeuAT)%2V-|DV48|P0(H?Fy<yQgbK-|^b1ir%$rdzN>upTB1`Q`p;E
zo<Q5=1g@Gnf%%z<{@mz5W?k4Yn+YT7!qV2(J!2bp>|Qp!ymn3`ebRginSpSD!i8F$
zAIMyHRrRdPW}bBO#PVIu%Qvm;>6;i_Q!^*BA<|qQ?t)lkw#Dzy54B{5n>TJ~NpH`O
zmRg4L{WI1%5qaHs-`LKLJ4ZM6Z!hiJmY5US{oKwsbtl8f(CBcswD**A$0M)1YWudH
z?8NTXeZ9>$Zj1lo=N>JV@<Z8unN!Xki@a`I@2V}`&21a=nQX2%R$j~Uxs%WJ+&eS5
zkyB0^d0lBNKe#*Bx@MrKvu$&9PGqoh*2r_7ab~zwNatob@y=a0FD-7$Y#$uhw7M~T
zf@8s#BEk2<1ONa400000000000000000000000000000000000o^M_dtBWL~wb5up
zByr^EZ4X~`tTuLTv@TK~txZOgmDodf?T<B<+a5f_a|HkZ00000000000000000000
z000000000000000fHSP2oE$vElK=n!00000000000000000000000000000000000
zfHSNy{KbMVMS^2t0ssI200000000000000000000000000000000000&o}4BY9g0K
z>xc6DvbkJ(QNA!Z@PcR<iX9L2=Z7M%YY3ahf^S5EAA|`200000000000000000000
z000000000000000002B+&5d6c9m?;^=5pyp`NClA?D%ELsd9gQsIlDSj)x<`KL&3K
zUKO++_~C(v58QF!*AGPZe|-Oa`(L^L#dmx=tOfu80000000000000000000000000
z0000000000{u{e;?wm+85{-t3wYBr&u~;N=<mhepU3m9YUg};swrQg8s#`jCb#|OR
zCz6atlb2N**T>dp`ZL3&RBw8)SZ#jpvTA<*ooh1r-t6d#-8;7qExWF<(yhL|(yeZ?
zTW)V^c|N~;C|%f{8K`!vy{DQtd}UYPj;nX9UAH2?qN{VsoND)ZmF~6i)%jv6wJBT7
zmL~h%`?CkD`P28V-8?qfbIXcdOV+OKZ9l8hFZz;7znZ#u=l1+)DYdaW*Lzz(T+OfD
zxMtgq_Oa!iBZc(P$kK*tr|Mvdy4cE0Db+nZmd}k%jdp&2HJ`ujrip!nJ%i~jn?|?w
zU7M_~O-pql>uww^mhwZ{eVNov*+OPVexlOpo}bRGcCKGkxUs8w<HV|w=Jw6auc)tH
zVq2witnTJaZX}f+9!T|$mhy#cI#-?ZJ%9g_YX0~~HmzDZQQ9@QH`}qM`I@@wJ-o8o
zI~J}`<^M}RbL79dcj~$~7YmCQ=hu&K9$U3#S#3CSGMcRRjfYoT$_@{vHk8tZspY-r
zp{8p7$UD}Ib@gS(ORL(~-m>KtHRVy0(aAZ-Hx3u`<vz#nYIV-9dBeli-re16OS?x)
z9oepBn+C@hC91v8pPcjYJv7xm%-8kaJi4WGXJ+fJk?b|`O8d#>jU68&)tk@fwx<g-
z`i2`KvnyZB^beJK_U@Zl8msiJUvP5Y)tTYZ86Cs@-n?pk^VREC7Y5TEH!g^lJJ#1X
zRy&?Nzg3;f*6q1^_0>HqSM3X%L~4SMMS>@Te+?cBJ|7+e00000000000000000000
z000000000000000006+Rs<Ue17e_~jcVu&!ftvb6{QPJsJy=Yf6%WIud_K25U5MAm
z!thXLcr=!b#xG2c<kJ0_Vnf)uCiqk&_(|}+;PK##;UNG300000000000000000000
z0000000000000000Q^cjD}Hfwba+QLml>!jAD8m^-1c-KULQX{T1pQV6Uq36$&p;T
zKT|A+hBCvWvBq-8gJ*c+000000000000000000000000000000000000001RhBcIv
zgJ*aW000000000000000000000000000000000000001RhBcOxgJ*aW0000000000
z00000000000000000000000000001RhBb!2n&QVJ`?u_S&qV#`tHMJ70000000000
z000000000000000000000001Z-nsMqn)=Ar*Q73~owu`88o8#WWqf>m(NKP0HkV5;
z$`=M(%D)}yv21^Scu|<#ee0T)jSUwygnb*kZ(gxJ%+D$R>TARFk{>;tjzps8cCYB{
zUG|&rzxTa+;%##hEjQe?rRF^~pZ}W|eKEG7>)1EmH@CO`te@`a{p)MK{`BwPd+eUr
z#mT{CM?Uh68~*uE-}(NVZn^vQchzs({qK+Mz4FM{o>-B%^u65+f4=pPqW2xBd)L1<
zw!ih*-@I(k8&V(LdinZW9{%~?McS{89((hjU+|uHe)w&v@ATYqch@(&9^H2IQ(ML&
zKl}b22Y>JDnU~gm=&K()*7nj*AC8X=6drB<`Ifie`JL~#r!If=&2ReATkoq+ylM9<
z=l}JS$%)+m`KMd%UUu|%@BiHGAN%Us&n-!Q=aI|axb4b@b+=r2_NV5I2lwy4@8R1P
zy?VuG?%#IhZyc_F@4J`2^v^zfd+^@BTK#8V`_B(=yYdHby5m@Pu>J$%+vg5`{|}1)
zIj8l`-}<*l_a~lw%ab+#cKPLtS3J7@kIGBl-L+=LyO+P}aCRs?m}waq9*iVDaBK5J
zPySKI=Iq{EMn?Db+}u3&nt6$2<WT(X7oPscT-Dmz(K3`C$TW|RG*8~4miFeh_V)J0
zi<h=7S=_O-{W;vNNMf*ab!Q~<rypNh^V)w7%NLfqwv;yHca+A{g-oP#Aiq76>MqZ9
zeI`Aych4s>uLy7PKb3Fs#Fw`}_4L!%$LB>-2Y>JNS3mK!4-P(Y?ATN9dho%gzV?QD
ze(=G&@BT!Pdio3h@{jNQ^RGQJzV=1GAB{vm94SQW-*R>Fqo4lb7k~P}v*JgeZolD3
z!(C6r_FQz%BRBlu9UI>{_Sc_3+ImCe(B1d95B_@XML)j&h3`0b#T(;42>R<Azj@_?
z1^>~Mxcd(;jGS}BoX@uYbZ&d(<3Ii2#g8}i-<AIMtC}u+dTwK5&Bd{?FMaiqhSqo_
zR{!8%y!EZ$YKnh;?Df$nE;wh&(K-9-KJv&PK6ZF-UFzTiZ>wMa)bO0PSIz%?YT)Rm
z&ZD*S|El3%nh!<}|HapT(zCeniP!)1qpxadIQ)U=d3ANIt)Gp??mGAJ*sTw>J^IMU
zJ{w)!_}yIX=2Y!p-t~tszG%bwH{9`}zg@DZWpLtygLCiv<d@zz=k|kl9E`*siG24h
z-%DM5%>!?H%b_nn8vV$74u0?8&pvqM$Wzzf`GVKK`FDSON$TJQkA2|wkDdKnHJvL`
z|GBd8wg(>gdNA+SgRwWy{rhF-U2xe)KlGkh*L5F%G7?SvcFnDS@|QOZ?fqYmzo7q5
zelztOpZ$kOeLQi_o1*I<KRj^l#~--=qpyGcNB{W3S4U&@f6#RB6B9qV{eiD+y7B)$
z@S)rGzi8oSBLDu;wYS}$OdV|PN$maO_(gAc;9yP73m1K*^MY^+3qJjsNVGOG=ZfF?
z*oSt1V&Uoc>F5_fxoi84dy2)I*6bU)x#KnS;{T<6de!uOx@4JsYM=g+_vz7BckUZr
zzO`fd&E1*&$ZO`s{!9C`ZTdd#xY|CoPk+h#^sVo@I)7{1#JU@ATCr~XuGh?q{+IS?
z>x_NcYM<JtzvO*-FfrCs+CILseWI;r`;FzDRde9)Bf*D)Ao%qI{}CPn0000000000
z0000000000000000000000000008j3@N4m{(VeBz$Tcl3<KyFthVuKexm<ctzA)HQ
z{_RMQW&88Pi^8PlhQy)x>Dpe^+S<`Flpe@5kB&4?c4}#FZfkFEU%Yr}+mgi{OWPB_
z@CmM(eu5>-;=k|-+NPhN<LcP;;R%wz$O&3!oS?NaT(NlYU?liz@Zm560000000000
z0000000000000000000000000004mh_Ffc^N7_en>HbWyd$^P-45xD~D>rtpXo|%n
z9k*8EEgOc?h0^kTes`GfzBC$-bZ?(5+*-(wWD2Eh*k~YA>@Q?TO4<ByLwMeJ@UBSk
zo!}#31^@s600000000000000000000000000000000000|NS+^+oL17bbqGUJzUBZ
zhSRy0l^eTP#4n9^C%5PGyNA++-M1F<Bbh=en<=&oWQzTT>_{n_AHE>o5xuq2vt>ir
zs<eEvb*!;`-h*fOx&QzG00000000000000000000000000000000000;0$XFe>Dfb
z8VP<U*co&L4dEdG00000000000000000000000000000000000007T7SJs>riAE#y
z>Z8%x+S>S<v97-CcxhGp+FQ0H;*rFWqqp7n!VgX6pIDHnG`_Ub`0UvFOn+v$)SDhG
zp4zl6UTNA^Y1%m1G`DwoKEHb?UD%x&nCjAS(PaLzUyD_`Tvq8aC$>6YEN#jbv!&y0
z@BPmYPv)QA6`d1_CL@QcjpLmI1F7wkr!J;S`BZ6VwwT(H&kbY><zg|D2}7Bo)Ihd4
zl1uN+45aeI<w$Dz@m{_8d~SQXFgeyeZ~W3^{>{d4nG!);B=}TtPw=Yn0000000000
z000000000000000000000000000000o{Q#0;)-jVhVuLRw&(M^hth@J#TkXZY$-F8
z9UjO`bfm)nTH=W-u79THBk4kBxHQ?JJ=Jz~EOEt#XFGo`T`Udd2eLb|nSm2yT@_7S
z(S6=CbR8Vc4)l!<XZMU|CVRCtgqPG1d@>R|75pUlVeq}+yTP}DuLfTTJ{JZ700000
z000000000000000000000000000000007`uPfa`;t!XHyiJEd6Pn6SGJP}VuV~Kbq
znk*;v<)p5h)W+kHWJB1oA?S+)KM#H!{2+KV_*n41;17bkgHjj-000000000000000
z00000000000000000000004krju*z8qeJ=rMd@5FyDvYqXncHpQO#_@#B9O%Y{A%h
z@#f^o!E(dFLViZ9VYXm05syUc%Sl~1sci@+*%16)BzP+LN$|tqd%<^uZv~G9UkW}S
z1_1y700000000000000000000000000000000000;8#;3o{Tn>lVl=ZAFVGZb>*bC
zoYa()L^+9<lUO`npKJ&_H3UZ^!Ow#q2R{h@HTZV$wcv}v=Yqctg8%>k0000000000
z0000000000000000000000000@T;RX9*ag^S5wUr)hu4kVm0wtGOUY7qXP|<G?|Fk
zN9)T;T{)?32v5)ud@vF`75pUlVeq}+yTP}D$AT{fp9+Hj00000000000000000000
z000000000000000008i-VNSd@8c7^EdfUSn9cwsVc<8SE$wWL7tuH5a<)pTp)RdD%
zIf<8(SUes{HiRdM1>cGUKMWH900000000000000000000000000000000000004OY
zIy(`qjW$FQM~>e1@I}XBjbSmFtP~%*Ykx!7AQt>25<C?q00000000000000000000
z0000000000000000002+KT9H>jK<>e`eZ{`hy~w?1pgi;00000000000000000000
z0000000000000000002+{5B_E8;vB69KG$~i;l(4iq|G9g@^9i-w;;L4epNwKMQ^o
z91Ff3JQjQ*_-ydE!O`GI@c!W4!P|oe!fF5j000000000000000000000000000000
z0000005~&h6VYU}{_ILt*I3DF=Tx$qvnpAlp_0Xul`K|YlSqb5Y7>!YG(NYI#p<eA
zO*KnYvv@U&)r46x)({RgH+W+t_<8VT@I>(4;2Xi0gMSD<85|9c1n&>t9lSkwOIQs6
z00000000000000000000000000000000000003t~T_PHd*2T}N=COv_L^K(#ONLo}
zw64BViq}?3@i~<?v3OlIkIk*r#?G$P#u{rA$!IiQQ^{h9nnW_}8Kz-XB2izTYzPON
z8@xOc{3!T#@P*(L!6U)Dg0}?s1c!rSFc54EZVHx$)c^nh00000000000000000000
z000000000000000P;qu5S{tp8B#s=t?Y{HxJiAh?s}>u+(pV|hR*LsNeeaw~v8GzQ
zcH>!<Vxn4{zpbHCj8}{Gi;|UMtWvz^@sHFuCX%($YUz=8)HWs}lcoDEynF79QtU+O
z-k&`fpH^!9aNUX0J>A_kCrYn*!^4R=VJSIPY6!2bVgE-W!54$K2gTs};G6^haNvyx
zF5Z7E3<3ZE00000000000000000000000000000000000{HmEBUl$$8rTa72l=hBf
zu3Iv{m@kyBYg;^jC_S-0Qyk5eir2NZ)-Q^uCz};A1KC2Rzf@eEAIMyHRki)Hnayi&
zPaN7i*?vbpH;^e@w|wo|RjWJKuiDVJx@*nG`IFI&Yi{c9=~~fuymqRhckSAq<(=#2
z?-|V$_V$)%);2k_t7Z;0KQqyv8y(233maxLVWjTb`0df1rP9bXEiL2Y<BNv!`?9%Q
zdQrYG*fLVc?<!BdWk+}kJMt4@AXCWXGU;Mw(azFPuHhB&{m;2?+u}v7>9%sQSSpMT
zw<ODJG)w3H{7_3~xOwA-<2`p~aw9FV_W17S*1UhTSjrD&_hnk*&%IB6XlQgeTiV-_
zXpIjhpIe{IaH){awOkS3@XUjxx93MoEj10{_Gt(<M}jAU$AV7>M}l_-|2ueXus7Hl
z1_1y700000000000000000000000000000000000;Q!A#@p;klzOkJfcaCoC-(K2R
zQx25I@`Jl`t!oB)I@@C9z{r~PhAlm72X}5-v8;Y>d|q<ruA7$@H)XaD4s2RoZjjm5
zx@1jf$EvNp?b&2GkS;83ZQV1ramVgu!*%7rw%%1+x|`cJ<}=w`yd2mvp3N6KmTtbO
zt!H~fIk0(R`L5>Wn^yMpO$^qS16OU|){~vsy}GZr`Nl*;IN7;DED}5sJQjQ=_(1Sr
z@cY4QgT2AdU~_O&&=Fi7oEKID00000000000000000000000000000000000008j3
zcTRj>wA8(FY|}*FRkw8P>YQ5+6mINl-Z-&pq`7@_bFv)R)wkp79c$OE$gk+?Y%B*d
zyYj_M|4^xC@4kt6Ik34{SiCsDeth%Tsx5Wpz@}A8CrY~p_hviRG}o5{>w0e<-O{-;
zvvt=<Hc<|&E$tpHb!5AiZ5kY}sRTBU4ffo!V%L(jYkTLE18c^*`m*DtRqbnU*-~2x
zWb(b)(G|OQZXH^7b|tWFNBh|F&XGcTXymN9@p;Kroy*qkxq9{0Ju6r3D>t}lV&7oT
zV0z1@(QSPV<v{bQ_03nWTU{7Tcib3jC@;amGkgmG0000000000000000000000000
z0000000000007_&YY2Ze!IvY!&w?KY{}OyNJOls$0000000000000000000000000
q0000000000faj6AL^K*bJC>;Ajj?zopA(B!^4fS!O(L31#{VC-XBeIU
new file mode 100644
--- /dev/null
+++ b/toolkit/components/places/tests/migration/test_current_from_v19.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * This file tests migration invariants from schema version 19 to the current
+ * schema version.
+ */
+
+////////////////////////////////////////////////////////////////////////////////
+//// Globals
+
+const kGuidAnnotationName = "placesInternal/GUID";
+
+function getTotalGuidAnnotationsCount(aStorageConnection) {
+  stmt = aStorageConnection.createStatement(
+    "SELECT count(*) "
+  + "FROM moz_items_annos a "
+  + "JOIN moz_anno_attributes b ON a.anno_attribute_id = b.id "
+  + "WHERE b.name = :attr_name"
+  );
+  try {
+    stmt.params.attr_name = kGuidAnnotationName;
+    do_check_true(stmt.executeStep());
+    return stmt.getInt32(0);
+  } finally {
+    stmt.finalize();
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//// Tests
+
+function run_test()
+{
+  setPlacesDatabase("places_v19.sqlite");
+  run_next_test();
+}
+
+add_test(function test_initial_state()
+{
+  let dbFile = gProfD.clone();
+  dbFile.append(kDBName);
+  let db = Services.storage.openUnsharedDatabase(dbFile);
+
+  // There should be an obsolete bookmark GUID annotation.
+  do_check_eq(getTotalGuidAnnotationsCount(db), 1);
+
+  // Check our schema version to make sure it is actually at 19.
+  do_check_eq(db.schemaVersion, 19);
+
+  db.close();
+  run_next_test();
+});
+
+add_test(function test_bookmark_guid_annotation_removed()
+{
+
+  // There should be no obsolete bookmark GUID annotation anymore.
+  do_check_eq(getTotalGuidAnnotationsCount(DBConn()), 0);
+
+  run_next_test();
+});
--- a/toolkit/components/places/tests/migration/xpcshell.ini
+++ b/toolkit/components/places/tests/migration/xpcshell.ini
@@ -1,9 +1,10 @@
 [DEFAULT]
 head = head_migration.js
 tail = 
 
 [test_current_from_v10.js]
 [test_current_from_v10_migrated_from_v14.js]
+[test_current_from_v19.js]
 [test_database_from_alpha.js]
 [test_database_from_v6_no_frecency.js]
 [test_database_from_v6_no_indices.js]
--- a/toolkit/components/places/tests/unit/test_null_interfaces.js
+++ b/toolkit/components/places/tests/unit/test_null_interfaces.js
@@ -49,17 +49,17 @@ let _ = function(some, debug, text, to) 
 
 _("Make an array of services to test, each specifying a class id, interface,",
   "and an array of function names that don't throw when passed nulls");
 let testServices = [
   ["browser/nav-history-service;1", "nsINavHistoryService",
     ["queryStringToQueries", "removePagesByTimeframe", "removePagesFromHost",
      "removeVisitsByTimeframe"]],
   ["browser/nav-bookmarks-service;1","nsINavBookmarksService",
-    ["createFolder", "getItemIdForGUID"]],
+    ["createFolder"]],
   ["browser/livemark-service;2","nsILivemarkService", []],
   ["browser/livemark-service;2","mozIAsyncLivemarks", ["reloadLivemarks"]],
   ["browser/annotation-service;1","nsIAnnotationService", []],
   ["browser/favicon-service;1","nsIFaviconService", []],
   ["browser/tagging-service;1","nsITaggingService", []],
 ];
 _(testServices.join("\n"));
 
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance.js
+++ b/toolkit/components/places/tests/unit/test_preventive_maintenance.js
@@ -104,16 +104,109 @@ function addBookmark(aPlaceId, aType, aP
 // Tests
 
 let tests = [];
 let current_test = null;
 
 //------------------------------------------------------------------------------
 
 tests.push({
+  name: "A.1",
+  desc: "Remove obsolete annotations from moz_annos",
+
+  _obsoleteWeaveAttribute: "weave/test",
+  _placeId: null,
+
+  setup: function() {
+    // Add a place to ensure place_id = 1 is valid.
+    this._placeId = addPlace();
+    // Add an obsolete attribute.
+    let stmt = mDBConn.createStatement(
+      "INSERT INTO moz_anno_attributes (name) VALUES (:anno)"
+    );
+    stmt.params['anno'] = this._obsoleteWeaveAttribute;
+    stmt.execute();
+    stmt.finalize();
+    stmt = mDBConn.createStatement(
+      "INSERT INTO moz_annos (place_id, anno_attribute_id) "
+    + "VALUES (:place_id, "
+    +   "(SELECT id FROM moz_anno_attributes WHERE name = :anno)"
+    + ")"
+    );
+    stmt.params['place_id'] = this._placeId;
+    stmt.params['anno'] = this._obsoleteWeaveAttribute;
+    stmt.execute();
+    stmt.finalize();
+  },
+
+  check: function() {
+    // Check that the obsolete annotation has been removed.
+    let stmt = mDBConn.createStatement(
+      "SELECT id FROM moz_anno_attributes WHERE name = :anno"
+    );
+    stmt.params['anno'] = this._obsoleteWeaveAttribute;
+    do_check_false(stmt.executeStep());
+    stmt.finalize();
+  }
+});
+
+tests.push({
+  name: "A.2",
+  desc: "Remove obsolete annotations from moz_items_annos",
+
+  _obsoleteSyncAttribute: "sync/children",
+  _obsoleteGuidAttribute: "placesInternal/GUID",
+  _obsoleteWeaveAttribute: "weave/test",
+  _placeId: null,
+  _bookmarkId: null,
+
+  setup: function() {
+    // Add a place to ensure place_id = 1 is valid.
+    this._placeId = addPlace();
+    // Add a bookmark.
+    this._bookmarkId = addBookmark(this._placeId);
+    // Add an obsolete attribute.
+    let stmt = mDBConn.createStatement(
+      "INSERT INTO moz_anno_attributes (name) "
+    + "VALUES (:anno1), (:anno2), (:anno3)"
+    );
+    stmt.params['anno1'] = this._obsoleteSyncAttribute;
+    stmt.params['anno2'] = this._obsoleteGuidAttribute;
+    stmt.params['anno3'] = this._obsoleteWeaveAttribute;
+    stmt.execute();
+    stmt.finalize();
+    stmt = mDBConn.createStatement(
+      "INSERT INTO moz_items_annos (item_id, anno_attribute_id) "
+    + "SELECT :item_id, id "
+    + "FROM moz_anno_attributes "
+    + "WHERE name IN (:anno1, :anno2, :anno3)"
+    );
+    stmt.params['item_id'] = this._bookmarkId;
+    stmt.params['anno1'] = this._obsoleteSyncAttribute;
+    stmt.params['anno2'] = this._obsoleteGuidAttribute;
+    stmt.params['anno3'] = this._obsoleteWeaveAttribute;
+    stmt.execute();
+    stmt.finalize();
+  },
+
+  check: function() {
+    // Check that the obsolete annotations have been removed.
+    let stmt = mDBConn.createStatement(
+      "SELECT id FROM moz_anno_attributes "
+    + "WHERE name IN (:anno1, :anno2, :anno3)"
+    );
+    stmt.params['anno1'] = this._obsoleteSyncAttribute;
+    stmt.params['anno2'] = this._obsoleteGuidAttribute;
+    stmt.params['anno3'] = this._obsoleteWeaveAttribute;
+    do_check_false(stmt.executeStep());
+    stmt.finalize();
+  }
+});
+
+tests.push({
   name: "A.3",
   desc: "Remove unused attributes",
 
   _usedPageAttribute: "usedPage",
   _usedItemAttribute: "usedItem",
   _unusedAttribute: "unused",
   _placeId: null,
   _bookmarkId: null,
deleted file mode 100644
--- a/toolkit/components/places/tests/unit/test_txnGUIDs.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *  vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Marco Bonardo <mak77@bonardo.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * This test will ensure any transactions service that is going to create
- * a new item, won't replace the GUID when undoing and redoing the action.
- */
-
-function test_GUID_persistance(aTxn) {
-  aTxn.doTransaction();
-  waitForAsyncUpdates(function () {
-    let itemId = PlacesUtils.bookmarks
-                            .getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
-    let GUID = PlacesUtils.bookmarks.getItemGUID(itemId);
-    aTxn.undoTransaction();
-    aTxn.redoTransaction();
-    waitForAsyncUpdates(function() {
-      let itemId = PlacesUtils.bookmarks
-                              .getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
-      do_check_eq(GUID, PlacesUtils.bookmarks.getItemGUID(itemId));
-      aTxn.undoTransaction();
-      waitForAsyncUpdates(run_next_test);
-    });
-  });
-}
-
-function run_test() {
-  run_next_test();
-}
-
-add_test(function create_folder() {
-  let createFolderTxn = new PlacesCreateFolderTransaction(
-    "Test folder", PlacesUtils.unfiledBookmarksFolderId,
-    PlacesUtils.bookmarks.DEFAULT_INDEX
-  );
-  test_GUID_persistance(createFolderTxn);
-});
-
-add_test(function create_bookmark() {
-  let createBookmarkTxn = new PlacesCreateBookmarkTransaction(
-    NetUtil.newURI("http://www.example.com"), PlacesUtils.unfiledBookmarksFolderId,
-    PlacesUtils.bookmarks.DEFAULT_INDEX, "Test bookmark"
-  );
-  test_GUID_persistance(createBookmarkTxn);
-});
-  
-add_test(function create_separator() {
-  let createSeparatorTxn = new PlacesCreateSeparatorTransaction(
-    PlacesUtils.unfiledBookmarksFolderId, PlacesUtils.bookmarks.DEFAULT_INDEX
-  );
-  test_GUID_persistance(createSeparatorTxn);
-});
-
-add_test(function tag_uri() {
-  let tagURITxn = new PlacesTagURITransaction(
-    NetUtil.newURI("http://www.example.com"), ["foo"]
-  );
-  test_GUID_persistance(tagURITxn);
-});
-
-add_test(function create_livemark() {
-  let createLivemarkTxn = new PlacesCreateLivemarkTransaction(
-    NetUtil.newURI("http://feeduri.com"), NetUtil.newURI("http://siteuri.com"),
-    "Test livemark", PlacesUtils.unfiledBookmarksFolderId,
-    PlacesUtils.bookmarks.DEFAULT_INDEX
-  );
-  test_GUID_persistance(createLivemarkTxn);
-});
-
--- a/toolkit/components/places/tests/unit/xpcshell.ini
+++ b/toolkit/components/places/tests/unit/xpcshell.ini
@@ -111,10 +111,9 @@ skip-if = os == "android"
 # Bug 676989: test hangs consistently on Android
 skip-if = os == "android"
 [test_utils_backups_create.js]
 [test_utils_getURLsForContainerNode.js]
 [test_utils_setAnnotationsFor.js]
 [test_PlacesUtils_asyncGetBookmarkIds.js]
 [test_PlacesUtils_lazyobservers.js]
 [test_placesTxn.js]
-[test_txnGUIDs.js]
 [test_telemetry.js]