1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/caps/src/nsNullPrincipalURI.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * vim: sw=2 ts=2 sts=2 expandtab 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +/** 1.11 + * This wraps nsSimpleURI so that all calls to it are done on the main thread. 1.12 + */ 1.13 + 1.14 +#ifndef __nsNullPrincipalURI_h__ 1.15 +#define __nsNullPrincipalURI_h__ 1.16 + 1.17 +#include "nsIURI.h" 1.18 +#include "nsISizeOf.h" 1.19 +#include "nsAutoPtr.h" 1.20 +#include "nsString.h" 1.21 +#include "mozilla/Attributes.h" 1.22 +#include "mozilla/MemoryReporting.h" 1.23 + 1.24 +// {51fcd543-3b52-41f7-b91b-6b54102236e6} 1.25 +#define NS_NULLPRINCIPALURI_IMPLEMENTATION_CID \ 1.26 + {0x51fcd543, 0x3b52, 0x41f7, \ 1.27 + {0xb9, 0x1b, 0x6b, 0x54, 0x10, 0x22, 0x36, 0xe6} } 1.28 + 1.29 +class nsNullPrincipalURI MOZ_FINAL : public nsIURI 1.30 + , public nsISizeOf 1.31 +{ 1.32 +public: 1.33 + NS_DECL_THREADSAFE_ISUPPORTS 1.34 + NS_DECL_NSIURI 1.35 + 1.36 + // nsISizeOf 1.37 + virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; 1.38 + virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; 1.39 + 1.40 + nsNullPrincipalURI(const nsCString &aSpec); 1.41 + 1.42 +private: 1.43 + nsCString mScheme; 1.44 + nsCString mPath; 1.45 +}; 1.46 + 1.47 +#endif // __nsNullPrincipalURI_h__