CookieService::GetSessionCookies Interface implementation may have a clerical error
Categories
(Core :: Networking: Cookies, defect, P3)
Tracking
()
People
(Reporter: linxin19812012, Assigned: edgul)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0
Steps to reproduce:
Here is my test code for
...
nsresult rv0;
nsCOMPtr<nsICookieManager> cookieMgr = do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv0);
nsTArray<RefPtr<nsICookie>> aCookies;
cookieMgr->GetCookies(aCookies);
nsTArray<RefPtr<nsICookie>> aSessionCookies;
cookieMgr->GetSessionCookies(aSessionCookies);
...
Actual results:
The obtained aCookies and aSessionCookies data are identical.
It is found that the two interface implementations are identical. I guess this is a clerical error.
NS_IMETHODIMP
CookieService::GetCookies(nsTArray<RefPtr<nsICookie>>& aCookies) {
if (!IsInitialized()) {
return NS_ERROR_NOT_AVAILABLE;
}
mPersistentStorage->EnsureInitialized();
// We expose only non-private cookies.
mPersistentStorage->GetCookies(aCookies);
return NS_OK;
}
NS_IMETHODIMP
CookieService::GetSessionCookies(nsTArray<RefPtr<nsICookie>>& aCookies) {
if (!IsInitialized()) {
return NS_ERROR_NOT_AVAILABLE;
}
mPersistentStorage->EnsureInitialized();
// We expose only non-private cookies.
mPersistentStorage->GetCookies(aCookies);
return NS_OK;
}
CookieStorage provides two interfaces: GetCookies and GetSessionCookies, but only one is called here.
class CookieStorage : public nsIObserver, public nsSupportsWeakReference {
public:
void GetCookies(nsTArray<RefPtr<nsICookie>>& aCookies) const;
void GetSessionCookies(nsTArray<RefPtr<nsICookie>>& aCookies) const;
...
Comment 2•3 years ago
|
||
Setting this to Core > Networking: Cookies, if this is not the right component, please move it to the correct one. Thanks!
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Indeed. The line here should be mPersistentStorage->GetSessionCookies(aCookies);
Updated•3 years ago
|
Comment 4•3 years ago
|
||
:baku, since you are the author of the regressor, bug 1624146, could you take a look?
For more information, please visit auto_nag documentation.
Comment 8•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Description
•