|
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_CookieServiceChild_h__ |
|
7 #define mozilla_net_CookieServiceChild_h__ |
|
8 |
|
9 #include "mozilla/net/PCookieServiceChild.h" |
|
10 #include "nsICookieService.h" |
|
11 #include "nsIObserver.h" |
|
12 #include "nsIPrefBranch.h" |
|
13 #include "mozIThirdPartyUtil.h" |
|
14 #include "nsWeakReference.h" |
|
15 |
|
16 namespace mozilla { |
|
17 namespace net { |
|
18 |
|
19 class CookieServiceChild : public PCookieServiceChild |
|
20 , public nsICookieService |
|
21 , public nsIObserver |
|
22 , public nsSupportsWeakReference |
|
23 { |
|
24 public: |
|
25 NS_DECL_ISUPPORTS |
|
26 NS_DECL_NSICOOKIESERVICE |
|
27 NS_DECL_NSIOBSERVER |
|
28 |
|
29 CookieServiceChild(); |
|
30 virtual ~CookieServiceChild(); |
|
31 |
|
32 static CookieServiceChild* GetSingleton(); |
|
33 |
|
34 protected: |
|
35 void SerializeURIs(nsIURI *aHostURI, |
|
36 nsIChannel *aChannel, |
|
37 nsCString &aHostSpec, |
|
38 nsCString &aHostCharset, |
|
39 nsCString &aOriginatingSpec, |
|
40 nsCString &aOriginatingCharset); |
|
41 |
|
42 nsresult GetCookieStringInternal(nsIURI *aHostURI, |
|
43 nsIChannel *aChannel, |
|
44 char **aCookieString, |
|
45 bool aFromHttp); |
|
46 |
|
47 nsresult SetCookieStringInternal(nsIURI *aHostURI, |
|
48 nsIChannel *aChannel, |
|
49 const char *aCookieString, |
|
50 const char *aServerTime, |
|
51 bool aFromHttp); |
|
52 |
|
53 void PrefChanged(nsIPrefBranch *aPrefBranch); |
|
54 |
|
55 bool RequireThirdPartyCheck(); |
|
56 |
|
57 nsCOMPtr<mozIThirdPartyUtil> mThirdPartyUtil; |
|
58 uint8_t mCookieBehavior; |
|
59 bool mThirdPartySession; |
|
60 }; |
|
61 |
|
62 } |
|
63 } |
|
64 |
|
65 #endif // mozilla_net_CookieServiceChild_h__ |
|
66 |