auth.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2011 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "net/base/auth.h" 6#include "net/base/zap.h" 7 8namespace net { 9 10AuthChallengeInfo::AuthChallengeInfo() : is_proxy(false) { 11} 12 13bool AuthChallengeInfo::Equals(const AuthChallengeInfo& that) const { 14 return (this->is_proxy == that.is_proxy && 15 this->challenger.Equals(that.challenger) && 16 this->scheme == that.scheme && 17 this->realm == that.realm); 18} 19 20AuthChallengeInfo::~AuthChallengeInfo() { 21} 22 23AuthData::AuthData() : state(AUTH_STATE_NEED_AUTH) { 24} 25 26AuthData::~AuthData() { 27} 28 29AuthCredentials::AuthCredentials() { 30} 31 32AuthCredentials::AuthCredentials(const string16& username, 33 const string16& password) 34 : username_(username), 35 password_(password) { 36} 37 38AuthCredentials::~AuthCredentials() { 39} 40 41void AuthCredentials::Set(const string16& username, const string16& password) { 42 username_ = username; 43 password_ = password; 44} 45 46bool AuthCredentials::Equals(const AuthCredentials& other) const { 47 return username_ == other.username_ && password_ == other.password_; 48} 49 50bool AuthCredentials::Empty() const { 51 return username_.empty() && password_.empty(); 52} 53 54void AuthCredentials::Zap() { 55 ZapString(&password_); 56} 57 58} // namespace net 59