Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / netwerk / base / nsAuthInformationHolder.h
blob48054d9413016747235fe9d50d06891d7706e8fc
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef NSAUTHINFORMATIONHOLDER_H_
6 #define NSAUTHINFORMATIONHOLDER_H_
8 #include "nsIAuthInformation.h"
9 #include "nsString.h"
11 class nsAuthInformationHolder : public nsIAuthInformation {
12 protected:
13 virtual ~nsAuthInformationHolder() = default;
15 public:
16 // aAuthType must be ASCII
17 nsAuthInformationHolder(uint32_t aFlags, const nsString& aRealm,
18 const nsACString& aAuthType)
19 : mFlags(aFlags), mRealm(aRealm), mAuthType(aAuthType) {}
21 NS_DECL_ISUPPORTS
22 NS_DECL_NSIAUTHINFORMATION
24 const nsString& User() const { return mUser; }
25 const nsString& Password() const { return mPassword; }
26 const nsString& Domain() const { return mDomain; }
28 /**
29 * This method can be used to initialize the username when the
30 * ONLY_PASSWORD flag is set.
32 void SetUserInternal(const nsString& aUsername) { mUser = aUsername; }
34 private:
35 nsString mUser;
36 nsString mPassword;
37 nsString mDomain;
39 uint32_t mFlags;
40 nsString mRealm;
41 nsCString mAuthType;
44 #endif