michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsHostObjectURI_h michael@0: #define nsHostObjectURI_h michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIClassInfo.h" michael@0: #include "nsIPrincipal.h" michael@0: #include "nsISerializable.h" michael@0: #include "nsIURIWithPrincipal.h" michael@0: #include "nsSimpleURI.h" michael@0: michael@0: /** michael@0: * These URIs refer to host objects: Blobs, with scheme "blob", michael@0: * MediaStreams, with scheme "mediastream", and MediaSources, with scheme michael@0: * "mediasource". michael@0: */ michael@0: class nsHostObjectURI : public nsSimpleURI, michael@0: public nsIURIWithPrincipal michael@0: { michael@0: public: michael@0: nsHostObjectURI(nsIPrincipal* aPrincipal) : michael@0: nsSimpleURI(), mPrincipal(aPrincipal) michael@0: {} michael@0: virtual ~nsHostObjectURI() {} michael@0: michael@0: // For use only from deserialization michael@0: nsHostObjectURI() : nsSimpleURI() {} michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_NSIURIWITHPRINCIPAL michael@0: NS_DECL_NSISERIALIZABLE michael@0: NS_DECL_NSICLASSINFO michael@0: michael@0: // Override CloneInternal() and EqualsInternal() michael@0: virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode, michael@0: nsIURI** aClone) MOZ_OVERRIDE; michael@0: virtual nsresult EqualsInternal(nsIURI* aOther, michael@0: RefHandlingEnum aRefHandlingMode, michael@0: bool* aResult) MOZ_OVERRIDE; michael@0: michael@0: // Override StartClone to hand back a nsHostObjectURI michael@0: virtual nsSimpleURI* StartClone(RefHandlingEnum /* unused */) MOZ_OVERRIDE michael@0: { return new nsHostObjectURI(); } michael@0: michael@0: nsCOMPtr mPrincipal; michael@0: }; michael@0: michael@0: #define NS_HOSTOBJECTURI_CID \ michael@0: { 0xf5475c51, 0x59a7, 0x4757, \ michael@0: { 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } } michael@0: michael@0: #endif /* nsHostObjectURI_h */