1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef SharedSSLState_h
8 #define SharedSSLState_h
10 #include "mozilla/RefPtr.h"
11 #include "nsNSSIOLayer.h"
13 class nsClientAuthRememberService
;
19 class SharedSSLState
{
21 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedSSLState
)
25 static void GlobalInit();
26 static void GlobalCleanup();
28 nsClientAuthRememberService
* GetClientAuthRememberService() {
29 return mClientAuthRemember
;
32 nsSSLIOLayerHelpers
& IOLayerHelpers() {
33 return mIOLayerHelpers
;
37 void ResetStoredData();
38 void NotePrivateBrowsingStatus();
39 void SetOCSPStaplingEnabled(bool enabled
) { mOCSPStaplingEnabled
= enabled
; }
41 // The following methods may be called from any thread
43 void NoteSocketCreated();
44 static void NoteCertOverrideServiceInstantiated();
45 static void NoteCertDBServiceInstantiated();
46 bool IsOCSPStaplingEnabled() const { return mOCSPStaplingEnabled
; }
51 nsCOMPtr
<nsIObserver
> mObserver
;
52 RefPtr
<nsClientAuthRememberService
> mClientAuthRemember
;
53 nsSSLIOLayerHelpers mIOLayerHelpers
;
55 // True if any sockets have been created that use this shared data.
56 // Requires synchronization between the socket and main threads for
60 bool mOCSPStaplingEnabled
;
63 SharedSSLState
* PublicSSLState();
64 SharedSSLState
* PrivateSSLState();
67 } // namespace mozilla