1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_net_CookiePrivateStorage_h
7 #define mozilla_net_CookiePrivateStorage_h
9 #include "CookieStorage.h"
11 class nsICookieTransactionCallback
;
16 class CookiePrivateStorage final
: public CookieStorage
{
18 static already_AddRefed
<CookiePrivateStorage
> Create();
20 void StaleCookies(const nsTArray
<Cookie
*>& aCookieList
,
21 int64_t aCurrentTimeInUsec
) override
;
23 void Close() override
{};
25 void EnsureInitialized() override
{};
27 nsresult
RunInTransaction(nsICookieTransactionCallback
* aCallback
) override
{
28 // It might make sense for this to be a no-op, or to return
29 // `NS_ERROR_NOT_AVAILABLE`, or to evalute `aCallback` (in case it has
30 // side-effects), but for now, just crash.
31 MOZ_CRASH("RunInTransaction is not supported for private storage");
35 const char* NotificationTopic() const override
{
36 return "private-cookie-changed";
39 void NotifyChangedInternal(nsICookieNotification
* aNotification
,
40 bool aOldCookieIsSession
) override
{}
42 void RemoveAllInternal() override
{}
44 void RemoveCookieFromDB(const Cookie
& aCookie
) override
{}
46 already_AddRefed
<nsIArray
> PurgeCookies(int64_t aCurrentTimeInUsec
,
47 uint16_t aMaxNumberOfCookies
,
48 int64_t aCookiePurgeAge
) override
;
50 void StoreCookie(const nsACString
& aBaseDomain
,
51 const OriginAttributes
& aOriginAttributes
,
52 Cookie
* aCookie
) override
{}
56 } // namespace mozilla
58 #endif // mozilla_net_CookiePrivateStorage_h