Bug 1596843 - Part 1: Remove the unused nsIPermissionManager.testPermissionFromWindow() method; r=baku
☠☠ backed out by de185bb7bdd5 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 17 Nov 2019 07:23:27 +0000
changeset 502349 b10aec041377e78814a6e6073cdead9e817bef00
parent 502348 69773bf582aaf07359f93e043c45728bb2224b31
child 502350 8b2220bc47afa4a203e32530f73fd34e1fd9b687
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 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
@@ -2274,31 +2274,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);