Bug 1596843 - Part 2: Stop exposing nsIPermissionManager.removePermissionsWithAttributes(); r=baku
☠☠ backed out by de185bb7bdd5 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 17 Nov 2019 07:23:29 +0000
changeset 502350 8b2220bc47afa4a203e32530f73fd34e1fd9b687
parent 502349 b10aec041377e78814a6e6073cdead9e817bef00
child 502351 a9827fae8655ff42f431f8073ad54a29b1def620
push id100781
push userrgurzau@mozilla.com
push dateSun, 17 Nov 2019 08:13:28 +0000
treeherderautoland@69ee727d5b45 [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
@@ -2646,18 +2646,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.