fix the XPCOM out-param memory ownership issue of bug 60304 "Basic Auth

doesn't work for Java"
patch = joshua.xia; r = jst; sr = darin
This commit is contained in:
louie.zhao%sun.com 2003-04-02 03:52:56 +00:00
Родитель fe29432f2a
Коммит 412f75987b
2 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -34,6 +34,7 @@
%}
[ptr] native const_char_ptr(const char);
[noscript, uuid(078a1b99-6be2-4a57-a749-378f4a506097)]
interface nsIAuthenticationInfo : nsISupports
@ -42,8 +43,8 @@ interface nsIAuthenticationInfo : nsISupports
* AuthenticationInfo (username/password pair)
*/
readonly attribute string username;
readonly attribute string password;
readonly attribute const_char_ptr username;
readonly attribute const_char_ptr password;
};
[noscript, uuid(82274a32-a196-42ee-8e3b-fcb73e339518)]

Просмотреть файл

@ -66,14 +66,14 @@ nsAuthenticationInfoImp::~nsAuthenticationInfoImp()
}
/* readonly attribute string username; */
NS_IMETHODIMP nsAuthenticationInfoImp::GetUsername(char * *aUsername)
NS_IMETHODIMP nsAuthenticationInfoImp::GetUsername(const char * *aUsername)
{
*aUsername = mUserName;
return NS_OK;
}
/* readonly attribute string password; */
NS_IMETHODIMP nsAuthenticationInfoImp::GetPassword(char * *aPassword)
NS_IMETHODIMP nsAuthenticationInfoImp::GetPassword(const char * *aPassword)
{
*aPassword = mPassWord;
return NS_OK;