content/base/src/nsHostObjectURI.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

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 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #ifndef nsHostObjectURI_h
michael@0 6 #define nsHostObjectURI_h
michael@0 7
michael@0 8 #include "mozilla/Attributes.h"
michael@0 9 #include "nsCOMPtr.h"
michael@0 10 #include "nsIClassInfo.h"
michael@0 11 #include "nsIPrincipal.h"
michael@0 12 #include "nsISerializable.h"
michael@0 13 #include "nsIURIWithPrincipal.h"
michael@0 14 #include "nsSimpleURI.h"
michael@0 15
michael@0 16 /**
michael@0 17 * These URIs refer to host objects: Blobs, with scheme "blob",
michael@0 18 * MediaStreams, with scheme "mediastream", and MediaSources, with scheme
michael@0 19 * "mediasource".
michael@0 20 */
michael@0 21 class nsHostObjectURI : public nsSimpleURI,
michael@0 22 public nsIURIWithPrincipal
michael@0 23 {
michael@0 24 public:
michael@0 25 nsHostObjectURI(nsIPrincipal* aPrincipal) :
michael@0 26 nsSimpleURI(), mPrincipal(aPrincipal)
michael@0 27 {}
michael@0 28 virtual ~nsHostObjectURI() {}
michael@0 29
michael@0 30 // For use only from deserialization
michael@0 31 nsHostObjectURI() : nsSimpleURI() {}
michael@0 32
michael@0 33 NS_DECL_ISUPPORTS_INHERITED
michael@0 34 NS_DECL_NSIURIWITHPRINCIPAL
michael@0 35 NS_DECL_NSISERIALIZABLE
michael@0 36 NS_DECL_NSICLASSINFO
michael@0 37
michael@0 38 // Override CloneInternal() and EqualsInternal()
michael@0 39 virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
michael@0 40 nsIURI** aClone) MOZ_OVERRIDE;
michael@0 41 virtual nsresult EqualsInternal(nsIURI* aOther,
michael@0 42 RefHandlingEnum aRefHandlingMode,
michael@0 43 bool* aResult) MOZ_OVERRIDE;
michael@0 44
michael@0 45 // Override StartClone to hand back a nsHostObjectURI
michael@0 46 virtual nsSimpleURI* StartClone(RefHandlingEnum /* unused */) MOZ_OVERRIDE
michael@0 47 { return new nsHostObjectURI(); }
michael@0 48
michael@0 49 nsCOMPtr<nsIPrincipal> mPrincipal;
michael@0 50 };
michael@0 51
michael@0 52 #define NS_HOSTOBJECTURI_CID \
michael@0 53 { 0xf5475c51, 0x59a7, 0x4757, \
michael@0 54 { 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } }
michael@0 55
michael@0 56 #endif /* nsHostObjectURI_h */

mercurial