/src/mozilla-central/netwerk/base/nsAuthInformationHolder.cpp
Line | Count | Source (jump to first uncovered line) |
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/. */ |
4 | | |
5 | | #include "nsAuthInformationHolder.h" |
6 | | |
7 | | NS_IMPL_ISUPPORTS(nsAuthInformationHolder, nsIAuthInformation) |
8 | | |
9 | | NS_IMETHODIMP |
10 | | nsAuthInformationHolder::GetFlags(uint32_t* aFlags) |
11 | 0 | { |
12 | 0 | *aFlags = mFlags; |
13 | 0 | return NS_OK; |
14 | 0 | } |
15 | | |
16 | | NS_IMETHODIMP |
17 | | nsAuthInformationHolder::GetRealm(nsAString& aRealm) |
18 | 0 | { |
19 | 0 | aRealm = mRealm; |
20 | 0 | return NS_OK; |
21 | 0 | } |
22 | | |
23 | | NS_IMETHODIMP |
24 | | nsAuthInformationHolder::GetAuthenticationScheme(nsACString& aScheme) |
25 | 0 | { |
26 | 0 | aScheme = mAuthType; |
27 | 0 | return NS_OK; |
28 | 0 | } |
29 | | |
30 | | NS_IMETHODIMP |
31 | | nsAuthInformationHolder::GetUsername(nsAString& aUserName) |
32 | 0 | { |
33 | 0 | aUserName = mUser; |
34 | 0 | return NS_OK; |
35 | 0 | } |
36 | | |
37 | | NS_IMETHODIMP |
38 | | nsAuthInformationHolder::SetUsername(const nsAString& aUserName) |
39 | 0 | { |
40 | 0 | if (!(mFlags & ONLY_PASSWORD)) |
41 | 0 | mUser = aUserName; |
42 | 0 | return NS_OK; |
43 | 0 | } |
44 | | |
45 | | NS_IMETHODIMP |
46 | | nsAuthInformationHolder::GetPassword(nsAString& aPassword) |
47 | 0 | { |
48 | 0 | aPassword = mPassword; |
49 | 0 | return NS_OK; |
50 | 0 | } |
51 | | |
52 | | NS_IMETHODIMP |
53 | | nsAuthInformationHolder::SetPassword(const nsAString& aPassword) |
54 | 0 | { |
55 | 0 | mPassword = aPassword; |
56 | 0 | return NS_OK; |
57 | 0 | } |
58 | | |
59 | | NS_IMETHODIMP |
60 | | nsAuthInformationHolder::GetDomain(nsAString& aDomain) |
61 | 0 | { |
62 | 0 | aDomain = mDomain; |
63 | 0 | return NS_OK; |
64 | 0 | } |
65 | | |
66 | | NS_IMETHODIMP |
67 | | nsAuthInformationHolder::SetDomain(const nsAString& aDomain) |
68 | 0 | { |
69 | 0 | if (mFlags & NEED_DOMAIN) |
70 | 0 | mDomain = aDomain; |
71 | 0 | return NS_OK; |
72 | 0 | } |
73 | | |
74 | | |