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.)
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsViewSourceChannel_h___ |
michael@0 | 7 | #define nsViewSourceChannel_h___ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsString.h" |
michael@0 | 10 | #include "nsCOMPtr.h" |
michael@0 | 11 | #include "nsIViewSourceChannel.h" |
michael@0 | 12 | #include "nsIURI.h" |
michael@0 | 13 | #include "nsIStreamListener.h" |
michael@0 | 14 | #include "nsIHttpChannel.h" |
michael@0 | 15 | #include "nsIHttpChannelInternal.h" |
michael@0 | 16 | #include "nsICachingChannel.h" |
michael@0 | 17 | #include "nsIApplicationCacheChannel.h" |
michael@0 | 18 | #include "nsIUploadChannel.h" |
michael@0 | 19 | #include "mozilla/Attributes.h" |
michael@0 | 20 | |
michael@0 | 21 | class nsViewSourceChannel MOZ_FINAL : public nsIViewSourceChannel, |
michael@0 | 22 | public nsIStreamListener, |
michael@0 | 23 | public nsIHttpChannel, |
michael@0 | 24 | public nsIHttpChannelInternal, |
michael@0 | 25 | public nsICachingChannel, |
michael@0 | 26 | public nsIApplicationCacheChannel, |
michael@0 | 27 | public nsIUploadChannel |
michael@0 | 28 | { |
michael@0 | 29 | |
michael@0 | 30 | public: |
michael@0 | 31 | NS_DECL_ISUPPORTS |
michael@0 | 32 | NS_DECL_NSIREQUEST |
michael@0 | 33 | NS_DECL_NSICHANNEL |
michael@0 | 34 | NS_DECL_NSIVIEWSOURCECHANNEL |
michael@0 | 35 | NS_DECL_NSISTREAMLISTENER |
michael@0 | 36 | NS_DECL_NSIREQUESTOBSERVER |
michael@0 | 37 | NS_DECL_NSIHTTPCHANNEL |
michael@0 | 38 | NS_FORWARD_SAFE_NSICACHEINFOCHANNEL(mCachingChannel) |
michael@0 | 39 | NS_FORWARD_SAFE_NSICACHINGCHANNEL(mCachingChannel) |
michael@0 | 40 | NS_FORWARD_SAFE_NSIAPPLICATIONCACHECHANNEL(mApplicationCacheChannel) |
michael@0 | 41 | NS_FORWARD_SAFE_NSIAPPLICATIONCACHECONTAINER(mApplicationCacheChannel) |
michael@0 | 42 | NS_FORWARD_SAFE_NSIUPLOADCHANNEL(mUploadChannel) |
michael@0 | 43 | NS_FORWARD_SAFE_NSIHTTPCHANNELINTERNAL(mHttpChannelInternal) |
michael@0 | 44 | |
michael@0 | 45 | // nsViewSourceChannel methods: |
michael@0 | 46 | nsViewSourceChannel() |
michael@0 | 47 | : mIsDocument(false) |
michael@0 | 48 | , mOpened(false) {} |
michael@0 | 49 | |
michael@0 | 50 | NS_HIDDEN_(nsresult) Init(nsIURI* uri); |
michael@0 | 51 | |
michael@0 | 52 | NS_HIDDEN_(nsresult) InitSrcdoc(nsIURI* aURI, const nsAString &aSrcdoc, |
michael@0 | 53 | nsIURI* aBaseURI); |
michael@0 | 54 | |
michael@0 | 55 | protected: |
michael@0 | 56 | nsCOMPtr<nsIChannel> mChannel; |
michael@0 | 57 | nsCOMPtr<nsIHttpChannel> mHttpChannel; |
michael@0 | 58 | nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal; |
michael@0 | 59 | nsCOMPtr<nsICachingChannel> mCachingChannel; |
michael@0 | 60 | nsCOMPtr<nsIApplicationCacheChannel> mApplicationCacheChannel; |
michael@0 | 61 | nsCOMPtr<nsIUploadChannel> mUploadChannel; |
michael@0 | 62 | nsCOMPtr<nsIStreamListener> mListener; |
michael@0 | 63 | nsCOMPtr<nsIURI> mOriginalURI; |
michael@0 | 64 | nsCOMPtr<nsIURI> mBaseURI; |
michael@0 | 65 | nsCString mContentType; |
michael@0 | 66 | bool mIsDocument; // keeps track of the LOAD_DOCUMENT_URI flag |
michael@0 | 67 | bool mOpened; |
michael@0 | 68 | bool mIsSrcdocChannel; |
michael@0 | 69 | }; |
michael@0 | 70 | |
michael@0 | 71 | #endif /* nsViewSourceChannel_h___ */ |