Bug 1450210 - Remove remaining references to the POST data anno. r=standard8
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 30 Mar 2018 12:33:02 +0200
changeset 411478 71a2b7a1f6c32379c846f72edda499f809a4d393
parent 411477 8a2ba99f199af716f00b8fe7a415758d7569ffb8
child 411479 78f7dd029128266ba05048e87d00a9a791e670a8
push id62068
push usermak77@bonardo.net
push dateTue, 03 Apr 2018 15:03:05 +0000
treeherderautoland@71a2b7a1f6c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs1450210
milestone61.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 1450210 - Remove remaining references to the POST data anno. r=standard8 MozReview-Commit-ID: 5AOMj1VBgT7
toolkit/components/places/Bookmarks.jsm
toolkit/components/places/PlacesUtils.jsm
toolkit/components/places/tests/unit/bookmarks.json
--- a/toolkit/components/places/Bookmarks.jsm
+++ b/toolkit/components/places/Bookmarks.jsm
@@ -1652,27 +1652,21 @@ async function handleBookmarkItemSpecial
     // value for the bookmark, to avoid a second update of the added bookmark.
     try {
       PlacesUtils.setAnnotationsForItem(itemId, item.annos, item.source, true);
     } catch (ex) {
       Cu.reportError(`Failed to insert annotations for item: ${ex}`);
     }
   }
   if ("keyword" in item && item.keyword) {
-    // POST data could be set in 2 ways:
-    // 1. new backups have a postData property
-    // 2. old backups have an item annotation
-    let postDataAnno = item.annos &&
-                       item.annos.find(anno => anno.name == PlacesUtils.POST_DATA_ANNO);
-    let postData = item.postData || (postDataAnno && postDataAnno.value);
     try {
       await PlacesUtils.keywords.insert({
         keyword: item.keyword,
         url: item.url,
-        postData,
+        postData: item.postData,
         source: item.source
       });
     } catch (ex) {
       Cu.reportError(`Failed to insert keyword "${item.keyword} for ${item.url}": ${ex}`);
     }
   }
   if ("tags" in item) {
     try {
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -349,17 +349,16 @@ var PlacesUtils = {
   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",
 
   LMANNO_FEEDURI: "livemark/feedURI",
   LMANNO_SITEURI: "livemark/siteURI",
-  POST_DATA_ANNO: "bookmarkProperties/POSTData",
   READ_ONLY_ANNO: "placesInternal/READ_ONLY",
   CHARSET_ANNO: "URIProperties/characterSet",
   // Deprecated: This is only used for supporting import from older datasets.
   MOBILE_ROOT_ANNO: "mobile/bookmarksRoot",
 
   TOPIC_SHUTDOWN: "places-shutdown",
   TOPIC_INIT_COMPLETE: "places-init-complete",
   TOPIC_DATABASE_LOCKED: "places-database-locked",
--- a/toolkit/components/places/tests/unit/bookmarks.json
+++ b/toolkit/components/places/tests/unit/bookmarks.json
@@ -137,36 +137,29 @@
                   "name": "bookmarkProperties/description",
                   "flags": 0,
                   "expires": 4,
                   "mimeType": null,
                   "type": 3,
                   "value": "item description"
                 },
                 {
-                  "name": "bookmarkProperties/POSTData",
-                  "flags": 0,
-                  "expires": 4,
-                  "mimeType": null,
-                  "type": 3,
-                  "value": "hidden1%3Dbar&text1%3D%25s"
-                },
-                {
                   "name": "bookmarkProperties/loadInSidebar",
                   "flags": 0,
                   "expires": 4,
                   "mimeType": null,
                   "type": 1,
                   "value": 1
                 }
               ],
               "type": "text/x-moz-place",
               "uri": "http://test/post",
               "keyword": "test",
-              "charset": "ISO-8859-1"
+              "charset": "ISO-8859-1",
+              "postData": "hidden1%3Dbar&text1%3D%25s"
             }
           ]
         }
       ]
     },
     {
       "index": 1,
       "title": "Bookmarks Toolbar",