Bug 1869043 assert that graph set access is main thread only r=padenot
[gecko.git] / netwerk / cookie / CookiePrivateStorage.h
blob812a7e6764cdb8986f747961e9a49b6ba1deac6c
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;
13 namespace mozilla {
14 namespace net {
16 class CookiePrivateStorage final : public CookieStorage {
17 public:
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");
34 protected:
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 {}
54 private:
55 void CollectCookieJarSizeData() override{};
58 } // namespace net
59 } // namespace mozilla
61 #endif // mozilla_net_CookiePrivateStorage_h