Bug 1596843 - Part 1: Remove the unused nsIPermissionManager.testPermissionFromWindow() method; r=baku
☠☠ backed out by 7553b88698cb ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 17 Nov 2019 20:06:04 +0000
changeset 502348 88e8383dc3e414a821bd3f5ef961919f764604f9
parent 502347 04cd216d7e69f37dbdf74e4993b0e283d4b39283
child 502349 691397c2fde6e014ee3ba7565e483dbbc6b0c428
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 1: Remove the unused nsIPermissionManager.testPermissionFromWindow() method; r=baku Differential Revision: https://phabricator.services.mozilla.com/D53237
extensions/permissions/nsPermissionManager.cpp
netwerk/base/nsIPermissionManager.idl
--- a/extensions/permissions/nsPermissionManager.cpp
+++ b/extensions/permissions/nsPermissionManager.cpp
@@ -2245,31 +2245,16 @@ nsresult nsPermissionManager::LegacyTest
     nsIURI* aURI, const mozilla::OriginAttributes* aOriginAttributes,
     const nsACString& aType, uint32_t* aPermission) {
   return CommonTestPermission(aURI, aOriginAttributes, -1, aType, aPermission,
                               nsIPermissionManager::UNKNOWN_ACTION, false,
                               false, true);
 }
 
 NS_IMETHODIMP
-nsPermissionManager::TestPermissionFromWindow(mozIDOMWindow* aWindow,
-                                              const nsACString& aType,
-                                              uint32_t* aPermission) {
-  NS_ENSURE_ARG(aWindow);
-  nsCOMPtr<nsPIDOMWindowInner> window = nsPIDOMWindowInner::From(aWindow);
-
-  // Get the document for security check
-  RefPtr<Document> document = window->GetExtantDoc();
-  NS_ENSURE_TRUE(document, NS_NOINTERFACE);
-
-  nsCOMPtr<nsIPrincipal> principal = document->NodePrincipal();
-  return TestPermissionFromPrincipal(principal, aType, aPermission);
-}
-
-NS_IMETHODIMP
 nsPermissionManager::TestPermissionFromPrincipal(nsIPrincipal* aPrincipal,
                                                  const nsACString& aType,
                                                  uint32_t* aPermission) {
   return CommonTestPermission(aPrincipal, -1, aType, aPermission,
                               nsIPermissionManager::UNKNOWN_ACTION, false,
                               false, true);
 }
 
--- a/netwerk/base/nsIPermissionManager.idl
+++ b/netwerk/base/nsIPermissionManager.idl
@@ -27,17 +27,16 @@
  *          "cleared"
  *          the entire permission list was cleared. the subject is null.
  */
 
 #include "nsISupports.idl"
 
 interface nsIObserver;
 interface nsIPrincipal;
-interface mozIDOMWindow;
 interface nsIPermission;
 interface nsIRunnable;
 
 %{ C++
 namespace IPC {
 struct Permission;
 }
 #include "nsTArrayForwardDeclare.h"
@@ -148,26 +147,16 @@ interface nsIPermissionManager : nsISupp
    * System principals will always have permissions granted.
    * This function will perform a pref lookup to permissions.default.<type>
    * if the specific permission type is part of the whitelist for that functionality.
    */
   uint32_t testPermissionFromPrincipal(in nsIPrincipal principal,
                                        in ACString type);
 
   /**
-   * Test whether the principal associated with the window's document has the
-   * permission to perform a given action.  System principals will always
-   * have permissions granted.
-   * This function will perform a pref lookup to permissions.default.<type>
-   * if the specific permission type is part of the whitelist for that functionality.
-   */
-  uint32_t testPermissionFromWindow(in mozIDOMWindow window,
-                                    in ACString type);
-
-  /**
    * See testExactPermission() above.
    * System principals will always have permissions granted.
    * This function will perform a pref lookup to permissions.default.<type>
    * if the specific permission type is part of the whitelist for that functionality.
    */
   uint32_t testExactPermissionFromPrincipal(in nsIPrincipal principal,
                                             in ACString type);