2010-03-25 23:02:28 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-03-25 23:02:28 +00:00
|
|
|
|
|
|
|
#ifndef mozilla_net_CookieServiceParent_h
|
|
|
|
#define mozilla_net_CookieServiceParent_h
|
|
|
|
|
|
|
|
#include "mozilla/net/PCookieServiceParent.h"
|
|
|
|
|
2017-08-03 10:00:12 +00:00
|
|
|
class nsICookie;
|
2017-01-12 16:38:48 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class OriginAttributes;
|
|
|
|
}
|
2010-03-25 23:02:28 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2020-04-06 12:22:01 +00:00
|
|
|
class Cookie;
|
2020-04-06 12:26:14 +00:00
|
|
|
class CookieService;
|
2020-04-06 12:22:01 +00:00
|
|
|
|
2010-03-25 23:02:28 +00:00
|
|
|
class CookieServiceParent : public PCookieServiceParent {
|
2019-02-06 15:57:37 +00:00
|
|
|
friend class PCookieServiceParent;
|
|
|
|
|
2010-03-25 23:02:28 +00:00
|
|
|
public:
|
|
|
|
CookieServiceParent();
|
2018-04-30 16:46:04 +00:00
|
|
|
virtual ~CookieServiceParent() = default;
|
2010-03-25 23:02:28 +00:00
|
|
|
|
2019-05-01 08:47:10 +00:00
|
|
|
void TrackCookieLoad(nsIChannel* aChannel);
|
2017-08-03 11:00:41 +00:00
|
|
|
|
2019-05-01 08:47:10 +00:00
|
|
|
void RemoveBatchDeletedCookies(nsIArray* aCookieList);
|
2017-08-03 10:00:12 +00:00
|
|
|
|
|
|
|
void RemoveAll();
|
|
|
|
|
2019-05-01 08:47:10 +00:00
|
|
|
void RemoveCookie(nsICookie* aCookie);
|
2017-08-03 10:00:12 +00:00
|
|
|
|
2019-05-01 08:47:10 +00:00
|
|
|
void AddCookie(nsICookie* aCookie);
|
2017-08-03 10:00:12 +00:00
|
|
|
|
2018-04-19 11:18:50 +00:00
|
|
|
// This will return true if the CookieServiceParent is currently processing
|
|
|
|
// an update from the content process. This is used in ContentParent to make
|
|
|
|
// sure that we are only forwarding those cookie updates to other content
|
|
|
|
// processes, not the one they originated from.
|
|
|
|
bool ProcessingCookie() { return mProcessingCookie; }
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2010-03-25 23:02:28 +00:00
|
|
|
protected:
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2014-05-02 18:44:13 +00:00
|
|
|
|
2020-04-06 14:03:59 +00:00
|
|
|
mozilla::ipc::IPCResult RecvSetCookies(
|
|
|
|
const nsCString& aBaseDomain, const OriginAttributes& aOriginAttributes,
|
2020-04-25 19:10:00 +00:00
|
|
|
nsIURI* aHost, bool aFromHttp, const nsTArray<CookieStruct>& aCookies);
|
2019-03-08 09:04:34 +00:00
|
|
|
|
2019-02-06 15:58:43 +00:00
|
|
|
mozilla::ipc::IPCResult RecvPrepareCookieList(
|
2020-04-25 19:10:00 +00:00
|
|
|
nsIURI* aHost, const bool& aIsForeign,
|
2020-02-20 07:27:24 +00:00
|
|
|
const bool& aIsThirdPartyTrackingResource,
|
|
|
|
const bool& aIsThirdPartySocialTrackingResource,
|
2019-05-01 08:47:10 +00:00
|
|
|
const bool& aFirstPartyStorageAccessGranted,
|
2019-05-25 01:25:41 +00:00
|
|
|
const uint32_t& aRejectedReason, const bool& aIsSafeTopLevelNav,
|
|
|
|
const bool& aIsSameSiteForeign, const OriginAttributes& aAttrs);
|
2019-05-01 08:47:10 +00:00
|
|
|
|
2020-04-06 12:32:45 +00:00
|
|
|
static void SerialializeCookieList(const nsTArray<Cookie*>& aFoundCookieList,
|
|
|
|
nsTArray<CookieStruct>& aCookiesList);
|
2012-09-18 16:04:04 +00:00
|
|
|
|
2020-04-06 12:26:14 +00:00
|
|
|
RefPtr<CookieService> mCookieService;
|
2018-04-19 11:18:50 +00:00
|
|
|
bool mProcessingCookie;
|
2010-03-25 23:02:28 +00:00
|
|
|
};
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
2010-03-25 23:02:28 +00:00
|
|
|
|
|
|
|
#endif // mozilla_net_CookieServiceParent_h
|