Browse Source

backports and plcaces updates

Frank-Rainer Grahl 1 week ago
parent
commit
db0ade6feb

+ 0 - 31
comm-release/patches/1913633-mar-addendum-ids-25320.patch

@@ -1,31 +0,0 @@
-# HG changeset patch
-# User Frank-Rainer Grahl <frgrahl@gmx.net>
-# Date 1728561523 -7200
-# Parent  93db87609b26673ee7b2ccb341c3ccb53f398045
-Bug 1913633 - Add new channel ids. r=IanN a=IanN
-
-diff --git a/suite/moz.configure b/suite/moz.configure
---- a/suite/moz.configure
-+++ b/suite/moz.configure
-@@ -35,16 +35,21 @@ def comm_paths(build_env, _):
-                      commtopobjdir=commtopobjdir)
- 
- @template
- def set_defconf(k,v):
-     set_config(k,v)
-     set_define(k,v)
-     add_old_configure_assignment(k,v)
- 
-+set_defconf("MAR_CHANNEL_ID", "seamonkey-comm-release")
-+
-+set_defconf("ACCEPTED_MAR_CHANNEL_IDS",
-+            "seamonkey-comm-release,seamonkey-comm-central")
-+
- set_defconf('moztopsrcdir', comm_paths.moztopsrcdir)
- set_defconf('commtopsrcdir', comm_paths.commtopsrcdir)
- set_defconf('mozreltopsrcdir', comm_paths.mozreltopsrcdir)
- set_defconf('commreltopsrcdir', comm_paths.commreltopsrcdir)
- set_defconf('commtopobjdir', comm_paths.commtopobjdir)
- 
- @depends(check_build_environment, application)
- @imports(_from='os.path', _import='exists')

+ 26 - 1
comm-release/patches/1913633-mar-channel-ids-25320.patch → comm-release/patches/1913633-mar-channel-ids-1_1-25320.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # User Ian Neal <iann_cvs@blueyonder.co.uk>
 # Date 1723992023 -3600
-# Parent  4a1cabe28b81d08f86e743177ba276dfacafa5dc
+# Parent  cd63776d97720681ff111199dcbf0e150d99b33c
 Bug 1913633 - Port bug 1458385 - Update SeaMonkey's confvars.sh. r=frg a=frg
 
 diff --git a/suite/confvars.sh b/suite/confvars.sh
@@ -30,3 +30,28 @@ diff --git a/suite/confvars.sh b/suite/confvars.sh
  MOZ_DEVTOOLS=all
  
  NSS_EXTRA_SYMBOLS_FILE=../comm/mailnews/nss-extra.symbols
+diff --git a/suite/moz.configure b/suite/moz.configure
+--- a/suite/moz.configure
++++ b/suite/moz.configure
+@@ -33,16 +33,21 @@ def comm_paths(build_env, _):
+                      commtopobjdir=commtopobjdir)
+ 
+ @template
+ def set_defconf(k,v):
+     set_config(k,v)
+     set_define(k,v)
+     add_old_configure_assignment(k,v)
+ 
++set_defconf("MAR_CHANNEL_ID", "seamonkey-comm-release")
++
++set_defconf("ACCEPTED_MAR_CHANNEL_IDS",
++            "seamonkey-comm-release,seamonkey-comm-central")
++
+ set_defconf('moztopsrcdir', comm_paths.moztopsrcdir)
+ set_defconf('commtopsrcdir', comm_paths.commtopsrcdir)
+ set_defconf('mozreltopsrcdir', comm_paths.mozreltopsrcdir)
+ set_defconf('commreltopsrcdir', comm_paths.commreltopsrcdir)
+ set_defconf('commtopobjdir', comm_paths.commtopobjdir)
+ 
+ @depends(check_build_environment, application)
+ @imports(_from='os.path', _import='exists')

+ 41 - 0
comm-release/patches/9999999-focus-25320.patch

@@ -0,0 +1,41 @@
+# HG changeset patch
+# User Frank-Rainer Grahl <frgrahl@gmx.net>
+# Date 1728593214 -7200
+# Parent  1aea0bb1f37deeef853d7307272702b70a083e32
+Bug 9999999 - Use Services.focus for bookmarking from mailnews. r=IanN a=IanN
+
+diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places/PlacesUIUtils.jsm
+--- a/suite/components/places/PlacesUIUtils.jsm
++++ b/suite/components/places/PlacesUIUtils.jsm
+@@ -1452,17 +1452,17 @@ var PlacesUIUtils = {
+         info.postData = aPostData;
+       if (typeof(aCharSet) == "string")
+         info.charSet = aCharSet;
+     }
+     else
+       info.hiddenRows.push("keyword");
+ 
+     return this.showBookmarkDialog(info,
+-                                   focusManager.activeWindow ||
++                                   Services.focus.activeWindow ||
+                                    Services.wm.getMostRecentWindow(null));
+   },
+ 
+   /**
+    * Helpers for consumers of editBookmarkOverlay which don't have a node as their input.
+    *
+    * Given a bookmark object for either a url bookmark or a folder, returned by
+    * Bookmarks.fetch (see Bookmark.jsm), this creates a node-like object suitable for
+@@ -1571,12 +1571,8 @@ PlacesUIUtils.URI_FLAVORS = [PlacesUtils
+ 
+ PlacesUIUtils.SUPPORTED_FLAVORS = [...PlacesUIUtils.PLACES_FLAVORS,
+                                    ...PlacesUIUtils.URI_FLAVORS];
+ 
+ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ellipsis", function() {
+   return Services.prefs.getComplexValue("intl.ellipsis",
+                                         Ci.nsIPrefLocalizedString).data;
+ });
+-
+-XPCOMUtils.defineLazyServiceGetter(this, "focusManager",
+-                                   "@mozilla.org/focus-manager;1",
+-                                   "nsIFocusManager");

+ 387 - 37
comm-release/patches/TOP-1378089-4-WIP-bookmarks-25320.patch

@@ -622,9 +622,37 @@ diff --git a/suite/browser/navigatorOverlay.xul b/suite/browser/navigatorOverlay
 diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places/PlacesUIUtils.jsm
 --- a/suite/components/places/PlacesUIUtils.jsm
 +++ b/suite/components/places/PlacesUIUtils.jsm
-@@ -24,16 +24,18 @@ XPCOMUtils.defineLazyModuleGetters(this,
- // ChromeUtils.defineModuleGetter(this, "Weave",
- //   "resource://services-sync/main.js");
+@@ -3,37 +3,42 @@
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ var EXPORTED_SYMBOLS = ["PlacesUIUtils"];
+ 
+ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ ChromeUtils.import("resource://gre/modules/Services.jsm");
+ ChromeUtils.import("resource://gre/modules/Timer.jsm");
+-// PlacesUtils exposes multiple symbols, so we can't use defineLazyModuleGetter.
++
++// PlacesUtils exposes multiple symbols, so we can't use defineLazyModuleGetter
++// until we remove legacy transactions (Bug 1131491).
+ ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+ 
+ XPCOMUtils.defineLazyModuleGetters(this, {
+   OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
+   PluralForm: "resource://gre/modules/PluralForm.jsm",
+-  NetUtil: "resource://gre/modules/NetUtil.jsm",
+   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
+   RecentWindow: "resource:///modules/RecentWindow.jsm",
+   PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
+   PlacesTransactions: "resource://gre/modules/PlacesTransactions.jsm",
++  // Weave: "resource://services-sync/main.js",
+ });
+ 
+-// ChromeUtils.defineModuleGetter(this, "Weave",
+-//   "resource://services-sync/main.js");
++XPCOMUtils.defineLazyGetter(this, "bundle", function() {
++  return Services.strings.createBundle("chrome://communicator/locale/places/places.properties");
++});
  
  const gInContentProcess = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
  const FAVICON_REQUEST_TIMEOUT = 60 * 1000;
@@ -641,7 +669,7 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
  function IsLivemark(aItemId) {
    // Since this check may be done on each dragover event, it's worth maintaining
    // a cache.
-@@ -250,17 +252,17 @@ var PlacesUIUtils = {
+@@ -250,17 +255,17 @@ var PlacesUIUtils = {
  
    /**
     * Makes a URI from a spec, and do fixup
@@ -660,7 +688,7 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
  
    /**
     * Get a localized plural string for the specified key name and numeric value
-@@ -332,17 +334,17 @@ var PlacesUIUtils = {
+@@ -332,17 +337,17 @@ var PlacesUIUtils = {
      let annos = [];
      if (aData.annos) {
        annos = aData.annos.filter(function(aAnno) {
@@ -679,7 +707,26 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
     * Gets a transaction for copying (recursively nesting to include children)
     * a folder (or container) and its contents from one folder to another.
     *
-@@ -470,19 +472,19 @@ var PlacesUIUtils = {
+@@ -406,17 +411,17 @@ var PlacesUIUtils = {
+     if (aContainer == PlacesUtils.tagsFolderId) { // Copying into a tag folder.
+       let transactions = [];
+       if (!aData.livemark && aData.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) {
+         let {root} = PlacesUtils.getFolderContents(aData.id, false, false);
+         let urls = PlacesUtils.getURLsForContainerNode(root);
+         root.containerOpen = false;
+         for (let { uri } of urls) {
+           transactions.push(
+-            new PlacesTagURITransaction(NetUtil.newURI(uri), [aData.title])
++            new PlacesTagURITransaction(Services.io.newURI(uri), [aData.title])
+           );
+         }
+       }
+       return new PlacesAggregatedTransaction("addTags", transactions);
+     }
+ 
+     if (aData.livemark && aData.annos) { // Copying a livemark.
+       return this._getLivemarkCopyTransaction(aData, aContainer, aIndex);
+@@ -470,19 +475,19 @@ var PlacesUIUtils = {
        throw new Error("node is not a livemark");
      }
  
@@ -701,7 +748,7 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
      return new PlacesCreateLivemarkTransaction(feedURI, siteURI, aData.title,
                                                 aContainer, aIndex, annos);
    },
-@@ -530,17 +532,17 @@ var PlacesUIUtils = {
+@@ -530,17 +535,17 @@ var PlacesUIUtils = {
          // Otherwise move the item.
          return new PlacesMoveItemTransaction(data.id, container, index);
        default:
@@ -720,7 +767,7 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
  
    /**
     * ********* PlacesTransactions version of the function defined above ********
-@@ -623,36 +625,32 @@ var PlacesUIUtils = {
+@@ -623,45 +628,37 @@ var PlacesUIUtils = {
                      "chrome://communicator/content/places/bookmarkProperties2.xul" :
                      "chrome://communicator/content/places/bookmarkProperties.xul";
  
@@ -764,10 +811,19 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
      return performed;
    },
  
-   _getTopBrowserWin: function PUIU__getTopBrowserWin() {
-     return RecentWindow.getMostRecentBrowserWindow();
-   },
-@@ -743,17 +741,17 @@ var PlacesUIUtils = {
+-  _getTopBrowserWin: function PUIU__getTopBrowserWin() {
+-    return RecentWindow.getMostRecentBrowserWindow();
+-  },
+-
+   /**
+    * set and fetch a favicon. Can only be used from the parent process.
+    * @param browser   {Browser}   The XUL browser element for which we're fetching a favicon.
+    * @param principal {Principal} The loading principal to use for the fetch.
+    * @param uri       {URI}       The URI to fetch.
+    */
+   loadFavicon(browser, principal, uri) {
+     if (gInContentProcess) {
+@@ -743,23 +740,22 @@ var PlacesUIUtils = {
     *        a window on which a potential error alert is shown on.
     * @return true if it's safe to open the node in the browser, false otherwise.
     *
@@ -780,13 +836,81 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
 +    var uri = Services.io.newURI(aURINode.uri);
      if (uri.schemeIs("javascript") || uri.schemeIs("data")) {
        const BRANDING_BUNDLE_URI = "chrome://branding/locale/brand.properties";
-       var brandShortName = Cc["@mozilla.org/intl/stringbundle;1"].
-                            getService(Ci.nsIStringBundleService).
-                            createBundle(BRANDING_BUNDLE_URI).
-                            GetStringFromName("brandShortName");
+-      var brandShortName = Cc["@mozilla.org/intl/stringbundle;1"].
+-                           getService(Ci.nsIStringBundleService).
+-                           createBundle(BRANDING_BUNDLE_URI).
+-                           GetStringFromName("brandShortName");
++      var brandShortName = Services.strings
++                                   .createBundle(BRANDING_BUNDLE_URI)
++                                   .GetStringFromName("brandShortName");
  
        var errorStr = this.getString("load-js-data-url-error");
-@@ -1063,19 +1061,19 @@ var PlacesUIUtils = {
+       Services.prompt.alert(aWindow, brandShortName, errorStr);
+       return false;
+     }
+     return true;
+   },
+ 
+@@ -889,17 +885,17 @@ var PlacesUIUtils = {
+     if (!aItemsToOpen.length)
+       return;
+ 
+     // Prefer the caller window if it's a browser window, otherwise use
+     // the top browser window.
+     var browserWindow = null;
+     browserWindow =
+       aWindow && aWindow.document.documentElement.getAttribute("windowtype") == "navigator:browser" ?
+-      aWindow : this._getTopBrowserWin();
++      aWindow : RecentWindow.getMostRecentBrowserWindow();
+ 
+     var urls = [];
+     let skipMarking = browserWindow && PrivateBrowsingUtils.isWindowPrivate(browserWindow);
+     for (let item of aItemsToOpen) {
+       urls.push(item.uri);
+       if (skipMarking) {
+         continue;
+       }
+@@ -912,18 +908,18 @@ var PlacesUIUtils = {
+ 
+     // whereToOpenLink doesn't return "window" when there's no browser window
+     // open (Bug 630255).
+     var where = browserWindow ?
+                 browserWindow.whereToOpenLink(aEvent, false, true) : "window";
+     if (where == "window") {
+       // There is no browser window open, thus open a new one.
+       var uriList = PlacesUtils.toISupportsString(urls.join("|"));
+-      var args = Cc["@mozilla.org/array;1"].
+-                  createInstance(Ci.nsIMutableArray);
++      var args = Cc["@mozilla.org/array;1"]
++                   .createInstance(Ci.nsIMutableArray);
+       args.appendElement(uriList);
+       browserWindow = Services.ww.openWindow(aWindow,
+                                              AppConstants.BROWSER_CHROME_URL,
+                                              null, "chrome,dialog=no,all", args);
+       return;
+     }
+ 
+     var loadInBackground = where == "tabshifted";
+@@ -1028,17 +1024,17 @@ var PlacesUIUtils = {
+       }
+ 
+       // Check whether the node is a bookmark which should be opened as
+       // a web panel
+       // Currently not supported in SeaMonkey. Please stay tuned.
+       // if (aWhere == "current" && isBookmark) {
+       //   if (PlacesUtils.annotations
+       //                  .itemHasAnnotation(aNode.itemId, this.LOAD_IN_SIDEBAR_ANNO)) {
+-      //     let browserWin = this._getTopBrowserWin();
++      //     let browserWin = RecentWindow.getMostRecentBrowserWindow();
+       //     if (browserWin) {
+       //       browserWin.openWebPanel(aNode.title, aNode.uri);
+       //       return;
+       //     }
+       //   }
+       // }
+ 
+       aWindow.openUILinkIn(aNode.uri, aWhere, {
+@@ -1063,19 +1059,19 @@ var PlacesUIUtils = {
    guessUrlSchemeForUI: function PUIU_guessUrlSchemeForUI(aUrlString) {
      return aUrlString.substr(0, aUrlString.indexOf(":"));
    },
@@ -808,7 +932,7 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
          } else {
            title = host + (fileName ?
                             (host ? "/" + this.ellipsis + "/" : "") + fileName :
-@@ -1246,17 +1244,17 @@ var PlacesUIUtils = {
+@@ -1246,17 +1242,17 @@ var PlacesUIUtils = {
        }
      }
  
@@ -827,7 +951,7 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
          // We should never backup this, since it changes between profiles.
          as.setItemAnnotation(itemId, PlacesUtils.EXCLUDE_FROM_BACKUP_ANNO, 1,
                               0, as.EXPIRE_NEVER);
-@@ -1521,17 +1519,51 @@ var PlacesUIUtils = {
+@@ -1521,219 +1517,65 @@ var PlacesUIUtils = {
     *
     * @see promiseNodeLikeFromFetchInfo above and Bookmarks.fetch in Bookmarks.jsm.
     */
@@ -880,10 +1004,16 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
                                  PlacesUtils.TYPE_X_MOZ_PLACE];
  
  PlacesUIUtils.URI_FLAVORS = [PlacesUtils.TYPE_X_MOZ_URL,
-@@ -1545,27 +1577,16 @@ XPCOMUtils.defineLazyServiceGetter(Place
-                                    "@mozilla.org/rdf/rdf-service;1",
-                                    "nsIRDFService");
+                              TAB_DROP_TYPE,
+                              PlacesUtils.TYPE_UNICODE],
  
+ PlacesUIUtils.SUPPORTED_FLAVORS = [...PlacesUIUtils.PLACES_FLAVORS,
+                                    ...PlacesUIUtils.URI_FLAVORS];
+ 
+-XPCOMUtils.defineLazyServiceGetter(PlacesUIUtils, "RDF",
+-                                   "@mozilla.org/rdf/rdf-service;1",
+-                                   "nsIRDFService");
+-
  XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ellipsis", function() {
    return Services.prefs.getComplexValue("intl.ellipsis",
                                          Ci.nsIPrefLocalizedString).data;
@@ -900,14 +1030,182 @@ diff --git a/suite/components/places/PlacesUIUtils.jsm b/suite/components/places
 -                                   "@mozilla.org/docshell/urifixup;1",
 -                                   "nsIURIFixup");
 -
- XPCOMUtils.defineLazyGetter(this, "bundle", function() {
-   const PLACES_STRING_BUNDLE_URI =
-     "chrome://communicator/locale/places/places.properties";
-   return Cc["@mozilla.org/intl/stringbundle;1"].
-          getService(Ci.nsIStringBundleService).
-          createBundle(PLACES_STRING_BUNDLE_URI);
- });
- 
+-XPCOMUtils.defineLazyGetter(this, "bundle", function() {
+-  const PLACES_STRING_BUNDLE_URI =
+-    "chrome://communicator/locale/places/places.properties";
+-  return Cc["@mozilla.org/intl/stringbundle;1"].
+-         getService(Ci.nsIStringBundleService).
+-         createBundle(PLACES_STRING_BUNDLE_URI);
+-});
+-
+ XPCOMUtils.defineLazyServiceGetter(this, "focusManager",
+                                    "@mozilla.org/focus-manager;1",
+                                    "nsIFocusManager");
+-/**
+- * This is a compatibility shim for old PUIU.ptm users.
+- *
+- * If you're looking for transactions and writing new code using them, directly
+- * use the transactions objects exported by the PlacesUtils.jsm module.
+- *
+- * This object will be removed once enough users are converted to the new API.
+- */
+-XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() {
+-  // Ensure PlacesUtils is imported in scope.
+-  PlacesUtils;
+-
+-  return {
+-    aggregateTransactions: (aName, aTransactions) =>
+-      new PlacesAggregatedTransaction(aName, aTransactions),
+-
+-    createFolder: (aName, aContainer, aIndex, aAnnotations,
+-                   aChildItemsTransactions) =>
+-      new PlacesCreateFolderTransaction(aName, aContainer, aIndex, aAnnotations,
+-                                        aChildItemsTransactions),
+-
+-    createItem: (aURI, aContainer, aIndex, aTitle, aKeyword,
+-                 aAnnotations, aChildTransactions) =>
+-      new PlacesCreateBookmarkTransaction(aURI, aContainer, aIndex, aTitle,
+-                                          aKeyword, aAnnotations,
+-                                          aChildTransactions),
+-
+-    createSeparator: (aContainer, aIndex) =>
+-      new PlacesCreateSeparatorTransaction(aContainer, aIndex),
+-
+-    createLivemark: (aFeedURI, aSiteURI, aName, aContainer, aIndex,
+-                     aAnnotations) =>
+-      new PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aName, aContainer,
+-                                          aIndex, aAnnotations),
+-
+-    moveItem: (aItemId, aNewContainer, aNewIndex) =>
+-      new PlacesMoveItemTransaction(aItemId, aNewContainer, aNewIndex),
+-
+-    removeItem: (aItemId) =>
+-      new PlacesRemoveItemTransaction(aItemId),
+-
+-    editItemTitle: (aItemId, aNewTitle) =>
+-      new PlacesEditItemTitleTransaction(aItemId, aNewTitle),
+-
+-    editBookmarkURI: (aItemId, aNewURI) =>
+-      new PlacesEditBookmarkURITransaction(aItemId, aNewURI),
+-
+-    setItemAnnotation: (aItemId, aAnnotationObject) =>
+-      new PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject),
+-
+-    setPageAnnotation: (aURI, aAnnotationObject) =>
+-      new PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject),
+-
+-    editBookmarkKeyword: (aItemId, aNewKeyword) =>
+-      new PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword),
+-
+-    editLivemarkSiteURI: (aLivemarkId, aSiteURI) =>
+-      new PlacesEditLivemarkSiteURITransaction(aLivemarkId, aSiteURI),
+-
+-    editLivemarkFeedURI: (aLivemarkId, aFeedURI) =>
+-      new PlacesEditLivemarkFeedURITransaction(aLivemarkId, aFeedURI),
+-
+-    editItemDateAdded: (aItemId, aNewDateAdded) =>
+-      new PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded),
+-
+-    editItemLastModified: (aItemId, aNewLastModified) =>
+-      new PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified),
+-
+-    sortFolderByName: (aFolderId) =>
+-      new PlacesSortFolderByNameTransaction(aFolderId),
+-
+-    tagURI: (aURI, aTags) =>
+-      new PlacesTagURITransaction(aURI, aTags),
+-
+-    untagURI: (aURI, aTags) =>
+-      new PlacesUntagURITransaction(aURI, aTags),
+-
+-    /**
+-     * Transaction for setting/unsetting Load-in-sidebar annotation.
+-     *
+-     * @param aBookmarkId
+-     *        id of the bookmark where to set Load-in-sidebar annotation.
+-     * @param aLoadInSidebar
+-     *        boolean value.
+-     * @return nsITransaction object.
+-     */
+-    setLoadInSidebar(aItemId, aLoadInSidebar) {
+-      let annoObj = { name: PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
+-                      type: Ci.nsIAnnotationService.TYPE_INT32,
+-                      flags: 0,
+-                      value: aLoadInSidebar,
+-                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
+-      return new PlacesSetItemAnnotationTransaction(aItemId, annoObj);
+-    },
+-
+-   /**
+-    * Transaction for editing the description of a bookmark or a folder.
+-    *
+-    * @param aItemId
+-    *        id of the item to edit.
+-    * @param aDescription
+-    *        new description.
+-    * @return nsITransaction object.
+-    */
+-    editItemDescription(aItemId, aDescription) {
+-      let annoObj = { name: PlacesUIUtils.DESCRIPTION_ANNO,
+-                      type: Ci.nsIAnnotationService.TYPE_STRING,
+-                      flags: 0,
+-                      value: aDescription,
+-                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
+-      return new PlacesSetItemAnnotationTransaction(aItemId, annoObj);
+-    },
+-
+-    // nsITransactionManager forwarders.
+-
+-    beginBatch: () =>
+-      PlacesUtils.transactionManager.beginBatch(null),
+-
+-    endBatch: () =>
+-      PlacesUtils.transactionManager.endBatch(false),
+-
+-    doTransaction: (txn) =>
+-      PlacesUtils.transactionManager.doTransaction(txn),
+-
+-    undoTransaction: () =>
+-      PlacesUtils.transactionManager.undoTransaction(),
+-
+-    redoTransaction: () =>
+-      PlacesUtils.transactionManager.redoTransaction(),
+-
+-    get numberOfUndoItems() {
+-      return PlacesUtils.transactionManager.numberOfUndoItems;
+-    },
+-    get numberOfRedoItems() {
+-      return PlacesUtils.transactionManager.numberOfRedoItems;
+-    },
+-    get maxTransactionCount() {
+-      return PlacesUtils.transactionManager.maxTransactionCount;
+-    },
+-    set maxTransactionCount(val) {
+-      PlacesUtils.transactionManager.maxTransactionCount = val;
+-    },
+-
+-    clear: () =>
+-      PlacesUtils.transactionManager.clear(),
+-
+-    peekUndoStack: () =>
+-      PlacesUtils.transactionManager.peekUndoStack(),
+-
+-    peekRedoStack: () =>
+-      PlacesUtils.transactionManager.peekRedoStack(),
+-
+-    getUndoStack: () =>
+-      PlacesUtils.transactionManager.getUndoStack(),
+-
+-    getRedoStack: () =>
+-      PlacesUtils.transactionManager.getRedoStack(),
+-
+-    AddListener: (aListener) =>
+-      PlacesUtils.transactionManager.AddListener(aListener),
+-
+-    RemoveListener: (aListener) =>
+-      PlacesUtils.transactionManager.RemoveListener(aListener)
+-  }
+-});
 diff --git a/suite/components/places/content/bookmarkProperties.js b/suite/components/places/content/bookmarkProperties.js
 --- a/suite/components/places/content/bookmarkProperties.js
 +++ b/suite/components/places/content/bookmarkProperties.js
@@ -1786,6 +2084,38 @@ diff --git a/suite/components/places/content/controller.js b/suite/components/pl
     *
     * @note history deletes are not undoable.
     */
+@@ -950,29 +906,29 @@ PlacesController.prototype = {
+    * @param   [in] aContainerNode
+    *          The container node to remove.
+    *
+    * @note history deletes are not undoable.
+    */
+   _removeHistoryContainer: function PC__removeHistoryContainer(aContainerNode) {
+     if (PlacesUtils.nodeIsHost(aContainerNode)) {
+       // Site container.
+-      PlacesUtils.bhistory.removePagesFromHost(aContainerNode.title, true);
++      PlacesUtils.history.removePagesFromHost(aContainerNode.title, true);
+     } else if (PlacesUtils.nodeIsDay(aContainerNode)) {
+       // Day container.
+       let query = aContainerNode.getQueries()[0];
+       let beginTime = query.beginTime;
+       let endTime = query.endTime;
+       if (!query || !beginTime || !endTime)
+         throw new Error("A valid date container query should exist!");
+       // We want to exclude beginTime from the removal because
+       // removePagesByTimeframe includes both extremes, while date containers
+       // exclude the lower extreme.  So, if we would not exclude it, we would
+       // end up removing more history than requested.
+-      PlacesUtils.bhistory.removePagesByTimeframe(beginTime + 1, endTime);
++      PlacesUtils.history.removePagesByTimeframe(beginTime + 1, endTime);
+     }
+   },
+ 
+   /**
+    * Removes the selection
+    * @param   aTxnName
+    *          A name for the transaction if this is being performed
+    *          as part of another operation.
 @@ -982,27 +938,21 @@ PlacesController.prototype = {
        return;
  
@@ -2098,7 +2428,27 @@ diff --git a/suite/components/places/content/controller.js b/suite/components/pl
 diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/components/places/content/editBookmarkOverlay.js
 --- a/suite/components/places/content/editBookmarkOverlay.js
 +++ b/suite/components/places/content/editBookmarkOverlay.js
-@@ -533,30 +533,16 @@ var gEditItemOverlay = {
+@@ -16,18 +16,17 @@ var gEditItemOverlay = {
+     if (!aInitInfo)
+       return this._paneInfo = null;
+ 
+     if ("uris" in aInitInfo && "node" in aInitInfo)
+       throw new Error("ambiguous pane info");
+     if (!("uris" in aInitInfo) && !("node" in aInitInfo))
+       throw new Error("Neither node nor uris set for pane info");
+ 
+-    // Once we stop supporting legacy add-ons the code should throw if a node is
+-    // not passed.
++    // We either pass a node or uris.
+     let node = "node" in aInitInfo ? aInitInfo.node : null;
+ 
+     // Since there's no true UI for folder shortcuts (they show up just as their target
+     // folders), when the pane shows for them it's opened in read-only mode, showing the
+     // properties of the target folder.
+     let itemId = node ? node.itemId : -1;
+     let itemGuid = node ? PlacesUtils.getConcreteItemGuid(node) : null;
+     let isItem = itemId != -1;
+@@ -533,30 +532,16 @@ var gEditItemOverlay = {
    },
  
    // Adds and removes tags for one or more uris.
@@ -2129,7 +2479,7 @@ diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/comp
        if (newTags.length > 0) {
          await PlacesTransactions.Tag({ urls: aURIs, tags: newTags })
                                  .transact();
-@@ -623,22 +609,16 @@ var gEditItemOverlay = {
+@@ -623,22 +608,16 @@ var gEditItemOverlay = {
  
      // Here we update either the item title or its cached static title
      let newTitle = this._namePicker.value;
@@ -2152,7 +2502,7 @@ diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/comp
      }
    },
  
-@@ -646,22 +626,16 @@ var gEditItemOverlay = {
+@@ -646,22 +625,16 @@ var gEditItemOverlay = {
      if (this.readOnly || !this._paneInfo.isItem)
        return;
  
@@ -2175,7 +2525,7 @@ diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/comp
  
    onLocationFieldChange() {
      if (this.readOnly || !this._paneInfo.isBookmark)
-@@ -673,62 +647,42 @@ var gEditItemOverlay = {
+@@ -673,62 +646,42 @@ var gEditItemOverlay = {
      } catch (ex) {
        // TODO: Bug 1089141 - Provide some feedback about the invalid url.
        return;
@@ -2238,7 +2588,7 @@ diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/comp
    toggleFolderTreeVisibility() {
      var expander = this._element("foldersExpander");
      var folderTreeRow = this._element("folderTreeRow");
-@@ -806,26 +760,19 @@ var gEditItemOverlay = {
+@@ -806,26 +759,19 @@ var gEditItemOverlay = {
        setTimeout(() => this.toggleFolderTreeVisibility(), 100);
        return;
      }
@@ -2268,7 +2618,7 @@ diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/comp
            containerId != PlacesUtils.bookmarksMenuFolderId) {
          this._markFolderAsRecentlyUsed(containerId)
              .catch(Cu.reportError);
-@@ -862,40 +809,16 @@ var gEditItemOverlay = {
+@@ -862,40 +808,16 @@ var gEditItemOverlay = {
        return;
  
      var folderItem = this._getFolderMenuItem(folderId, selectedNode.title);
@@ -2309,7 +2659,7 @@ diff --git a/suite/components/places/content/editBookmarkOverlay.js b/suite/comp
        guids.push(guid);
      }
      if (guids.length > 0) {
-@@ -1001,31 +924,27 @@ var gEditItemOverlay = {
+@@ -1001,31 +923,27 @@ var gEditItemOverlay = {
                 .filter(tag => tag.length > 0); // Kill empty tags.
    },
  

+ 7 - 7
comm-release/patches/series

@@ -2184,16 +2184,14 @@ TOP-1906540-mozdevice-removal-comm-25320.patch
 1488138-64a1.patch
 1913579-removed-files-25320.patch
 1564611-70a1.patch
-1913633-mar-channel-ids-25320.patch
+1913633-mar-channel-ids-1_1-25320.patch
 1897801-2-about-seamonkey-25320.patch
 1656564-fix-themes-browseURL-25320.patch
-9999999-wikiico-25320.patch
 1920367-domi-remove-atomservice-25320.patch
 1920565-irc-channels-v1_1-25320.patch
 1658682-1-81a1.patch
 1658682-2-81a1.patch
 1661940-82a1.patch
-9999999-handler-25320.patch
 1923211-irc-fix-decodeTagData-25320.patch
 1923213-irc-network-away-fix-25320.patch
 1923215-irc-remove-XTLabelRecord-25320.patch
@@ -2204,11 +2202,13 @@ TOP-1906540-mozdevice-removal-comm-25320.patch
 1923227-irc-remove-arrayRemoveInsert-25320.patch
 1923229-irc-remove-stringTrim-25320.patch
 1923232-irc-remove-keys-25320.patch
-TOP-1378089-4-WIP-bookmarks-25320.patch
-TOP-1872623-cancelbookmark-25319.patch
-9999999-specificsearch-25320.patch
-1913633-mar-addendum-ids-25320.patch
 1924332-irc-input-paste-25320.patch
 1924336-irc-logins-25320.patch
 1924337-irc-zipReader-25320.patch
 1924338-irc-newObject-25320.patch
+9999999-wikiico-25320.patch
+9999999-handler-25320.patch
+TOP-1378089-4-WIP-bookmarks-25320.patch
+TOP-1872623-cancelbookmark-25319.patch
+9999999-specificsearch-25320.patch
+9999999-focus-25320.patch

+ 409 - 0
mozilla-release/patches/1319881-77a1.patch

@@ -0,0 +1,409 @@
+# HG changeset patch
+# User sagudev <samo.golez@outlook.com>
+# Date 1588161601 0
+# Node ID 62baa75c624135a9e5fb5c4946ae9339fa86b7de
+# Parent  490fe31947c01770a08aa4a81ae155b41e27c551
+Bug 1319881 - Remove UsingNeckoIPCSecurity r=valentin,necko-reviewers
+
+Differential Revision: https://phabricator.services.mozilla.com/D72534
+
+diff --git a/dom/network/UDPSocketParent.cpp b/dom/network/UDPSocketParent.cpp
+--- a/dom/network/UDPSocketParent.cpp
++++ b/dom/network/UDPSocketParent.cpp
+@@ -45,34 +45,16 @@ UDPSocketParent::Init(const IPC::Princip
+                       const nsACString& aFilter)
+ {
+   MOZ_ASSERT_IF(mBackgroundManager, !aPrincipal);
+   // will be used once we move all UDPSocket to PBackground, or
+   // if we add in Principal checking for mtransport
+   Unused << mBackgroundManager;
+ 
+   mPrincipal = aPrincipal;
+-  if (net::UsingNeckoIPCSecurity() &&
+-      mPrincipal &&
+-      !ContentParent::IgnoreIPCPrincipal()) {
+-    nsCOMPtr<nsIPermissionManager> permMgr =
+-      services::GetPermissionManager();
+-    if (!permMgr) {
+-      NS_WARNING("No PermissionManager available!");
+-      return false;
+-    }
+-
+-    uint32_t permission = nsIPermissionManager::DENY_ACTION;
+-    permMgr->TestExactPermissionFromPrincipal(mPrincipal, "udp-socket",
+-                                              &permission);
+-    if (permission != nsIPermissionManager::ALLOW_ACTION) {
+-      return false;
+-    }
+-  }
+-
+   if (!aFilter.IsEmpty()) {
+     nsAutoCString contractId(NS_NETWORK_UDP_SOCKET_FILTER_HANDLER_PREFIX);
+     contractId.Append(aFilter);
+     nsCOMPtr<nsISocketFilterHandler> filterHandler =
+       do_GetService(contractId.get());
+     if (filterHandler) {
+       nsresult rv = filterHandler->NewFilter(getter_AddRefs(mFilter));
+       if (NS_FAILED(rv)) {
+@@ -81,22 +63,17 @@ UDPSocketParent::Init(const IPC::Princip
+         return false;
+       }
+     } else {
+       printf_stderr("Content doesn't have a valid filter. "
+                     "filter name: %s.", aFilter.BeginReading());
+       return false;
+     }
+   }
+-  // We don't have browser actors in xpcshell, and hence can't run automated
+-  // tests without this loophole.
+-  if (net::UsingNeckoIPCSecurity() && !mFilter &&
+-      (!mPrincipal || ContentParent::IgnoreIPCPrincipal())) {
+-    return false;
+-  }
++
+   return true;
+ }
+ 
+ // PUDPSocketParent methods
+ 
+ mozilla::ipc::IPCResult
+ UDPSocketParent::RecvBind(const UDPAddressInfo& aAddressInfo,
+                           const bool& aAddressReuse, const bool& aLoopback,
+diff --git a/netwerk/ipc/NeckoCommon.cpp b/netwerk/ipc/NeckoCommon.cpp
+deleted file mode 100644
+--- a/netwerk/ipc/NeckoCommon.cpp
++++ /dev/null
+@@ -1,18 +0,0 @@
+-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+-/* vim: set sw=2 ts=8 et tw=80 : */
+-
+-/* This Source Code Form is subject to the terms of the Mozilla Public
+- * License, v. 2.0. If a copy of the MPL was not distributed with this
+- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+-
+-#include "NeckoCommon.h"
+-
+-namespace mozilla {
+-namespace net {
+-
+-namespace NeckoCommonInternal {
+-  bool gSecurityDisabled = true;
+-} // namespace NeckoCommonInternal
+-
+-} // namespace net
+-} // namespace mozilla
+diff --git a/netwerk/ipc/NeckoCommon.h b/netwerk/ipc/NeckoCommon.h
+--- a/netwerk/ipc/NeckoCommon.h
++++ b/netwerk/ipc/NeckoCommon.h
+@@ -91,37 +91,12 @@ IsNeckoChild()
+ 
+   if (!didCheck) {
+     didCheck = true;
+     amChild = (XRE_GetProcessType() == GeckoProcessType_Content);
+   }
+   return amChild;
+ }
+ 
+-namespace NeckoCommonInternal {
+-  extern bool gSecurityDisabled;
+-} // namespace NeckoCommonInternal
+-
+-// This should always return true unless xpcshell tests are being used
+-inline bool
+-UsingNeckoIPCSecurity()
+-{
+-  return !NeckoCommonInternal::gSecurityDisabled;
+-}
+-
+-inline bool
+-MissingRequiredTabChild(mozilla::dom::TabChild* tabChild,
+-                        const char* context)
+-{
+-  if (UsingNeckoIPCSecurity()) {
+-    if (!tabChild) {
+-      printf_stderr("WARNING: child tried to open %s IPDL channel w/o "
+-                    "security info\n", context);
+-      return true;
+-    }
+-  }
+-  return false;
+-}
+-
+ } // namespace net
+ } // namespace mozilla
+ 
+ #endif // mozilla_net_NeckoCommon_h
+diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp
+--- a/netwerk/ipc/NeckoParent.cpp
++++ b/netwerk/ipc/NeckoParent.cpp
+@@ -132,101 +132,31 @@ GetRequestingPrincipal(const FTPChannelC
+   if (aArgs.type() != FTPChannelCreationArgs::TFTPChannelOpenArgs) {
+     return nullptr;
+   }
+ 
+   const FTPChannelOpenArgs& args = aArgs.get_FTPChannelOpenArgs();
+   return GetRequestingPrincipal(args.loadInfo());
+ }
+ 
+-// Bug 1289001 - If GetValidatedOriginAttributes returns an error string, that
+-// usually leads to a content crash with very little info about the cause.
+-// We prefer to crash on the parent, so we get the reason in the crash report.
+-static MOZ_COLD
+-void CrashWithReason(const char * reason)
+-{
+-#ifndef RELEASE_OR_BETA
+-  MOZ_CRASH_UNSAFE_OOL(reason);
+-#endif
+-}
+-
+ const char*
+ NeckoParent::GetValidatedOriginAttributes(const SerializedLoadContext& aSerialized,
+                                           PContentParent* aContent,
+                                           nsIPrincipal* aRequestingPrincipal,
+                                           OriginAttributes& aAttrs)
+ {
+-  if (!UsingNeckoIPCSecurity()) {
+-    if (!aSerialized.IsNotNull()) {
+-      // If serialized is null, we cannot validate anything. We have to assume
+-      // that this requests comes from a SystemPrincipal.
+-      aAttrs = OriginAttributes(NECKO_NO_APP_ID, false);
+-    } else {
+-      aAttrs = aSerialized.mOriginAttributes;
+-    }
+-    return nullptr;
+-  }
+-
+   if (!aSerialized.IsNotNull()) {
+-    CrashWithReason("GetValidatedOriginAttributes | SerializedLoadContext from child is null");
+-    return "SerializedLoadContext from child is null";
++    // If serialized is null, we cannot validate anything. We have to assume
++    // that this requests comes from a SystemPrincipal.
++    aAttrs = OriginAttributes(NECKO_NO_APP_ID, false);
++  } else {
++    aAttrs = aSerialized.mOriginAttributes;
+   }
+ 
+-  nsTArray<TabContext> contextArray =
+-    static_cast<ContentParent*>(aContent)->GetManagedTabContext();
+-
+-  nsAutoCString serializedSuffix;
+-  aSerialized.mOriginAttributes.CreateAnonymizedSuffix(serializedSuffix);
+-
+-  nsAutoCString debugString;
+-  for (uint32_t i = 0; i < contextArray.Length(); i++) {
+-    const TabContext& tabContext = contextArray[i];
+-
+-    if (!ChromeUtils::IsOriginAttributesEqual(aSerialized.mOriginAttributes,
+-                                              tabContext.OriginAttributesRef())) {
+-      debugString.AppendLiteral("(");
+-      debugString.Append(serializedSuffix);
+-      debugString.AppendLiteral(",");
+-
+-      nsAutoCString tabSuffix;
+-      tabContext.OriginAttributesRef().CreateAnonymizedSuffix(tabSuffix);
+-      debugString.Append(tabSuffix);
+-
+-      debugString.AppendLiteral(")");
+-      continue;
+-    }
+-
+-    aAttrs = aSerialized.mOriginAttributes;
+-    return nullptr;
+-  }
+-
+-  // This may be a ServiceWorker: when a push notification is received, FF wakes
+-  // up the corrisponding service worker so that it can manage the PushEvent. At
+-  // that time we probably don't have any valid tabcontext, but still, we want
+-  // to support http channel requests coming from that ServiceWorker.
+-  if (aRequestingPrincipal) {
+-    RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
+-    if (swm &&
+-        swm->MayHaveActiveServiceWorkerInstance(static_cast<ContentParent*>(aContent),
+-                                                aRequestingPrincipal)) {
+-      aAttrs = aSerialized.mOriginAttributes;
+-      return nullptr;
+-    }
+-  }
+-
+-  nsAutoCString errorString;
+-  errorString.AppendLiteral("GetValidatedOriginAttributes | App does not have permission -");
+-  errorString.Append(debugString);
+-
+-  // Leak the buffer on the heap to make sure that it lives long enough, as
+-  // MOZ_CRASH_ANNOTATE expects the pointer passed to it to live to the end of
+-  // the program.
+-  char * error = strdup(errorString.BeginReading());
+-  CrashWithReason(error);
+-  return "App does not have permission";
++  return nullptr;
+ }
+ 
+ const char *
+ NeckoParent::CreateChannelLoadContext(const PBrowserOrId& aBrowser,
+                                       PContentParent* aContent,
+                                       const SerializedLoadContext& aSerialized,
+                                       nsIPrincipal* aRequestingPrincipal,
+                                       nsCOMPtr<nsILoadContext> &aResult)
+diff --git a/netwerk/ipc/moz.build b/netwerk/ipc/moz.build
+--- a/netwerk/ipc/moz.build
++++ b/netwerk/ipc/moz.build
+@@ -11,17 +11,16 @@ EXPORTS.mozilla.net += [
+     'NeckoMessageUtils.h',
+     'NeckoParent.h',
+     'NeckoTargetHolder.h',
+ ]
+ 
+ UNIFIED_SOURCES += [
+     'ChannelEventQueue.cpp',
+     'NeckoChild.cpp',
+-    'NeckoCommon.cpp',
+     'NeckoParent.cpp',
+     'NeckoTargetHolder.cpp',
+ ]
+ 
+ IPDL_SOURCES = [
+     'NeckoChannelParams.ipdlh',
+     'PChannelDiverter.ipdl',
+     'PDataChannel.ipdl',
+diff --git a/netwerk/protocol/ftp/FTPChannelChild.cpp b/netwerk/protocol/ftp/FTPChannelChild.cpp
+--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
++++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
+@@ -173,19 +173,16 @@ FTPChannelChild::AsyncOpen(::nsIStreamLi
+   nsCOMPtr<nsITabChild> iTabChild;
+   NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup,
+                                 NS_GET_IID(nsITabChild),
+                                 getter_AddRefs(iTabChild));
+   GetCallback(iTabChild);
+   if (iTabChild) {
+     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
+   }
+-  if (MissingRequiredTabChild(tabChild, "ftp")) {
+-    return NS_ERROR_ILLEGAL_VALUE;
+-  }
+ 
+   mListener = listener;
+   mListenerContext = aContext;
+ 
+   // add ourselves to the load group.
+   if (mLoadGroup)
+     mLoadGroup->AddRequest(this, nullptr);
+ 
+diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp
+--- a/netwerk/protocol/http/HttpChannelChild.cpp
++++ b/netwerk/protocol/http/HttpChannelChild.cpp
+@@ -2134,19 +2134,16 @@ HttpChannelChild::ConnectParent(uint32_t
+ {
+   LOG(("HttpChannelChild::ConnectParent [this=%p, id=%" PRIu32 "]\n", this, registrarId));
+   mozilla::dom::TabChild* tabChild = nullptr;
+   nsCOMPtr<nsITabChild> iTabChild;
+   GetCallback(iTabChild);
+   if (iTabChild) {
+     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
+   }
+-  if (MissingRequiredTabChild(tabChild, "http")) {
+-    return NS_ERROR_ILLEGAL_VALUE;
+-  }
+ 
+   if (tabChild && !tabChild->IPCOpen()) {
+     return NS_ERROR_FAILURE;
+   }
+ 
+   ContentChild* cc = static_cast<ContentChild*>(gNeckoChild->Manager());
+   if (cc->IsShuttingDown()) {
+     return NS_ERROR_FAILURE;
+@@ -2707,19 +2704,16 @@ HttpChannelChild::ContinueAsyncOpen()
+   //
+ 
+   mozilla::dom::TabChild* tabChild = nullptr;
+   nsCOMPtr<nsITabChild> iTabChild;
+   GetCallback(iTabChild);
+   if (iTabChild) {
+     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
+   }
+-  if (MissingRequiredTabChild(tabChild, "http")) {
+-    return NS_ERROR_ILLEGAL_VALUE;
+-  }
+ 
+   // This id identifies the inner window's top-level document,
+   // which changes on every new load or navigation.
+   uint64_t contentWindowId = 0;
+   if (tabChild) {
+     MOZ_ASSERT(tabChild->WebNavigation());
+     nsCOMPtr<nsIDocument> document = tabChild->GetDocument();
+     if (document) {
+diff --git a/netwerk/protocol/websocket/WebSocketChannelChild.cpp b/netwerk/protocol/websocket/WebSocketChannelChild.cpp
+--- a/netwerk/protocol/websocket/WebSocketChannelChild.cpp
++++ b/netwerk/protocol/websocket/WebSocketChannelChild.cpp
+@@ -532,19 +532,16 @@ WebSocketChannelChild::AsyncOpen(nsIURI 
+   mozilla::dom::TabChild* tabChild = nullptr;
+   nsCOMPtr<nsITabChild> iTabChild;
+   NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup,
+                                 NS_GET_IID(nsITabChild),
+                                 getter_AddRefs(iTabChild));
+   if (iTabChild) {
+     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
+   }
+-  if (MissingRequiredTabChild(tabChild, "websocket")) {
+-    return NS_ERROR_ILLEGAL_VALUE;
+-  }
+ 
+   ContentChild* cc = static_cast<ContentChild*>(gNeckoChild->Manager());
+   if (cc->IsShuttingDown()) {
+     return NS_ERROR_FAILURE;
+   }
+ 
+   // Corresponding release in DeallocPWebSocket
+   AddIPDLReference();
+diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
+--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
++++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
+@@ -673,20 +673,16 @@ WyciwygChannelChild::AsyncOpen(nsIStream
+   if (mLoadGroup) {
+     mLoadGroup->AddRequest(this, nullptr);
+   }
+ 
+   URIParams originalURI;
+   SerializeURI(mOriginalURI, originalURI);
+ 
+   mozilla::dom::TabChild* tabChild = GetTabChild(this);
+-  if (MissingRequiredTabChild(tabChild, "wyciwyg")) {
+-    mCallbacks = nullptr;
+-    return NS_ERROR_ILLEGAL_VALUE;
+-  }
+ 
+   PBrowserOrId browser = static_cast<ContentChild*>(Manager()->Manager())
+                          ->GetBrowserOrId(tabChild);
+ 
+   SendAsyncOpen(originalURI, mLoadFlags, IPC::SerializedLoadContext(this), browser);
+ 
+   mSentAppData = true;
+   mState = WCC_OPENED;
+diff --git a/uriloader/prefetch/OfflineCacheUpdateChild.cpp b/uriloader/prefetch/OfflineCacheUpdateChild.cpp
+--- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp
++++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp
+@@ -380,25 +380,16 @@ OfflineCacheUpdateChild::Schedule()
+ 
+     nsCOMPtr<nsPIDOMWindowInner> window = mWindow.forget();
+     nsCOMPtr<nsIDocShell >docshell = window->GetDocShell();
+     if (!docshell) {
+       NS_WARNING("doc shell tree item is null");
+       return NS_ERROR_FAILURE;
+     }
+ 
+-    nsCOMPtr<nsITabChild> tabchild = docshell->GetTabChild();
+-    // because owner implements nsITabChild, we can assume that it is
+-    // the one and only TabChild.
+-    TabChild* child = tabchild ? static_cast<TabChild*>(tabchild.get()) : nullptr;
+-
+-    if (MissingRequiredTabChild(child, "offlinecacheupdate")) {
+-      return NS_ERROR_FAILURE;
+-    }
+-
+     URIParams manifestURI, documentURI;
+     SerializeURI(mManifestURI, manifestURI);
+     SerializeURI(mDocumentURI, documentURI);
+ 
+     nsresult rv = NS_OK;
+     PrincipalInfo loadingPrincipalInfo;
+     rv = PrincipalToPrincipalInfo(mLoadingPrincipal,
+                                   &loadingPrincipalInfo);

+ 207 - 0
mozilla-release/patches/1322254-77a1.patch

@@ -0,0 +1,207 @@
+# HG changeset patch
+# User sagudev <samo.golez@outlook.com>
+# Date 1587750155 0
+# Node ID 03cbe4b5d2d4aa5ae09cdad871db1aa72b832aa0
+# Parent  e819d35adad2b100bbb5d62c4006df810e0f5a72
+Bug 1322254 - Remove network.disable.ipc.security pref r=valentin,necko-reviewers
+
+Differential Revision: https://phabricator.services.mozilla.com/D71914
+
+diff --git a/accessible/tests/mochitest/jsat/test_content_integration.html b/accessible/tests/mochitest/jsat/test_content_integration.html
+--- a/accessible/tests/mochitest/jsat/test_content_integration.html
++++ b/accessible/tests/mochitest/jsat/test_content_integration.html
+@@ -312,20 +312,16 @@
+ 
+     SimpleTest.waitForExplicitFinish();
+     addLoadEvent(
+       function() {
+         openBrowserWindow(
+           function() {
+             SpecialPowers.pushPrefEnv({
+               "set": [
+-                // TODO: remove this as part of bug 820712
+-                ["network.disable.ipc.security", true],
+-
+-
+                 ["dom.ipc.browser_frames.oop_by_default", true],
+                 ["dom.mozBrowserFramesEnabled", true],
+                 ["browser.pagethumbnails.capturing_disabled", true]
+               ]
+             }, doTest);
+           },
+           getRootDirectory(window.location.href) + "doc_content_integration.html");
+         });
+diff --git a/dom/base/test/chrome/window_swapFrameLoaders.xul b/dom/base/test/chrome/window_swapFrameLoaders.xul
+--- a/dom/base/test/chrome/window_swapFrameLoaders.xul
++++ b/dom/base/test/chrome/window_swapFrameLoaders.xul
+@@ -87,22 +87,16 @@ Test swapFrameLoaders with different fra
+     frame.setAttribute("src", src);
+     document.documentElement.appendChild(frame);
+     let mm = frame.frameLoader.messageManager;
+     await once(mm, "test:load");
+     return frame;
+   }
+ 
+   add_task(async function() {
+-    await SpecialPowers.pushPrefEnv(
+-      { "set": [["dom.mozBrowserFramesEnabled", true],
+-                ["network.disable.ipc.security", true]] });
+-  });
+-
+-  add_task(async function() {
+     for (let scenario of SCENARIOS) {
+       let [ typeA, typeB, remote ] = scenario;
+       remote = !!remote;
+       let heightA = HEIGHTS[0];
+       info(`Adding frame A, type ${typeA}, remote ${remote}, height ${heightA}`);
+       let frameA = await addFrame(typeA, remote, heightA);
+ 
+       let heightB = HEIGHTS[1];
+diff --git a/dom/base/test/test_postMessage_originAttributes.html b/dom/base/test/test_postMessage_originAttributes.html
+--- a/dom/base/test/test_postMessage_originAttributes.html
++++ b/dom/base/test/test_postMessage_originAttributes.html
+@@ -7,21 +7,16 @@
+   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+ </head>
+ 
+ <body>
+ <iframe id="target-iframe"></iframe>
+ <script type="application/javascript">
+ 
+ add_task(async function() {
+-  await SpecialPowers.pushPrefEnv(
+-    { "set": [["network.disable.ipc.security", true]] });
+-});
+-
+-add_task(async function() {
+   let iframe = document.querySelector("#target-iframe");
+ 
+   let win = SpecialPowers.wrap(iframe).contentWindow;
+   let docShell = win.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
+                     .getInterface(SpecialPowers.Ci.nsIDocShell);
+ 
+   // Add private browsing ID to docShell origin and load document.
+   docShell.setOriginAttributes({privateBrowsingId: 1});
+diff --git a/modules/libpref/docs/index.md.1322254.later b/modules/libpref/docs/index.md.1322254.later
+new file mode 100644
+--- /dev/null
++++ b/modules/libpref/docs/index.md.1322254.later
+@@ -0,0 +1,21 @@
++--- index.md
+++++ index.md
++@@ -2,17 +2,17 @@
++ libpref is a generic key/value store that is used to implement *prefs*, a term
++ that encompasses a variety of things.
++ 
++ - Feature enable/disable flags (e.g. `dom.IntersectionObserver.enabled`,
++   `xpinstall.signatures.required`).
++ - User preferences (e.g. things set from `about:preferences`)
++ - Internal application parameters (e.g.
++   `javascript.options.mem.nursery.max_kb`).
++-- Testing and debugging flags (e.g. `network.disable.ipc.security`).
+++- Testing and debugging flags (e.g. `network.dns.native-is-localhost`).
++ - Things that might need locking in an enterprise installation.
++ - Application data (e.g.
++   `browser.onboarding.tour.onboarding-tour-addons.completed`,
++   `services.sync.clients.lastSync`).
++ - A cheap and dirty form of IPC(!) (some devtools prefs).
++ 
++ Some of these (particularly the last two) are not an ideal use of libpref.
++ 
+diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
+--- a/modules/libpref/init/all.js
++++ b/modules/libpref/init/all.js
+@@ -1763,19 +1763,16 @@ pref("network.notify.IPv6", true);
+ #endif
+ 
+ // Transmit UDP busy-work to the LAN when anticipating low latency
+ // network reads and on wifi to mitigate 802.11 Power Save Polling delays
+ pref("network.tickle-wifi.enabled", false);
+ pref("network.tickle-wifi.duration", 400);
+ pref("network.tickle-wifi.delay", 16);
+ 
+-// Turn off interprocess security checks. Needed to run xpcshell tests.
+-pref("network.disable.ipc.security", false);
+-
+ // Default action for unlisted external protocol handlers
+ pref("network.protocol-handler.external-default", true);      // OK to load
+ pref("network.protocol-handler.warn-external-default", true); // warn before load
+ 
+ // Prevent using external protocol handlers for these schemes
+ pref("network.protocol-handler.external.hcp", false);
+ pref("network.protocol-handler.external.vbscript", false);
+ pref("network.protocol-handler.external.javascript", false);
+diff --git a/netwerk/ipc/NeckoCommon.h b/netwerk/ipc/NeckoCommon.h
+--- a/netwerk/ipc/NeckoCommon.h
++++ b/netwerk/ipc/NeckoCommon.h
+@@ -93,17 +93,16 @@ IsNeckoChild()
+     didCheck = true;
+     amChild = (XRE_GetProcessType() == GeckoProcessType_Content);
+   }
+   return amChild;
+ }
+ 
+ namespace NeckoCommonInternal {
+   extern bool gSecurityDisabled;
+-  extern bool gRegisteredBool;
+ } // namespace NeckoCommonInternal
+ 
+ // This should always return true unless xpcshell tests are being used
+ inline bool
+ UsingNeckoIPCSecurity()
+ {
+   return !NeckoCommonInternal::gSecurityDisabled;
+ }
+diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp
+--- a/netwerk/ipc/NeckoParent.cpp
++++ b/netwerk/ipc/NeckoParent.cpp
+@@ -72,25 +72,16 @@ namespace net {
+ // C++ file contents
+ NeckoParent::NeckoParent()
+ {
+   // Init HTTP protocol handler now since we need atomTable up and running very
+   // early (IPDL argument handling for PHttpChannel constructor needs it) so
+   // normal init (during 1st Http channel request) isn't early enough.
+   nsCOMPtr<nsIProtocolHandler> proto =
+     do_GetService("@mozilla.org/network/protocol;1?name=http");
+-
+-  // only register once--we will have multiple NeckoParents if there are
+-  // multiple child processes.
+-  static bool registeredBool = false;
+-  if (!registeredBool) {
+-    Preferences::AddBoolVarCache(&NeckoCommonInternal::gSecurityDisabled,
+-                                 "network.disable.ipc.security");
+-    registeredBool = true;
+-  }
+ }
+ 
+ NeckoParent::~NeckoParent()
+ {
+ }
+ 
+ static PBOverrideStatus
+ PBOverrideStatusFromLoadContext(const SerializedLoadContext& aSerialized)
+diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js
+--- a/testing/xpcshell/head.js
++++ b/testing/xpcshell/head.js
+@@ -92,20 +92,16 @@ if (runningInParent &&
+     "mozIAsyncHistory" in Ci) {
+   // Ensure places history is enabled for xpcshell-tests as some non-FF
+   // apps disable it.
+   _Services.prefs.setBoolPref("places.history.enabled", true);
+ }
+ 
+ try {
+   if (runningInParent) {
+-    // disable necko IPC security checks for xpcshell, as they lack the
+-    // docshells needed to pass them
+-    _Services.prefs.setBoolPref("network.disable.ipc.security", true);
+-
+     // Disable IPv6 lookups for 'localhost' on windows.
+     if ("@mozilla.org/windows-registry-key;1" in Cc) {
+       _Services.prefs.setCharPref("network.dns.ipv4OnlyDomains", "localhost");
+     }
+   }
+ } catch (e) { }
+ 
+ // Configure crash reporting, if possible

+ 196 - 0
mozilla-release/patches/1395526-58a1.patch

@@ -0,0 +1,196 @@
+# HG changeset patch
+# User Mark Banner <standard8@mozilla.com>
+# Date 1506025301 -3600
+# Node ID 15ae046e02c5102a4e4b1581c8d6d18642c208fe
+# Parent  4400e7c81409c5e3bb5d5bea7fc5d4abb13c2aa3
+Bug 1395526 - Avoid potential race with places initialisation when clipboard tests are starting to avoid intermittents. r=mak
+
+MozReview-Commit-ID: 4Hr4zdZNHRp
+
+diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js
+--- a/browser/components/nsBrowserGlue.js
++++ b/browser/components/nsBrowserGlue.js
+@@ -243,16 +243,17 @@ function BrowserGlue() {
+  * OS X has the concept of zero-window sessions and therefore ignores the
+  * browser-lastwindow-close-* topics.
+  */
+ const OBSERVE_LASTWINDOW_CLOSE_TOPICS = AppConstants.platform != "macosx";
+ 
+ BrowserGlue.prototype = {
+   _saveSession: false,
+   _migrationImportsDefaultBookmarks: false,
++  _placesBrowserInitComplete: false,
+ 
+   _setPrefToSaveSession: function BG__setPrefToSaveSession(aForce) {
+     if (!this._saveSession && !aForce)
+       return;
+ 
+     Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
+ 
+     // This method can be called via [NSApplication terminate:] on Mac, which
+@@ -390,16 +391,20 @@ BrowserGlue.prototype = {
+         } else if (data == "mock-fxaccounts") {
+           Object.defineProperty(this, "fxAccounts", {
+             value: subject.wrappedJSObject
+           });
+         } else if (data == "mock-alerts-service") {
+           Object.defineProperty(this, "AlertsService", {
+             value: subject.wrappedJSObject
+           });
++        } else if (data == "places-browser-init-complete") {
++          if (this._placesBrowserInitComplete) {
++            Services.obs.notifyObservers(null, "places-browser-init-complete");
++          }
+         }
+         break;
+       case "initial-migration-will-import-default-bookmarks":
+         this._migrationImportsDefaultBookmarks = true;
+         break;
+       case "initial-migration-did-import-default-bookmarks":
+         this._initPlaces(true);
+         break;
+@@ -1407,16 +1412,17 @@ BrowserGlue.prototype = {
+     let dbStatus = PlacesUtils.history.databaseStatus;
+ 
+     // Show a notification with a "more info" link for a locked places.sqlite.
+     if (dbStatus == PlacesUtils.history.DATABASE_STATUS_LOCKED) {
+       // Note: initPlaces should always happen when the first window is ready,
+       // in any case, better safe than sorry.
+       this._firstWindowReady.then(() => {
+         this._showPlacesLockedNotificationBox();
++        this._placesBrowserInitComplete = true;
+         Services.obs.notifyObservers(null, "places-browser-init-complete");
+       });
+       return;
+     }
+ 
+     let importBookmarks = !aInitialMigrationPerformed &&
+                           (dbStatus == PlacesUtils.history.DATABASE_STATUS_CREATE ||
+                            dbStatus == PlacesUtils.history.DATABASE_STATUS_CORRUPT);
+@@ -1566,16 +1572,17 @@ BrowserGlue.prototype = {
+         this._idleService.addIdleObserver(this, this._bookmarksBackupIdleTime);
+       }
+ 
+     })().catch(ex => {
+       Cu.reportError(ex);
+     }).then(() => {
+       // NB: deliberately after the catch so that we always do this, even if
+       // we threw halfway through initializing in the Task above.
++      this._placesBrowserInitComplete = true;
+       Services.obs.notifyObservers(null, "places-browser-init-complete");
+     });
+   },
+ 
+   /**
+    * If a backup for today doesn't exist, this creates one.
+    */
+   _backupBookmarks: function BG__backupBookmarks() {
+diff --git a/browser/components/places/tests/browser/browser.ini b/browser/components/places/tests/browser/browser.ini
+--- a/browser/components/places/tests/browser/browser.ini
++++ b/browser/components/places/tests/browser/browser.ini
+@@ -22,22 +22,22 @@ support-files =
+ [browser_bookmarkProperties_addLivemark.js]
+ [browser_bookmarkProperties_bookmarkAllTabs.js]
+ [browser_bookmarkProperties_cancel.js]
+ [browser_bookmarkProperties_editTagContainer.js]
+ [browser_bookmarkProperties_readOnlyRoot.js]
+ [browser_bookmarksProperties.js]
+ [browser_check_correct_controllers.js]
+ [browser_click_bookmarks_on_toolbar.js]
+-[browser_cutting_bookmarks.js]
+-subsuite = clipboard
+ [browser_controller_onDrop.js]
+ [browser_copy_folder_tree.js]
+ [browser_copy_query_without_tree.js]
+ subsuite = clipboard
++[browser_cutting_bookmarks.js]
++subsuite = clipboard
+ [browser_drag_bookmarks_on_toolbar.js]
+ [browser_forgetthissite_single.js]
+ [browser_history_sidebar_search.js]
+ [browser_library_batch_delete.js]
+ [browser_library_commands.js]
+ [browser_library_delete_bookmarks_in_tags.js]
+ [browser_library_delete_tags.js]
+ [browser_library_downloads.js]
+diff --git a/browser/components/places/tests/browser/browser_copy_query_without_tree.js b/browser/components/places/tests/browser/browser_copy_query_without_tree.js
+--- a/browser/components/places/tests/browser/browser_copy_query_without_tree.js
++++ b/browser/components/places/tests/browser/browser_copy_query_without_tree.js
+@@ -3,29 +3,32 @@
+  */
+ 
+ /* test that copying a non movable query or folder shortcut makes a new query with the same url, not a deep copy */
+ 
+ const SHORTCUT_URL = "place:folder=2";
+ const QUERY_URL = "place:sort=8&maxResults=10";
+ 
+ add_task(async function copy_toolbar_shortcut() {
++  await promisePlacesInitComplete();
++
+   let library = await promiseLibrary();
+ 
+   registerCleanupFunction(function() {
+     library.close();
+     PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
+   });
+ 
+   library.PlacesOrganizer.selectLeftPaneQuery("BookmarksToolbar");
+ 
+   await promiseClipboard(function() { library.PlacesOrganizer._places.controller.copy(); },
+                          PlacesUtils.TYPE_X_MOZ_PLACE);
+ 
+   library.PlacesOrganizer.selectLeftPaneQuery("UnfiledBookmarks");
++
+   await library.ContentTree.view.controller.paste();
+ 
+   let toolbarCopyNode = library.ContentTree.view.view.nodeForTreeIndex(0);
+   is(toolbarCopyNode.type,
+      Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT,
+      "copy is still a folder shortcut");
+ 
+   PlacesUtils.bookmarks.removeItem(toolbarCopyNode.itemId);
+diff --git a/browser/components/places/tests/browser/head.js b/browser/components/places/tests/browser/head.js
+--- a/browser/components/places/tests/browser/head.js
++++ b/browser/components/places/tests/browser/head.js
+@@ -70,18 +70,18 @@ function promiseLibraryClosed(organizer)
+  * @see waitForClipboard
+  *
+  * @param aPopulateClipboardFn
+  *        Function to populate the clipboard.
+  * @param aFlavor
+  *        Data flavor to expect.
+  */
+ function promiseClipboard(aPopulateClipboardFn, aFlavor) {
+-  return new Promise(resolve => {
+-    waitForClipboard(data => !!data, aPopulateClipboardFn, resolve, aFlavor);
++  return new Promise((resolve, reject) => {
++    waitForClipboard(data => !!data, aPopulateClipboardFn, resolve, reject, aFlavor);
+   });
+ }
+ 
+ /**
+  * Waits for all pending async statements on the default connection, before
+  * proceeding with aCallback.
+  *
+  * @param aCallback
+@@ -452,8 +452,20 @@ var withSidebarTree = async function(typ
+   // Need to executeSoon since the tree is initialized on sidebar load.
+   info("withSidebarTree: executing the task");
+   try {
+     await taskFn(tree);
+   } finally {
+     SidebarUI.hide();
+   }
+ };
++
++function promisePlacesInitComplete() {
++  const gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"]
++                         .getService(Ci.nsIObserver);
++
++  let placesInitCompleteObserved = TestUtils.topicObserved("places-browser-init-complete")
++
++  gBrowserGlue.observe(null, "browser-glue-test",
++    "places-browser-init-complete");
++
++  return placesInitCompleteObserved;
++}

+ 801 - 0
mozilla-release/patches/1405687-58a1.patch

@@ -0,0 +1,801 @@
+# HG changeset patch
+# User Marco Bonardo <mbonardo@mozilla.com>
+# Date 1507127626 -7200
+# Node ID 34e534c39b37775587ab03605f32d1aa7d67df61
+# Parent  28947ae84de43dbdd45b50a6e1930a6d4353192f
+Bug 1405687 - Remove some deprecated code from Places related code. r=standard8
+
+MozReview-Commit-ID: 411z07otlfN
+
+diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css
+--- a/browser/base/content/browser.css
++++ b/browser/base/content/browser.css
+@@ -515,20 +515,16 @@ toolbar:not(#TabsToolbar) > #personal-bo
+ 
+ :root[lwthemefooter=true] #browser-bottombox:-moz-lwtheme {
+   background-repeat: no-repeat;
+   background-position: bottom left;
+   background-color: var(--lwt-accent-color);
+   background-image: var(--lwt-footer-image);
+ }
+ 
+-.menuitem-iconic-tooltip {
+-  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-iconic-tooltip");
+-}
+-
+ /* Hide menu elements intended for keyboard access support */
+ #main-menubar[openedwithkey=false] .show-only-for-keyboard {
+   display: none;
+ }
+ 
+ /* ::::: location bar & search bar ::::: */
+ 
+ #urlbar-container {
+diff --git a/browser/components/places/PlacesUIUtils.jsm b/browser/components/places/PlacesUIUtils.jsm
+--- a/browser/components/places/PlacesUIUtils.jsm
++++ b/browser/components/places/PlacesUIUtils.jsm
+@@ -4,36 +4,32 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ var EXPORTED_SYMBOLS = ["PlacesUIUtils"];
+ 
+ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ ChromeUtils.import("resource://gre/modules/Services.jsm");
+ ChromeUtils.import("resource://gre/modules/Timer.jsm");
+ 
+-ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+-ChromeUtils.defineModuleGetter(this, "PluralForm",
+-                               "resource://gre/modules/PluralForm.jsm");
+-ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
+-                               "resource://gre/modules/PrivateBrowsingUtils.jsm");
+-ChromeUtils.defineModuleGetter(this, "NetUtil",
+-                               "resource://gre/modules/NetUtil.jsm");
+-ChromeUtils.defineModuleGetter(this, "RecentWindow",
+-                               "resource:///modules/RecentWindow.jsm");
+-ChromeUtils.defineModuleGetter(this, "PromiseUtils",
+-                               "resource://gre/modules/PromiseUtils.jsm");
+-
+-// PlacesUtils exposes multiple symbols, so we can't use defineLazyModuleGetter.
++// PlacesUtils exposes multiple symbols, so we can't use defineLazyModuleGetter
++// until we remove legacy transactions (Bug 1131491).
+ ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+ 
+-ChromeUtils.defineModuleGetter(this, "PlacesTransactions",
+-                               "resource://gre/modules/PlacesTransactions.jsm");
++XPCOMUtils.defineLazyModuleGetters(this, {
++  PluralForm: "resource://gre/modules/PluralForm.jsm",
++  PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
++  RecentWindow: "resource:///modules/RecentWindow.jsm",
++  PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
++  PlacesTransactions: "resource://gre/modules/PlacesTransactions.jsm",
++  Weave: "resource://services-sync/main.js",
++});
+ 
+-ChromeUtils.defineModuleGetter(this, "Weave",
+-                               "resource://services-sync/main.js");
++XPCOMUtils.defineLazyGetter(this, "bundle", function() {
++  return Services.strings.createBundle("chrome://browser/locale/places/places.properties");
++});
+ 
+ const gInContentProcess = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
+ const FAVICON_REQUEST_TIMEOUT = 60 * 1000;
+ // Map from windows to arrays of data about pending favicon loads.
+ let gFaviconLoadDataMap = new Map();
+ 
+ const ITEM_CHANGED_BATCH_NOTIFICATION_THRESHOLD = 10;
+ 
+@@ -52,18 +48,16 @@ function IsLivemark(aItemId) {
+     const LIVEMARK_ANNO = PlacesUtils.LMANNO_FEEDURI;
+ 
+     let idsVec = PlacesUtils.annotations.getItemsWithAnnotation(LIVEMARK_ANNO);
+     self.ids = new Set(idsVec);
+ 
+     let obs = Object.freeze({
+       QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarksObserver]),
+ 
+-      // Ci.nsINavBookmarkObserver items.
+-
+       onItemChanged(itemId, property, isAnnoProperty, newValue, lastModified,
+                     itemType, parentId, guid) {
+         if (isAnnoProperty && property == LIVEMARK_ANNO) {
+           self.ids.add(itemId);
+         }
+       },
+ 
+       onItemRemoved(itemId) {
+@@ -75,17 +69,17 @@ function IsLivemark(aItemId) {
+       onItemAdded() {},
+       onBeginUpdateBatch() {},
+       onEndUpdateBatch() {},
+       onItemVisited() {},
+       onItemMoved() {},
+       onPageAnnotationSet() { },
+       onPageAnnotationRemoved() { },
+       skipDescendantsOnItemRemoval: false,
+-      skipTags: false,
++      skipTags: true,
+     });
+ 
+     PlacesUtils.bookmarks.addObserver(obs);
+     PlacesUtils.registerShutdownFunction(() => {
+       PlacesUtils.bookmarks.removeObserver(obs);
+     });
+   }
+   return self.ids.has(aItemId);
+@@ -273,17 +267,17 @@ var PlacesUIUtils = {
+ 
+   /**
+    * Makes a URI from a spec, and do fixup
+    * @param   aSpec
+    *          The string spec of the URI
+    * @return A URI object for the spec.
+    */
+   createFixedURI: function PUIU_createFixedURI(aSpec) {
+-    return URIFixup.createFixupURI(aSpec, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
++    return Services.uriFixup.createFixupURI(aSpec, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
+   },
+ 
+   getFormattedString: function PUIU_getFormattedString(key, params) {
+     return bundle.formatStringFromName(key, params, params.length);
+   },
+ 
+   /**
+    * Get a localized plural string for the specified key name and numeric value
+@@ -429,17 +423,17 @@ var PlacesUIUtils = {
+     if (aContainer == PlacesUtils.tagsFolderId) { // Copying into a tag folder.
+       let transactions = [];
+       if (!aData.livemark && aData.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) {
+         let {root} = PlacesUtils.getFolderContents(aData.id, false, false);
+         let urls = PlacesUtils.getURLsForContainerNode(root);
+         root.containerOpen = false;
+         for (let { uri } of urls) {
+           transactions.push(
+-            new PlacesTagURITransaction(NetUtil.newURI(uri), [aData.title])
++            new PlacesTagURITransaction(Services.io.newURI(uri), [aData.title])
+           );
+         }
+       }
+       return new PlacesAggregatedTransaction("addTags", transactions);
+     }
+ 
+     if (aData.livemark && aData.annos) { // Copying a livemark.
+       return this._getLivemarkCopyTransaction(aData, aContainer, aIndex);
+@@ -671,20 +665,16 @@ var PlacesUIUtils = {
+           topUndoEntry != PlacesTransactions.topUndoEntry) {
+         PlacesTransactions.undo().catch(Cu.reportError);
+       }
+     }
+ 
+     return performed;
+   },
+ 
+-  _getTopBrowserWin: function PUIU__getTopBrowserWin() {
+-    return RecentWindow.getMostRecentBrowserWindow();
+-  },
+-
+   /**
+    * set and fetch a favicon. Can only be used from the parent process.
+    * @param browser   {Browser}   The XUL browser element for which we're fetching a favicon.
+    * @param principal {Principal} The loading principal to use for the fetch.
+    * @param uri       {URI}       The URI to fetch.
+    */
+   loadFavicon(browser, principal, uri, requestContextID) {
+     if (gInContentProcess) {
+@@ -952,17 +942,17 @@ var PlacesUIUtils = {
+     if (!aItemsToOpen.length)
+       return;
+ 
+     // Prefer the caller window if it's a browser window, otherwise use
+     // the top browser window.
+     var browserWindow = null;
+     browserWindow =
+       aWindow && aWindow.document.documentElement.getAttribute("windowtype") == "navigator:browser" ?
+-      aWindow : this._getTopBrowserWin();
++      aWindow : RecentWindow.getMostRecentBrowserWindow();
+ 
+     var urls = [];
+     let skipMarking = browserWindow && PrivateBrowsingUtils.isWindowPrivate(browserWindow);
+     for (let item of aItemsToOpen) {
+       urls.push(item.uri);
+       if (skipMarking) {
+         continue;
+       }
+@@ -1086,17 +1076,17 @@ var PlacesUIUtils = {
+           this.markPageAsTyped(aNode.uri);
+       }
+ 
+       // Check whether the node is a bookmark which should be opened as
+       // a web panel
+       if (aWhere == "current" && isBookmark) {
+         if (PlacesUtils.annotations
+                        .itemHasAnnotation(aNode.itemId, this.LOAD_IN_SIDEBAR_ANNO)) {
+-          let browserWin = this._getTopBrowserWin();
++          let browserWin = RecentWindow.getMostRecentBrowserWindow();
+           if (browserWin) {
+             browserWin.openWebPanel(aNode.title, aNode.uri);
+             return;
+           }
+         }
+       }
+ 
+       aWindow.openUILinkIn(aNode.uri, aWhere, {
+@@ -1581,206 +1571,19 @@ PlacesUIUtils.PLACES_FLAVORS = [PlacesUt
+ 
+ PlacesUIUtils.URI_FLAVORS = [PlacesUtils.TYPE_X_MOZ_URL,
+                              TAB_DROP_TYPE,
+                              PlacesUtils.TYPE_UNICODE],
+ 
+ PlacesUIUtils.SUPPORTED_FLAVORS = [...PlacesUIUtils.PLACES_FLAVORS,
+                                    ...PlacesUIUtils.URI_FLAVORS];
+ 
+-XPCOMUtils.defineLazyServiceGetter(PlacesUIUtils, "RDF",
+-                                   "@mozilla.org/rdf/rdf-service;1",
+-                                   "nsIRDFService");
+-
+ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ellipsis", function() {
+   return Services.prefs.getComplexValue("intl.ellipsis",
+                                         Ci.nsIPrefLocalizedString).data;
+ });
+ 
+-XPCOMUtils.defineLazyGetter(PlacesUIUtils, "useAsyncTransactions", function() {
+-  try {
+-    return Services.prefs.getBoolPref("browser.places.useAsyncTransactions");
+-  } catch (ex) { }
+-  return false;
+-});
+-
++XPCOMUtils.defineLazyPreferenceGetter(PlacesUIUtils, "useAsyncTransactions",
++                                      "browser.places.useAsyncTransactions", false);
+ XPCOMUtils.defineLazyPreferenceGetter(PlacesUIUtils, "loadBookmarksInBackground",
+                                       PREF_LOAD_BOOKMARKS_IN_BACKGROUND, false);
+ XPCOMUtils.defineLazyPreferenceGetter(PlacesUIUtils, "loadBookmarksInTabs",
+                                       PREF_LOAD_BOOKMARKS_IN_TABS, false);
+-
+-XPCOMUtils.defineLazyServiceGetter(this, "URIFixup",
+-                                   "@mozilla.org/docshell/urifixup;1",
+-                                   "nsIURIFixup");
+-
+-XPCOMUtils.defineLazyGetter(this, "bundle", function() {
+-  const PLACES_STRING_BUNDLE_URI =
+-    "chrome://browser/locale/places/places.properties";
+-  return Cc["@mozilla.org/intl/stringbundle;1"].
+-         getService(Ci.nsIStringBundleService).
+-         createBundle(PLACES_STRING_BUNDLE_URI);
+-});
+-
+-/**
+- * This is a compatibility shim for old PUIU.ptm users.
+- *
+- * If you're looking for transactions and writing new code using them, directly
+- * use the transactions objects exported by the PlacesUtils.jsm module.
+- *
+- * This object will be removed once enough users are converted to the new API.
+- */
+-XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() {
+-  // Ensure PlacesUtils is imported in scope.
+-  PlacesUtils;
+-
+-  return {
+-    aggregateTransactions: (aName, aTransactions) =>
+-      new PlacesAggregatedTransaction(aName, aTransactions),
+-
+-    createFolder: (aName, aContainer, aIndex, aAnnotations,
+-                   aChildItemsTransactions) =>
+-      new PlacesCreateFolderTransaction(aName, aContainer, aIndex, aAnnotations,
+-                                        aChildItemsTransactions),
+-
+-    createItem: (aURI, aContainer, aIndex, aTitle, aKeyword,
+-                 aAnnotations, aChildTransactions) =>
+-      new PlacesCreateBookmarkTransaction(aURI, aContainer, aIndex, aTitle,
+-                                          aKeyword, aAnnotations,
+-                                          aChildTransactions),
+-
+-    createSeparator: (aContainer, aIndex) =>
+-      new PlacesCreateSeparatorTransaction(aContainer, aIndex),
+-
+-    createLivemark: (aFeedURI, aSiteURI, aName, aContainer, aIndex,
+-                     aAnnotations) =>
+-      new PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aName, aContainer,
+-                                          aIndex, aAnnotations),
+-
+-    moveItem: (aItemId, aNewContainer, aNewIndex) =>
+-      new PlacesMoveItemTransaction(aItemId, aNewContainer, aNewIndex),
+-
+-    removeItem: (aItemId) =>
+-      new PlacesRemoveItemTransaction(aItemId),
+-
+-    editItemTitle: (aItemId, aNewTitle) =>
+-      new PlacesEditItemTitleTransaction(aItemId, aNewTitle),
+-
+-    editBookmarkURI: (aItemId, aNewURI) =>
+-      new PlacesEditBookmarkURITransaction(aItemId, aNewURI),
+-
+-    setItemAnnotation: (aItemId, aAnnotationObject) =>
+-      new PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject),
+-
+-    setPageAnnotation: (aURI, aAnnotationObject) =>
+-      new PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject),
+-
+-    editBookmarkKeyword: (aItemId, aNewKeyword) =>
+-      new PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword),
+-
+-    editLivemarkSiteURI: (aLivemarkId, aSiteURI) =>
+-      new PlacesEditLivemarkSiteURITransaction(aLivemarkId, aSiteURI),
+-
+-    editLivemarkFeedURI: (aLivemarkId, aFeedURI) =>
+-      new PlacesEditLivemarkFeedURITransaction(aLivemarkId, aFeedURI),
+-
+-    editItemDateAdded: (aItemId, aNewDateAdded) =>
+-      new PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded),
+-
+-    editItemLastModified: (aItemId, aNewLastModified) =>
+-      new PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified),
+-
+-    sortFolderByName: (aFolderId) =>
+-      new PlacesSortFolderByNameTransaction(aFolderId),
+-
+-    tagURI: (aURI, aTags) =>
+-      new PlacesTagURITransaction(aURI, aTags),
+-
+-    untagURI: (aURI, aTags) =>
+-      new PlacesUntagURITransaction(aURI, aTags),
+-
+-    /**
+-     * Transaction for setting/unsetting Load-in-sidebar annotation.
+-     *
+-     * @param aBookmarkId
+-     *        id of the bookmark where to set Load-in-sidebar annotation.
+-     * @param aLoadInSidebar
+-     *        boolean value.
+-     * @return nsITransaction object.
+-     */
+-    setLoadInSidebar(aItemId, aLoadInSidebar) {
+-      let annoObj = { name: PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
+-                      type: Ci.nsIAnnotationService.TYPE_INT32,
+-                      flags: 0,
+-                      value: aLoadInSidebar,
+-                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
+-      return new PlacesSetItemAnnotationTransaction(aItemId, annoObj);
+-    },
+-
+-   /**
+-    * Transaction for editing the description of a bookmark or a folder.
+-    *
+-    * @param aItemId
+-    *        id of the item to edit.
+-    * @param aDescription
+-    *        new description.
+-    * @return nsITransaction object.
+-    */
+-    editItemDescription(aItemId, aDescription) {
+-      let annoObj = { name: PlacesUIUtils.DESCRIPTION_ANNO,
+-                      type: Ci.nsIAnnotationService.TYPE_STRING,
+-                      flags: 0,
+-                      value: aDescription,
+-                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
+-      return new PlacesSetItemAnnotationTransaction(aItemId, annoObj);
+-    },
+-
+-    // nsITransactionManager forwarders.
+-
+-    beginBatch: () =>
+-      PlacesUtils.transactionManager.beginBatch(null),
+-
+-    endBatch: () =>
+-      PlacesUtils.transactionManager.endBatch(false),
+-
+-    doTransaction: (txn) =>
+-      PlacesUtils.transactionManager.doTransaction(txn),
+-
+-    undoTransaction: () =>
+-      PlacesUtils.transactionManager.undoTransaction(),
+-
+-    redoTransaction: () =>
+-      PlacesUtils.transactionManager.redoTransaction(),
+-
+-    get numberOfUndoItems() {
+-      return PlacesUtils.transactionManager.numberOfUndoItems;
+-    },
+-    get numberOfRedoItems() {
+-      return PlacesUtils.transactionManager.numberOfRedoItems;
+-    },
+-    get maxTransactionCount() {
+-      return PlacesUtils.transactionManager.maxTransactionCount;
+-    },
+-    set maxTransactionCount(val) {
+-      PlacesUtils.transactionManager.maxTransactionCount = val;
+-    },
+-
+-    clear: () =>
+-      PlacesUtils.transactionManager.clear(),
+-
+-    peekUndoStack: () =>
+-      PlacesUtils.transactionManager.peekUndoStack(),
+-
+-    peekRedoStack: () =>
+-      PlacesUtils.transactionManager.peekRedoStack(),
+-
+-    getUndoStack: () =>
+-      PlacesUtils.transactionManager.getUndoStack(),
+-
+-    getRedoStack: () =>
+-      PlacesUtils.transactionManager.getRedoStack(),
+-
+-    AddListener: (aListener) =>
+-      PlacesUtils.transactionManager.AddListener(aListener),
+-
+-    RemoveListener: (aListener) =>
+-      PlacesUtils.transactionManager.RemoveListener(aListener)
+-  }
+-});
+diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js
+--- a/browser/components/places/content/controller.js
++++ b/browser/components/places/content/controller.js
+@@ -954,29 +954,29 @@ PlacesController.prototype = {
+    * @param   [in] aContainerNode
+    *          The container node to remove.
+    *
+    * @note history deletes are not undoable.
+    */
+   _removeHistoryContainer: function PC__removeHistoryContainer(aContainerNode) {
+     if (PlacesUtils.nodeIsHost(aContainerNode)) {
+       // Site container.
+-      PlacesUtils.bhistory.removePagesFromHost(aContainerNode.title, true);
++      PlacesUtils.history.removePagesFromHost(aContainerNode.title, true);
+     } else if (PlacesUtils.nodeIsDay(aContainerNode)) {
+       // Day container.
+       let query = aContainerNode.getQueries()[0];
+       let beginTime = query.beginTime;
+       let endTime = query.endTime;
+       if (!query || !beginTime || !endTime)
+         throw new Error("A valid date container query should exist!");
+       // We want to exclude beginTime from the removal because
+       // removePagesByTimeframe includes both extremes, while date containers
+       // exclude the lower extreme.  So, if we would not exclude it, we would
+       // end up removing more history than requested.
+-      PlacesUtils.bhistory.removePagesByTimeframe(beginTime + 1, endTime);
++      PlacesUtils.history.removePagesByTimeframe(beginTime + 1, endTime);
+     }
+   },
+ 
+   /**
+    * Removes the selection
+    * @param   aTxnName
+    *          A name for the transaction if this is being performed
+    *          as part of another operation.
+diff --git a/browser/components/places/content/editBookmarkOverlay.js b/browser/components/places/content/editBookmarkOverlay.js
+--- a/browser/components/places/content/editBookmarkOverlay.js
++++ b/browser/components/places/content/editBookmarkOverlay.js
+@@ -16,18 +16,17 @@ var gEditItemOverlay = {
+     if (!aInitInfo)
+       return this._paneInfo = null;
+ 
+     if ("uris" in aInitInfo && "node" in aInitInfo)
+       throw new Error("ambiguous pane info");
+     if (!("uris" in aInitInfo) && !("node" in aInitInfo))
+       throw new Error("Neither node nor uris set for pane info");
+ 
+-    // Once we stop supporting legacy add-ons the code should throw if a node is
+-    // not passed.
++    // We either pass a node or uris.
+     let node = "node" in aInitInfo ? aInitInfo.node : null;
+ 
+     // Since there's no true UI for folder shortcuts (they show up just as their target
+     // folders), when the pane shows for them it's opened in read-only mode, showing the
+     // properties of the target folder.
+     let itemId = node ? node.itemId : -1;
+     let itemGuid = node ? PlacesUtils.getConcreteItemGuid(node) : null;
+     let isItem = itemId != -1;
+diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm
+--- a/toolkit/components/places/PlacesUtils.jsm
++++ b/toolkit/components/places/PlacesUtils.jsm
+@@ -30,17 +30,16 @@ Cu.importGlobalProperties(["URL"]);
+ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+ 
+ XPCOMUtils.defineLazyModuleGetters(this, {
+   Services: "resource://gre/modules/Services.jsm",
+   NetUtil: "resource://gre/modules/NetUtil.jsm",
+   OS: "resource://gre/modules/osfile.jsm",
+   Sqlite: "resource://gre/modules/Sqlite.jsm",
+-  Deprecated: "resource://gre/modules/Deprecated.jsm",
+   Bookmarks: "resource://gre/modules/Bookmarks.jsm",
+   History: "resource://gre/modules/History.jsm",
+   AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
+   PlacesSyncUtils: "resource://gre/modules/PlacesSyncUtils.jsm",
+ });
+ 
+ // The minimum amount of transactions before starting a batch. Usually we do
+ // do incremental updates, a batch will cause views to completely
+@@ -1950,20 +1949,16 @@ XPCOMUtils.defineLazyGetter(PlacesUtils,
+     }
+   }));
+ });
+ 
+ XPCOMUtils.defineLazyServiceGetter(PlacesUtils, "asyncHistory",
+                                    "@mozilla.org/browser/history;1",
+                                    "mozIAsyncHistory");
+ 
+-XPCOMUtils.defineLazyGetter(PlacesUtils, "bhistory", function() {
+-  return PlacesUtils.history;
+-});
+-
+ XPCOMUtils.defineLazyServiceGetter(PlacesUtils, "favicons",
+                                    "@mozilla.org/browser/favicon-service;1",
+                                    "mozIAsyncFavicons");
+ 
+ XPCOMUtils.defineLazyServiceGetter(this, "bmsvc",
+                                    "@mozilla.org/browser/nav-bookmarks-service;1",
+                                    "nsINavBookmarksService");
+ XPCOMUtils.defineLazyGetter(PlacesUtils, "bookmarks", () => {
+diff --git a/toolkit/components/places/nsIBrowserHistory.idl b/toolkit/components/places/nsIBrowserHistory.idl
+--- a/toolkit/components/places/nsIBrowserHistory.idl
++++ b/toolkit/components/places/nsIBrowserHistory.idl
+@@ -9,40 +9,16 @@
+ 
+ #include "nsISupports.idl"
+ #include "nsIGlobalHistory2.idl"
+ 
+ [scriptable, uuid(20d31479-38de-49f4-9300-566d6e834c66)]
+ interface nsIBrowserHistory : nsISupports
+ {
+     /**
+-     * Removes a page from global history.
+-     *
+-     * @note It is preferrable to use this one rather then RemovePages when
+-     *       removing less than 10 pages, since it won't start a full batch
+-     *       operation.
+-     * @deprecated Use PlacesUtils.history.remove() API instead.
+-     */
+-    void removePage(in nsIURI aURI);
+-
+-    /**
+-     * Removes a list of pages from global history.
+-     *
+-     * @param aURIs
+-     *        Array of URIs to be removed.
+-     * @param aLength
+-     *        Length of the array.
+-     *
+-     * @note the removal happens in a batch.
+-     * @deprecated Use PlacesUtils.history.remove() API instead.
+-     */
+-    void removePages([array, size_is(aLength)] in nsIURI aURIs,
+-                     in unsigned long aLength);
+-
+-    /**
+      * Removes all global history information about pages for a given host.
+      *
+      * @param aHost
+      *        Hostname to be removed.
+      *        An empty host name means local files and anything else with no
+      *        hostname.  You can also pass in the localized "(local files)"
+      *        title given to you from a history query to remove all
+      *        history information from local files.
+diff --git a/toolkit/components/places/nsLivemarkService.js b/toolkit/components/places/nsLivemarkService.js
+--- a/toolkit/components/places/nsLivemarkService.js
++++ b/toolkit/components/places/nsLivemarkService.js
+@@ -5,18 +5,16 @@
+ // Modules and services.
+ 
+ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ ChromeUtils.import("resource://gre/modules/Services.jsm");
+ ChromeUtils.defineModuleGetter(this, "PlacesUtils",
+                                "resource://gre/modules/PlacesUtils.jsm");
+ ChromeUtils.defineModuleGetter(this, "NetUtil",
+                                "resource://gre/modules/NetUtil.jsm");
+-ChromeUtils.defineModuleGetter(this, "Deprecated",
+-                               "resource://gre/modules/Deprecated.jsm");
+ 
+ XPCOMUtils.defineLazyGetter(this, "history", function() {
+   // Lazily add an history observer when it's actually needed.
+   PlacesUtils.history.addObserver(PlacesUtils.livemarks, true);
+   return PlacesUtils.history;
+ });
+ 
+ // Constants
+diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp
+--- a/toolkit/components/places/nsNavHistory.cpp
++++ b/toolkit/components/places/nsNavHistory.cpp
+@@ -2532,91 +2532,16 @@ nsNavHistory::CleanupPlacesOnVisitsDelet
+                      nsINavHistoryObserver,
+                      OnDeleteURI(URIs[i], GUIDs[i], nsINavHistoryObserver::REASON_DELETED));
+   }
+ 
+   return NS_OK;
+ }
+ 
+ 
+-// nsNavHistory::RemovePages
+-//
+-//    Removes a bunch of uris from history.
+-//    Has better performance than RemovePage when deleting a lot of history.
+-//    We don't do duplicates removal, URIs array should be cleaned-up before.
+-
+-NS_IMETHODIMP
+-nsNavHistory::RemovePages(nsIURI **aURIs, uint32_t aLength)
+-{
+-  PLACES_WARN_DEPRECATED();
+-  NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
+-  NS_ENSURE_ARG(aURIs);
+-
+-  nsresult rv;
+-  // build a list of place ids to delete
+-  nsCString deletePlaceIdsQueryString;
+-  for (uint32_t i = 0; i < aLength; i++) {
+-    int64_t placeId;
+-    nsAutoCString guid;
+-    if (!aURIs[i])
+-      continue;
+-    rv = GetIdForPage(aURIs[i], &placeId, guid);
+-    NS_ENSURE_SUCCESS(rv, rv);
+-    if (placeId != 0) {
+-      if (!deletePlaceIdsQueryString.IsEmpty())
+-        deletePlaceIdsQueryString.Append(',');
+-      deletePlaceIdsQueryString.AppendInt(placeId);
+-    }
+-  }
+-
+-  UpdateBatchScoper batch(*this); // sends Begin/EndUpdateBatch to observers
+-
+-  rv = RemovePagesInternal(deletePlaceIdsQueryString);
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+-  // Clear the registered embed visits.
+-  clearEmbedVisits();
+-
+-  return NS_OK;
+-}
+-
+-
+-// nsNavHistory::RemovePage
+-//
+-//    Removes all visits and the main history entry for the given URI.
+-//    Silently fails if we have no knowledge of the page.
+-
+-NS_IMETHODIMP
+-nsNavHistory::RemovePage(nsIURI *aURI)
+-{
+-  PLACES_WARN_DEPRECATED();
+-  NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
+-  NS_ENSURE_ARG(aURI);
+-
+-  // Build a list of place ids to delete.
+-  int64_t placeId;
+-  nsAutoCString guid;
+-  nsresult rv = GetIdForPage(aURI, &placeId, guid);
+-  NS_ENSURE_SUCCESS(rv, rv);
+-  if (placeId == 0) {
+-    return NS_OK;
+-  }
+-  nsAutoCString deletePlaceIdQueryString;
+-  deletePlaceIdQueryString.AppendInt(placeId);
+-
+-  rv = RemovePagesInternal(deletePlaceIdQueryString);
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+-  // Clear the registered embed visits.
+-  clearEmbedVisits();
+-
+-  return NS_OK;
+-}
+-
+-
+ // nsNavHistory::RemovePagesFromHost
+ //
+ //    This function will delete all history information about pages from a
+ //    given host. If aEntireDomain is set, we will also delete pages from
+ //    sub hosts (so if we are passed in "microsoft.com" we delete
+ //    "www.microsoft.com", "msdn.microsoft.com", etc.). An empty host name
+ //    means local files and anything else with no host name. You can also pass
+ //    in the localized "(local files)" title given to you from a history query.
+diff --git a/toolkit/components/places/nsTaggingService.js b/toolkit/components/places/nsTaggingService.js
+--- a/toolkit/components/places/nsTaggingService.js
++++ b/toolkit/components/places/nsTaggingService.js
+@@ -1,18 +1,16 @@
+ /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
+  * This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ ChromeUtils.import("resource://gre/modules/Services.jsm");
+ ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+-ChromeUtils.defineModuleGetter(this, "Deprecated",
+-                               "resource://gre/modules/Deprecated.jsm");
+ 
+ const TOPIC_SHUTDOWN = "places-shutdown";
+ 
+ /**
+  * The Places Tagging Service
+  */
+ function TaggingService() {
+   // Observe bookmarks changes.
+@@ -212,18 +210,18 @@ TaggingService.prototype = {
+       aTags = this.getTagsForURI(aURI);
+     }
+ 
+     // This also does some input validation.
+     let tags = this._convertInputMixedTagsArray(aTags);
+ 
+     let isAnyTagNotTrimmed = tags.some(tag => /^\s|\s$/.test(tag.name));
+     if (isAnyTagNotTrimmed) {
+-      Deprecated.warning("At least one tag passed to untagURI was not trimmed",
+-                         "https://bugzilla.mozilla.org/show_bug.cgi?id=967196");
++      throw Components.Exception("At least one tag passed to untagURI was not trimmed",
++                                 Cr.NS_ERROR_INVALID_ARG);
+     }
+ 
+     for (let tag of tags) {
+       if (tag.id != -1) {
+         // A tag could exist.
+         let itemId = this._getItemIdForTaggedURI(aURI, tag.name);
+         if (itemId != -1) {
+           // There is a tagged item.
+@@ -235,18 +233,18 @@ TaggingService.prototype = {
+ 
+   // nsITaggingService
+   getURIsForTag: function TS_getURIsForTag(aTagName) {
+     if (!aTagName || aTagName.length == 0) {
+       throw Components.Exception("Invalid tag name", Cr.NS_ERROR_INVALID_ARG);
+     }
+ 
+     if (/^\s|\s$/.test(aTagName)) {
+-      Deprecated.warning("Tag passed to getURIsForTag was not trimmed",
+-                         "https://bugzilla.mozilla.org/show_bug.cgi?id=967196");
++      throw Components.Exception("Tag passed to getURIsForTag was not trimmed",
++                                 Cr.NS_ERROR_INVALID_ARG);
+     }
+ 
+     let uris = [];
+     let tagId = this._getItemIdForTag(aTagName);
+     if (tagId == -1)
+       return uris;
+ 
+     let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
+diff --git a/toolkit/components/places/tests/unit/test_browserhistory.js b/toolkit/components/places/tests/unit/test_browserhistory.js
+--- a/toolkit/components/places/tests/unit/test_browserhistory.js
++++ b/toolkit/components/places/tests/unit/test_browserhistory.js
+@@ -69,38 +69,38 @@ add_task(async function test_removePages
+       uri: NetUtil.newURI(TEST_URI.spec + i),
+       visitDate: startDate + i * 1000
+     });
+   }
+ 
+   await PlacesTestUtils.addVisits(visits);
+ 
+   // Delete all pages except the first and the last.
+-  PlacesUtils.bhistory.removePagesByTimeframe(startDate + 1000, startDate + 8000);
++  PlacesUtils.history.removePagesByTimeframe(startDate + 1000, startDate + 8000);
+ 
+   // Check that we have removed the correct pages.
+   for (let i = 0; i < 10; i++) {
+     Assert.equal(page_in_database(NetUtil.newURI(TEST_URI.spec + i)) == 0,
+                  i > 0 && i < 9);
+   }
+ 
+   // Clear remaining items and check that all pages have been removed.
+-  PlacesUtils.bhistory.removePagesByTimeframe(startDate, startDate + 9000);
++  PlacesUtils.history.removePagesByTimeframe(startDate, startDate + 9000);
+   Assert.equal(0, PlacesUtils.history.hasHistoryEntries);
+ });
+ 
+ add_task(async function test_removePagesFromHost() {
+   await PlacesTestUtils.addVisits(TEST_URI);
+-  PlacesUtils.bhistory.removePagesFromHost("mozilla.com", true);
++  PlacesUtils.history.removePagesFromHost("mozilla.com", true);
+   Assert.equal(0, PlacesUtils.history.hasHistoryEntries);
+ });
+ 
+ add_task(async function test_removePagesFromHost_keepSubdomains() {
+   await PlacesTestUtils.addVisits([{ uri: TEST_URI }, { uri: TEST_SUBDOMAIN_URI }]);
+-  PlacesUtils.bhistory.removePagesFromHost("mozilla.com", false);
++  PlacesUtils.history.removePagesFromHost("mozilla.com", false);
+   Assert.equal(1, PlacesUtils.history.hasHistoryEntries);
+ });
+ 
+ add_task(async function test_history_clear() {
+   await PlacesTestUtils.clearHistory();
+   Assert.equal(0, PlacesUtils.history.hasHistoryEntries);
+ });
+ 

+ 110 - 0
mozilla-release/patches/1465884-62a1.patch

@@ -0,0 +1,110 @@
+# HG changeset patch
+# User Daniel Holbert <dholbert@cs.stanford.edu>
+# Date 1527795177 25200
+# Node ID 9fd9a942834c8dff3f0e9935498d4ed5f854beb9
+# Parent  e819d35adad2b100bbb5d62c4006df810e0f5a72
+Bug 1465884: Back out no-longer-needed diagnostic for networking crash. r=mcmanus
+
+This commit is a (rebased) backout of changeset 016bcae14073 from bug 1322610,
+which simply added a diagnostic to gather more information about a crash.
+We can remove that diagnostic now, hence this commit.
+
+MozReview-Commit-ID: 6ea7SAX4PSV
+
+diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp
+--- a/netwerk/protocol/http/HttpChannelChild.cpp
++++ b/netwerk/protocol/http/HttpChannelChild.cpp
+@@ -64,20 +64,16 @@
+ #endif
+ 
+ using namespace mozilla::dom;
+ using namespace mozilla::ipc;
+ 
+ namespace mozilla {
+ namespace net {
+ 
+-#if defined(NIGHTLY_BUILD) || defined(MOZ_DEV_EDITION) || defined(DEBUG)
+-static bool gIPCSecurityDisabled = false;
+-#endif
+-
+ NS_IMPL_ISUPPORTS(InterceptStreamListener,
+                   nsIStreamListener,
+                   nsIRequestObserver,
+                   nsIProgressEventSink)
+ 
+ NS_IMETHODIMP
+ InterceptStreamListener::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
+ {
+@@ -188,25 +184,16 @@ HttpChannelChild::HttpChannelChild()
+ {
+   LOG(("Creating HttpChannelChild @%p\n", this));
+ 
+   mChannelCreationTime = PR_Now();
+   mChannelCreationTimestamp = TimeStamp::Now();
+   mAsyncOpenTime = TimeStamp::Now();
+   mEventQ = new ChannelEventQueue(static_cast<nsIHttpChannel*>(this));
+ 
+-#if defined(NIGHTLY_BUILD) || defined(MOZ_DEV_EDITION) || defined(DEBUG)
+-  static bool sSecurityPrefChecked = false;
+-  if (!sSecurityPrefChecked) {
+-    Preferences::AddBoolVarCache(&gIPCSecurityDisabled,
+-                                 "network.disable.ipc.security");
+-    sSecurityPrefChecked = true;
+-  }
+-#endif
+-
+   // Ensure that the cookie service is initialized before the first
+   // IPC HTTP channel is created.
+   // We require that the parent cookie service actor exists while
+   // processing HTTP responses.
+   RefPtr<CookieServiceChild> cookieService = CookieServiceChild::GetSingleton();
+ }
+ 
+ HttpChannelChild::~HttpChannelChild()
+@@ -2174,22 +2161,19 @@ HttpChannelChild::ConnectParent(uint32_t
+   // This must happen before the constructor message is sent. Otherwise messages
+   // from the parent could arrive quickly and be delivered to the wrong event
+   // target.
+   SetEventTarget();
+ 
+   HttpChannelConnectArgs connectArgs(registrarId, mShouldParentIntercept);
+   PBrowserOrId browser = static_cast<ContentChild*>(gNeckoChild->Manager())
+                          ->GetBrowserOrId(tabChild);
+-  IPC::SerializedLoadContext slc(this);
+-  MOZ_DIAGNOSTIC_ASSERT(gIPCSecurityDisabled || slc.IsNotNull(),
+-                        "SerializedLoadContext should not be null");
+   if (!gNeckoChild->
+         SendPHttpChannelConstructor(this, browser,
+-                                    slc,
++                                    IPC::SerializedLoadContext(this),
+                                     connectArgs)) {
+     return NS_ERROR_FAILURE;
+   }
+ 
+   {
+     MutexAutoLock lock(mBgChildMutex);
+ 
+     MOZ_ASSERT(!mBgChild);
+@@ -2867,21 +2851,18 @@ HttpChannelChild::ContinueAsyncOpen()
+   // target.
+   SetEventTarget();
+ 
+   // The socket transport in the chrome process now holds a logical ref to us
+   // until OnStopRequest, or we do a redirect, or we hit an IPDL error.
+   AddIPDLReference();
+ 
+   PBrowserOrId browser = cc->GetBrowserOrId(tabChild);
+-  IPC::SerializedLoadContext slc(this);
+-  MOZ_DIAGNOSTIC_ASSERT(gIPCSecurityDisabled || slc.IsNotNull(),
+-                        "SerializedLoadContext should not be null");
+   if (!gNeckoChild->SendPHttpChannelConstructor(this, browser,
+-                                                slc,
++                                                IPC::SerializedLoadContext(this),
+                                                 openArgs)) {
+     return NS_ERROR_FAILURE;
+   }
+ 
+   {
+     MutexAutoLock lock(mBgChildMutex);
+ 
+     MOZ_RELEASE_ASSERT(gSocketTransportService);

+ 7 - 2
mozilla-release/patches/series

@@ -7650,16 +7650,23 @@ TOP-NOBUG-nsstyle-prefers-reduced-motion.patch
 TOP-1909714-NSS3904-11514.patch
 TOP-NOBUG-blockquad0-25319.patch
 TOP-NOBUG-fixnasmcheck-25320.patch
+TOP-NOBUG-1712804fix-25320.patch
+1913633-mar-mc-addendum-id-25320.patch
 1395438-57a1.patch
 1400975-57a1.patch
+1395526-58a1.patch
+1405687-58a1.patch
 1432403-60a1.patch
 977538-61a1.patch
+1465884-62a1.patch
 1479945-1no2-63a1.patch
 1479945-3no4-63a1.patch
 1493449-64a1.patch
 1564097-72a1.patch
 1563403-2-73a1.patch
 1601872-73a1.patch
+1322254-77a1.patch
+1319881-77a1.patch
 1671424-84a1.patch
 1683797-1-88a1.patch
 1683797-2-88a1.patch
@@ -7680,5 +7687,3 @@ TOP-NOBUG-fixnasmcheck-25320.patch
 1862395-incorrect-version-resistfingerprinting-v2-25320.patch
 1737436-use-mozilla-compat-version-define-25320.patch
 9999999-removebinary-25320.patch
-TOP-NOBUG-1712804fix-25320.patch
-1913633-mar-mc-addendum-id-25320.patch