Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=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/. */
6 :
7 : /* thread-safe container of information for resolving url values */
8 :
9 : #include "mozilla/URLExtraData.h"
10 :
11 : #include "nsProxyRelease.h"
12 : #include "NullPrincipalURI.h"
13 :
14 : namespace mozilla {
15 :
16 3 : StaticRefPtr<URLExtraData> URLExtraData::sDummy;
17 :
18 : /* static */ void
19 0 : URLExtraData::InitDummy()
20 : {
21 0 : sDummy = new URLExtraData(NullPrincipalURI::Create(),
22 : nullptr,
23 0 : NullPrincipal::Create());
24 0 : }
25 :
26 : /* static */ void
27 0 : URLExtraData::ReleaseDummy()
28 : {
29 0 : sDummy = nullptr;
30 0 : }
31 :
32 4 : URLExtraData::~URLExtraData()
33 : {
34 2 : if (!NS_IsMainThread()) {
35 0 : NS_ReleaseOnMainThread("URLExtraData::mBaseURI", mBaseURI.forget());
36 0 : NS_ReleaseOnMainThread("URLExtraData::mReferrer", mReferrer.forget());
37 0 : NS_ReleaseOnMainThread("URLExtraData::mPrincipal", mPrincipal.forget());
38 : }
39 2 : }
40 :
41 : } // namespace mozilla
|