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