Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
6 #ifndef nsViewSourceChannel_h___
7 #define nsViewSourceChannel_h___
9 #include "nsString.h"
10 #include "nsCOMPtr.h"
11 #include "nsIViewSourceChannel.h"
12 #include "nsIURI.h"
13 #include "nsIStreamListener.h"
14 #include "nsIHttpChannel.h"
15 #include "nsIHttpChannelInternal.h"
16 #include "nsICachingChannel.h"
17 #include "nsIApplicationCacheChannel.h"
18 #include "nsIUploadChannel.h"
19 #include "mozilla/Attributes.h"
21 class nsViewSourceChannel MOZ_FINAL : public nsIViewSourceChannel,
22 public nsIStreamListener,
23 public nsIHttpChannel,
24 public nsIHttpChannelInternal,
25 public nsICachingChannel,
26 public nsIApplicationCacheChannel,
27 public nsIUploadChannel
28 {
30 public:
31 NS_DECL_ISUPPORTS
32 NS_DECL_NSIREQUEST
33 NS_DECL_NSICHANNEL
34 NS_DECL_NSIVIEWSOURCECHANNEL
35 NS_DECL_NSISTREAMLISTENER
36 NS_DECL_NSIREQUESTOBSERVER
37 NS_DECL_NSIHTTPCHANNEL
38 NS_FORWARD_SAFE_NSICACHEINFOCHANNEL(mCachingChannel)
39 NS_FORWARD_SAFE_NSICACHINGCHANNEL(mCachingChannel)
40 NS_FORWARD_SAFE_NSIAPPLICATIONCACHECHANNEL(mApplicationCacheChannel)
41 NS_FORWARD_SAFE_NSIAPPLICATIONCACHECONTAINER(mApplicationCacheChannel)
42 NS_FORWARD_SAFE_NSIUPLOADCHANNEL(mUploadChannel)
43 NS_FORWARD_SAFE_NSIHTTPCHANNELINTERNAL(mHttpChannelInternal)
45 // nsViewSourceChannel methods:
46 nsViewSourceChannel()
47 : mIsDocument(false)
48 , mOpened(false) {}
50 NS_HIDDEN_(nsresult) Init(nsIURI* uri);
52 NS_HIDDEN_(nsresult) InitSrcdoc(nsIURI* aURI, const nsAString &aSrcdoc,
53 nsIURI* aBaseURI);
55 protected:
56 nsCOMPtr<nsIChannel> mChannel;
57 nsCOMPtr<nsIHttpChannel> mHttpChannel;
58 nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal;
59 nsCOMPtr<nsICachingChannel> mCachingChannel;
60 nsCOMPtr<nsIApplicationCacheChannel> mApplicationCacheChannel;
61 nsCOMPtr<nsIUploadChannel> mUploadChannel;
62 nsCOMPtr<nsIStreamListener> mListener;
63 nsCOMPtr<nsIURI> mOriginalURI;
64 nsCOMPtr<nsIURI> mBaseURI;
65 nsCString mContentType;
66 bool mIsDocument; // keeps track of the LOAD_DOCUMENT_URI flag
67 bool mOpened;
68 bool mIsSrcdocChannel;
69 };
71 #endif /* nsViewSourceChannel_h___ */