netwerk/base/src/nsAuthInformationHolder.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 #include "nsAuthInformationHolder.h"
     7 NS_IMPL_ISUPPORTS(nsAuthInformationHolder, nsIAuthInformation)
     9 NS_IMETHODIMP
    10 nsAuthInformationHolder::GetFlags(uint32_t* aFlags)
    11 {
    12     *aFlags = mFlags;
    13     return NS_OK;
    14 }
    16 NS_IMETHODIMP
    17 nsAuthInformationHolder::GetRealm(nsAString& aRealm)
    18 {
    19     aRealm = mRealm;
    20     return NS_OK;
    21 }
    23 NS_IMETHODIMP
    24 nsAuthInformationHolder::GetAuthenticationScheme(nsACString& aScheme)
    25 {
    26     aScheme = mAuthType;
    27     return NS_OK;
    28 }
    30 NS_IMETHODIMP
    31 nsAuthInformationHolder::GetUsername(nsAString& aUserName)
    32 {
    33     aUserName = mUser;
    34     return NS_OK;
    35 }
    37 NS_IMETHODIMP
    38 nsAuthInformationHolder::SetUsername(const nsAString& aUserName)
    39 {
    40     if (!(mFlags & ONLY_PASSWORD))
    41         mUser = aUserName;
    42     return NS_OK;
    43 }
    45 NS_IMETHODIMP
    46 nsAuthInformationHolder::GetPassword(nsAString& aPassword)
    47 {
    48     aPassword = mPassword;
    49     return NS_OK;
    50 }
    52 NS_IMETHODIMP
    53 nsAuthInformationHolder::SetPassword(const nsAString& aPassword)
    54 {
    55     mPassword = aPassword;
    56     return NS_OK;
    57 }
    59 NS_IMETHODIMP
    60 nsAuthInformationHolder::GetDomain(nsAString& aDomain)
    61 {
    62     aDomain = mDomain;
    63     return NS_OK;
    64 }
    66 NS_IMETHODIMP
    67 nsAuthInformationHolder::SetDomain(const nsAString& aDomain)
    68 {
    69     if (mFlags & NEED_DOMAIN)
    70         mDomain = aDomain;
    71     return NS_OK;
    72 }

mercurial