Bug 454500 - remove placesMigrationTasks from browser-places.js, r=dietrich
authorMarco Bonardo <mak77@bonardo.net>
Thu, 11 Sep 2008 16:53:33 +0200
changeset 19161 d817abc874f96fefc4b9003c1ff5b4c4172e1ba0
parent 19160 ffc759affe2336c0fa18700b11d420f339c1010d
child 19162 28930bd6e6bdf8ee432bb298198a203d536ace86
push id1984
push usermak77@bonardo.net
push dateThu, 11 Sep 2008 14:55:35 +0000
treeherderautoland@d817abc874f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich
bugs454500
milestone1.9.1b1pre
Bug 454500 - remove placesMigrationTasks from browser-places.js, r=dietrich
browser/app/profile/firefox.js
browser/base/content/browser-places.js
browser/base/content/browser.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -690,25 +690,16 @@ pref("browser.sessionstore.postdata", 0)
 // 0 = everywhere, 1 = unencrypted sites, 2 = nowhere
 pref("browser.sessionstore.privacy_level", 1);
 // how many tabs can be reopened (per window)
 pref("browser.sessionstore.max_tabs_undo", 10);
 
 // allow META refresh by default
 pref("accessibility.blockautorefresh", false);
 
-// If true, will migrate uri post-data annotations to
-// bookmark post-data annotations (bug 398914)
-// XXX to be removed after beta 2 (bug 391419)
-pref("browser.places.migratePostDataAnnotations", true);
-
-// If true, will update the Smart Bookmarks uri for
-// recent tags (bug 385245). Useful just for FX3 beta users.
-pref("browser.places.updateRecentTagsUri", true);
-
 // the (maximum) number of the recent visits to sample
 // when calculating frecency
 pref("places.frecency.numVisits", 10);
 
 // Number of records to update frecency for when idle.
 pref("places.frecency.numCalcOnIdle", 50);
 
 // Number of records to update frecency for when migrating from
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1004,67 +1004,8 @@ var PlacesStarButton = {
                                             aIsAnnotationProperty, aValue) {
     if (!this._batching && aProperty == "uri")
       this.updateState();
   },
 
   onItemVisited: function() { },
   onItemMoved: function() { }
 };
-
-/**
- * Various migration tasks.
- */
-function placesMigrationTasks() {
-  // bug 398914 - move all post-data annotations from URIs to bookmarks
-  // XXX - REMOVE ME FOR BETA 3 (bug 391419)
-  if (gPrefService.getBoolPref("browser.places.migratePostDataAnnotations")) {
-    const annosvc = PlacesUtils.annotations;
-    var bmsvc = PlacesUtils.bookmarks;
-    const oldPostDataAnno = "URIProperties/POSTData";
-    var pages = annosvc.getPagesWithAnnotation(oldPostDataAnno, {});
-    for (let i = 0; i < pages.length; i++) {
-      try {
-        let uri = pages[i];
-        var postData = annosvc.getPageAnnotation(uri, oldPostDataAnno);
-        // We can't know which URI+keyword combo this postdata was for, but
-        // it's very likely that if this URI is bookmarked and has a keyword
-        // *and* the URI has postdata, then this bookmark was using the
-        // postdata. Propagate the annotation to all bookmarks for this URI
-        // just to be safe.
-        let bookmarks = bmsvc.getBookmarkIdsForURI(uri, {});
-        for (let i = 0; i < bookmarks.length; i++) {
-          var keyword = bmsvc.getKeywordForBookmark(bookmarks[i]);
-          if (keyword)
-            annosvc.setItemAnnotation(bookmarks[i], POST_DATA_ANNO, postData, 0, annosvc.EXPIRE_NEVER); 
-        }
-        // Remove the old annotation.
-        annosvc.removePageAnnotation(uri, oldPostDataAnno);
-      } catch(ex) {}
-    }
-    gPrefService.setBoolPref("browser.places.migratePostDataAnnotations", false);
-  }
-
-  if (gPrefService.getBoolPref("browser.places.updateRecentTagsUri")) {
-    var oldUriSpec = "place:folder=TAGS&group=3&queryType=1" +
-                     "&applyOptionsToContainers=1&sort=12&maxResults=10";
-
-    var maxResults = 10;
-    var newUriSpec = "place:type=" + 
-                     Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY +
-                     "&sort=" + 
-                     Ci.nsINavHistoryQueryOptions.SORT_BY_LASTMODIFIED_DESCENDING +
-                     "&maxResults=" + maxResults;
-                     
-    var ios = Cc["@mozilla.org/network/io-service;1"].
-              getService(Ci.nsIIOService);
-
-    var oldUri = ios.newURI(oldUriSpec, null, null);
-    var newUri = ios.newURI(newUriSpec, null, null);
-
-    let bmsvc = PlacesUtils.bookmarks;
-    let bookmarks = bmsvc.getBookmarkIdsForURI( oldUri, {});
-    for (let i = 0; i < bookmarks.length; i++) {
-      bmsvc.changeBookmarkURI( bookmarks[i], newUri);
-    }
-    gPrefService.setBoolPref("browser.places.updateRecentTagsUri", false);
-  }
-}
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -981,20 +981,16 @@ function delayedStartup(isLoadingBlank, 
   if (mustLoadSidebar) {
     let sidebar = document.getElementById("sidebar");
     let sidebarBox = document.getElementById("sidebar-box");
     sidebar.setAttribute("src", sidebarBox.getAttribute("src"));
   }
 
   UpdateUrlbarSearchSplitterState();
   
-  try {
-    placesMigrationTasks();
-  } catch(ex) {}
-
   PlacesStarButton.init();
 
   // called when we go into full screen, even if it is
   // initiated by a web page script
   window.addEventListener("fullscreen", onFullScreen, true);
 
   if (isLoadingBlank && gURLBar && isElementVisible(gURLBar))
     focusElement(gURLBar);