Bug 1596843 - Part 2: Stop exposing nsIPermissionManager.removePermissionsWithAttributes(); r=baku
☠☠ backed out by 7553b88698cb ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 17 Nov 2019 20:06:06 +0000
changeset 502349 691397c2fde6e014ee3ba7565e483dbbc6b0c428
parent 502348 88e8383dc3e414a821bd3f5ef961919f764604f9
child 502350 b9061f93d0457fb2672fb466c9611aa464f71dd5
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1596843
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1596843 - Part 2: Stop exposing nsIPermissionManager.removePermissionsWithAttributes(); r=baku Differential Revision: https://phabricator.services.mozilla.com/D53238
extensions/permissions/nsPermissionManager.cpp
extensions/permissions/nsPermissionManager.h
netwerk/base/nsIPermissionManager.idl
--- a/extensions/permissions/nsPermissionManager.cpp
+++ b/extensions/permissions/nsPermissionManager.cpp
@@ -2617,18 +2617,17 @@ nsresult nsPermissionManager::RemoveAllM
   ENSURE_NOT_CHILD_PROCESS;
 
   return RemovePermissionEntries(
       [aModificationTime](const PermissionEntry& aPermEntry) {
         return aModificationTime <= aPermEntry.mModificationTime;
       });
 }
 
-NS_IMETHODIMP
-nsPermissionManager::RemovePermissionsWithAttributes(
+nsresult nsPermissionManager::RemovePermissionsWithAttributes(
     const nsAString& aPattern) {
   ENSURE_NOT_CHILD_PROCESS;
   mozilla::OriginAttributesPattern pattern;
   if (!pattern.Init(aPattern)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   return RemovePermissionsWithAttributes(pattern);
--- a/extensions/permissions/nsPermissionManager.h
+++ b/extensions/permissions/nsPermissionManager.h
@@ -201,19 +201,16 @@ class nsPermissionManager final : public
    * Initialize the permission-manager service.
    * The permission manager is always initialized at startup because when it
    * was lazy-initialized on demand, it was possible for it to be created
    * once shutdown had begun, resulting in the manager failing to correctly
    * shutdown because it missed its shutdown observer notification.
    */
   static void Startup();
 
-  nsresult RemovePermissionsWithAttributes(
-      mozilla::OriginAttributesPattern& aAttrs);
-
   /**
    * See `nsIPermissionManager::GetPermissionsWithKey` for more info on
    * permission keys.
    *
    * Get the permission key corresponding to the given Principal. This method is
    * intentionally infallible, as we want to provide an permission key to every
    * principal. Principals which don't have meaningful URIs with http://,
    * https://, or ftp:// schemes are given the default "" Permission Key.
@@ -522,16 +519,20 @@ class nsPermissionManager final : public
   /**
    * This method removes all permissions modified after the specified time.
    */
   nsresult RemoveAllModifiedSince(int64_t aModificationTime);
 
   template <class T>
   nsresult RemovePermissionEntries(T aCondition);
 
+  nsresult RemovePermissionsWithAttributes(const nsAString& aPattern);
+  nsresult RemovePermissionsWithAttributes(
+      mozilla::OriginAttributesPattern& aAttrs);
+
   nsRefPtrHashtable<nsCStringHashKey,
                     mozilla::GenericNonExclusivePromise::Private>
       mPermissionKeyPromiseMap;
 
   nsCOMPtr<mozIStorageConnection> mDBConn;
   nsCOMPtr<mozIStorageAsyncStatement> mStmtInsert;
   nsCOMPtr<mozIStorageAsyncStatement> mStmtDelete;
   nsCOMPtr<mozIStorageAsyncStatement> mStmtUpdate;
--- a/netwerk/base/nsIPermissionManager.idl
+++ b/netwerk/base/nsIPermissionManager.idl
@@ -194,21 +194,16 @@ interface nsIPermissionManager : nsISupp
 
   /**
    * Returns all stored permissions.
    * @return an array of nsIPermission objects
    */
   readonly attribute Array<nsIPermission> all;
 
   /**
-   * Remove all permissions that will match the origin pattern.
-   */
-  void removePermissionsWithAttributes(in AString patternAsJSON);
-
-  /**
    * If the current permission is set to expire, reset the expiration time. If
    * there is no permission or the current permission does not expire, this
    * method will silently return.
    *
    * @param sessionExpiretime  an integer representation of when this permission
    *                           should be forgotten (milliseconds since
    *                           Jan 1 1970 0:00:00), if it is currently
    *                           EXPIRE_SESSION.