Bug 1731994: part 2) Add some documentation to `ContentPermissionRequestBase`'s constructor. r=edgar
authorMirko Brodesser <mbrodesser@mozilla.com>
Thu, 23 Sep 2021 08:48:17 +0000
changeset 593023 5dece26f14db8ee184ce88f0fd0df645d0be8640
parent 593022 9ba235034c43eb01175931d005acb806ea4b8ef0
child 593024 a4d5bf7a3369b0df728c2211eee1d56ee1e10c85
push id38820
push usersmolnar@mozilla.com
push dateThu, 23 Sep 2021 21:45:25 +0000
treeherdermozilla-central@4eda9eb8926b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedgar
bugs1731994
milestone94.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 1731994: part 2) Add some documentation to `ContentPermissionRequestBase`'s constructor. r=edgar Differential Revision: https://phabricator.services.mozilla.com/D126338
dom/base/nsContentPermissionHelper.h
--- a/dom/base/nsContentPermissionHelper.h
+++ b/dom/base/nsContentPermissionHelper.h
@@ -131,26 +131,34 @@ class ContentPermissionRequestBase : pub
   enum class DelayedTaskType {
     Allow,
     Deny,
     Request,
   };
   void RequestDelayedTask(nsIEventTarget* aTarget, DelayedTaskType aType);
 
  protected:
+  // @param aPrefName see `mPrefName`.
   ContentPermissionRequestBase(nsIPrincipal* aPrincipal,
                                nsPIDOMWindowInner* aWindow,
                                const nsACString& aPrefName,
                                const nsACString& aType);
   virtual ~ContentPermissionRequestBase() = default;
 
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsIPrincipal> mTopLevelPrincipal;
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   RefPtr<PermissionDelegateHandler> mPermissionHandler;
+
+  // The prefix of a pref which allows tests to bypass showing the prompt.
+  // Tests will have to set both of
+  // ${mPrefName}.prompt.testing and
+  // ${mPrefName}.prompt.testing.allow
+  // to either true or false. If no such testing is required, mPrefName may be
+  // empty.
   const nsCString mPrefName;
   const nsCString mType;
   bool mIsHandlingUserInput;
   bool mMaybeUnsafePermissionDelegate;
 };
 
 }  // namespace dom
 }  // namespace mozilla