2015-05-03 12:32:37 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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"
|
2015-03-06 13:33:00 -08:00
|
|
|
#include "nsIIPCSerializableURI.h"
|
2012-08-01 23:02:29 -07:00
|
|
|
|
2012-09-24 20:24:44 -07:00
|
|
|
/**
|
2013-06-20 20:15:15 -07:00
|
|
|
* These URIs refer to host objects: Blobs, with scheme "blob",
|
|
|
|
* MediaStreams, with scheme "mediastream", and MediaSources, with scheme
|
|
|
|
* "mediasource".
|
2012-09-24 20:24:44 -07:00
|
|
|
*/
|
|
|
|
class nsHostObjectURI : public nsSimpleURI,
|
|
|
|
public nsIURIWithPrincipal
|
2012-08-01 23:02:29 -07:00
|
|
|
{
|
|
|
|
public:
|
2014-09-01 17:49:25 -07:00
|
|
|
explicit nsHostObjectURI(nsIPrincipal* aPrincipal) :
|
2012-08-01 23:02:29 -07:00
|
|
|
nsSimpleURI(), mPrincipal(aPrincipal)
|
|
|
|
{}
|
|
|
|
|
|
|
|
// 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
|
2015-03-06 13:33:00 -08:00
|
|
|
NS_DECL_NSIIPCSERIALIZABLEURI
|
2012-08-01 23:02:29 -07:00
|
|
|
|
|
|
|
// Override CloneInternal() and EqualsInternal()
|
|
|
|
virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
|
2015-03-21 09:28:04 -07:00
|
|
|
nsIURI** aClone) override;
|
2012-08-01 23:02:29 -07:00
|
|
|
virtual nsresult EqualsInternal(nsIURI* aOther,
|
|
|
|
RefHandlingEnum aRefHandlingMode,
|
2015-03-21 09:28:04 -07:00
|
|
|
bool* aResult) override;
|
2012-08-01 23:02:29 -07:00
|
|
|
|
2012-09-24 20:24:44 -07:00
|
|
|
// Override StartClone to hand back a nsHostObjectURI
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsSimpleURI* StartClone(RefHandlingEnum /* unused */) override
|
2012-09-24 20:24:44 -07:00
|
|
|
{ return new nsHostObjectURI(); }
|
2012-08-01 23:02:29 -07:00
|
|
|
|
|
|
|
nsCOMPtr<nsIPrincipal> mPrincipal;
|
2014-07-08 14:23:16 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsHostObjectURI() {}
|
2012-08-01 23:02:29 -07:00
|
|
|
};
|
|
|
|
|
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 */
|