|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * vim: sw=2 ts=2 sts=2 expandtab |
|
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 /** |
|
8 * This wraps nsSimpleURI so that all calls to it are done on the main thread. |
|
9 */ |
|
10 |
|
11 #ifndef __nsNullPrincipalURI_h__ |
|
12 #define __nsNullPrincipalURI_h__ |
|
13 |
|
14 #include "nsIURI.h" |
|
15 #include "nsISizeOf.h" |
|
16 #include "nsAutoPtr.h" |
|
17 #include "nsString.h" |
|
18 #include "mozilla/Attributes.h" |
|
19 #include "mozilla/MemoryReporting.h" |
|
20 |
|
21 // {51fcd543-3b52-41f7-b91b-6b54102236e6} |
|
22 #define NS_NULLPRINCIPALURI_IMPLEMENTATION_CID \ |
|
23 {0x51fcd543, 0x3b52, 0x41f7, \ |
|
24 {0xb9, 0x1b, 0x6b, 0x54, 0x10, 0x22, 0x36, 0xe6} } |
|
25 |
|
26 class nsNullPrincipalURI MOZ_FINAL : public nsIURI |
|
27 , public nsISizeOf |
|
28 { |
|
29 public: |
|
30 NS_DECL_THREADSAFE_ISUPPORTS |
|
31 NS_DECL_NSIURI |
|
32 |
|
33 // nsISizeOf |
|
34 virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; |
|
35 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; |
|
36 |
|
37 nsNullPrincipalURI(const nsCString &aSpec); |
|
38 |
|
39 private: |
|
40 nsCString mScheme; |
|
41 nsCString mPath; |
|
42 }; |
|
43 |
|
44 #endif // __nsNullPrincipalURI_h__ |