Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/net/CookieServiceParent.h
Line
Count
Source (jump to first uncovered line)
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/. */
5
6
#ifndef mozilla_net_CookieServiceParent_h
7
#define mozilla_net_CookieServiceParent_h
8
9
#include "mozilla/net/PCookieServiceParent.h"
10
11
class nsCookie;
12
class nsICookie;
13
class nsCookieService;
14
namespace mozilla { class OriginAttributes; }
15
16
namespace mozilla {
17
namespace net {
18
19
class CookieServiceParent : public PCookieServiceParent
20
{
21
public:
22
  CookieServiceParent();
23
0
  virtual ~CookieServiceParent() = default;
24
25
  void TrackCookieLoad(nsIChannel *aChannel);
26
27
  void RemoveBatchDeletedCookies(nsIArray *aCookieList);
28
29
  void RemoveAll();
30
31
  void RemoveCookie(nsICookie *aCookie);
32
33
  void AddCookie(nsICookie *aCookie);
34
35
  // This will return true if the CookieServiceParent is currently processing
36
  // an update from the content process. This is used in ContentParent to make
37
  // sure that we are only forwarding those cookie updates to other content
38
  // processes, not the one they originated from.
39
0
  bool ProcessingCookie() { return mProcessingCookie; }
40
protected:
41
  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
42
43
  virtual mozilla::ipc::IPCResult RecvSetCookieString(const URIParams& aHost,
44
                                                      const OptionalURIParams& aChannelURI,
45
                                                      const bool& aIsForeign,
46
                                                      const bool& aIsTrackingResource,
47
                                                      const bool& aFirstPartyStorageAccessGranted,
48
                                                      const nsCString& aCookieString,
49
                                                      const nsCString& aServerTime,
50
                                                      const OriginAttributes& aAttrs,
51
                                                      const bool& aFromHttp) override;
52
  virtual
53
  mozilla::ipc::IPCResult RecvPrepareCookieList(const URIParams &aHost,
54
                                                const bool &aIsForeign,
55
                                                const bool &aIsTackingResource,
56
                                                const bool& aFirstPartyStorageAccessGranted,
57
                                                const bool &aIsSafeTopLevelNav,
58
                                                const bool &aIsSameSiteForeign,
59
                                                const OriginAttributes &aAttrs) override;
60
61
  void
62
  SerialializeCookieList(const nsTArray<nsCookie*> &aFoundCookieList,
63
                         nsTArray<CookieStruct> &aCookiesList,
64
                         nsIURI *aHostURI);
65
66
  RefPtr<nsCookieService> mCookieService;
67
  bool mProcessingCookie;
68
};
69
70
} // namespace net
71
} // namespace mozilla
72
73
#endif // mozilla_net_CookieServiceParent_h
74