1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/src/nsAuthInformationHolder.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,74 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsAuthInformationHolder.h" 1.9 + 1.10 +NS_IMPL_ISUPPORTS(nsAuthInformationHolder, nsIAuthInformation) 1.11 + 1.12 +NS_IMETHODIMP 1.13 +nsAuthInformationHolder::GetFlags(uint32_t* aFlags) 1.14 +{ 1.15 + *aFlags = mFlags; 1.16 + return NS_OK; 1.17 +} 1.18 + 1.19 +NS_IMETHODIMP 1.20 +nsAuthInformationHolder::GetRealm(nsAString& aRealm) 1.21 +{ 1.22 + aRealm = mRealm; 1.23 + return NS_OK; 1.24 +} 1.25 + 1.26 +NS_IMETHODIMP 1.27 +nsAuthInformationHolder::GetAuthenticationScheme(nsACString& aScheme) 1.28 +{ 1.29 + aScheme = mAuthType; 1.30 + return NS_OK; 1.31 +} 1.32 + 1.33 +NS_IMETHODIMP 1.34 +nsAuthInformationHolder::GetUsername(nsAString& aUserName) 1.35 +{ 1.36 + aUserName = mUser; 1.37 + return NS_OK; 1.38 +} 1.39 + 1.40 +NS_IMETHODIMP 1.41 +nsAuthInformationHolder::SetUsername(const nsAString& aUserName) 1.42 +{ 1.43 + if (!(mFlags & ONLY_PASSWORD)) 1.44 + mUser = aUserName; 1.45 + return NS_OK; 1.46 +} 1.47 + 1.48 +NS_IMETHODIMP 1.49 +nsAuthInformationHolder::GetPassword(nsAString& aPassword) 1.50 +{ 1.51 + aPassword = mPassword; 1.52 + return NS_OK; 1.53 +} 1.54 + 1.55 +NS_IMETHODIMP 1.56 +nsAuthInformationHolder::SetPassword(const nsAString& aPassword) 1.57 +{ 1.58 + mPassword = aPassword; 1.59 + return NS_OK; 1.60 +} 1.61 + 1.62 +NS_IMETHODIMP 1.63 +nsAuthInformationHolder::GetDomain(nsAString& aDomain) 1.64 +{ 1.65 + aDomain = mDomain; 1.66 + return NS_OK; 1.67 +} 1.68 + 1.69 +NS_IMETHODIMP 1.70 +nsAuthInformationHolder::SetDomain(const nsAString& aDomain) 1.71 +{ 1.72 + if (mFlags & NEED_DOMAIN) 1.73 + mDomain = aDomain; 1.74 + return NS_OK; 1.75 +} 1.76 + 1.77 +