|
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 nsURILoader_h__ |
|
7 #define nsURILoader_h__ |
|
8 |
|
9 #include "nsCURILoader.h" |
|
10 #include "nsISupportsUtils.h" |
|
11 #include "nsCOMArray.h" |
|
12 #include "nsCOMPtr.h" |
|
13 #include "nsIInterfaceRequestor.h" |
|
14 #include "nsIInterfaceRequestorUtils.h" |
|
15 #include "nsString.h" |
|
16 #include "nsIWeakReference.h" |
|
17 #include "mozilla/Attributes.h" |
|
18 |
|
19 #ifdef MOZ_LOGGING |
|
20 // Uncomment the next line to force logging on in release builds |
|
21 // #define FORCE_PR_LOG |
|
22 #endif |
|
23 #include "prlog.h" |
|
24 |
|
25 class nsDocumentOpenInfo; |
|
26 |
|
27 class nsURILoader MOZ_FINAL : public nsIURILoader |
|
28 { |
|
29 public: |
|
30 NS_DECL_NSIURILOADER |
|
31 NS_DECL_ISUPPORTS |
|
32 |
|
33 nsURILoader(); |
|
34 ~nsURILoader(); |
|
35 |
|
36 protected: |
|
37 /** |
|
38 * Equivalent to nsIURILoader::openChannel, but allows specifying whether the |
|
39 * channel is opened already. |
|
40 */ |
|
41 NS_HIDDEN_(nsresult) OpenChannel(nsIChannel* channel, |
|
42 uint32_t aFlags, |
|
43 nsIInterfaceRequestor* aWindowContext, |
|
44 bool aChannelOpen, |
|
45 nsIStreamListener** aListener); |
|
46 |
|
47 /** |
|
48 * we shouldn't need to have an owning ref count on registered |
|
49 * content listeners because they are supposed to unregister themselves |
|
50 * when they go away. This array stores weak references |
|
51 */ |
|
52 nsCOMArray<nsIWeakReference> m_listeners; |
|
53 |
|
54 #ifdef PR_LOGGING |
|
55 /** |
|
56 * NSPR logging. The module is called "URILoader" |
|
57 */ |
|
58 static PRLogModuleInfo* mLog; |
|
59 #endif |
|
60 |
|
61 friend class nsDocumentOpenInfo; |
|
62 }; |
|
63 |
|
64 #endif /* nsURILoader_h__ */ |