2015-05-03 22:32:37 +03: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-02 10:02:29 +04: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-25 07:24:44 +04:00
|
|
|
#ifndef nsHostObjectURI_h
|
|
|
|
#define nsHostObjectURI_h
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-08-02 10:02:29 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIClassInfo.h"
|
|
|
|
#include "nsIPrincipal.h"
|
|
|
|
#include "nsISerializable.h"
|
|
|
|
#include "nsIURIWithPrincipal.h"
|
|
|
|
#include "nsSimpleURI.h"
|
2015-03-07 00:33:00 +03:00
|
|
|
#include "nsIIPCSerializableURI.h"
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2012-09-25 07:24:44 +04:00
|
|
|
/**
|
2013-06-21 07:15:15 +04:00
|
|
|
* These URIs refer to host objects: Blobs, with scheme "blob",
|
|
|
|
* MediaStreams, with scheme "mediastream", and MediaSources, with scheme
|
|
|
|
* "mediasource".
|
2012-09-25 07:24:44 +04:00
|
|
|
*/
|
|
|
|
class nsHostObjectURI : public nsSimpleURI,
|
|
|
|
public nsIURIWithPrincipal
|
2012-08-02 10:02:29 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsHostObjectURI(nsIPrincipal* aPrincipal) :
|
2012-08-02 10:02:29 +04:00
|
|
|
nsSimpleURI(), mPrincipal(aPrincipal)
|
|
|
|
{}
|
|
|
|
|
|
|
|
// For use only from deserialization
|
2012-09-25 07:24:44 +04:00
|
|
|
nsHostObjectURI() : nsSimpleURI() {}
|
2012-08-02 10:02:29 +04:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_NSIURIWITHPRINCIPAL
|
|
|
|
NS_DECL_NSISERIALIZABLE
|
|
|
|
NS_DECL_NSICLASSINFO
|
2015-03-07 00:33:00 +03:00
|
|
|
NS_DECL_NSIIPCSERIALIZABLEURI
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2015-12-02 09:06:55 +03:00
|
|
|
NS_IMETHOD SetScheme(const nsACString &aProtocol) override;
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
// Override CloneInternal() and EqualsInternal()
|
|
|
|
virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIURI** aClone) override;
|
2012-08-02 10:02:29 +04:00
|
|
|
virtual nsresult EqualsInternal(nsIURI* aOther,
|
|
|
|
RefHandlingEnum aRefHandlingMode,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool* aResult) override;
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2012-09-25 07:24:44 +04:00
|
|
|
// Override StartClone to hand back a nsHostObjectURI
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsSimpleURI* StartClone(RefHandlingEnum /* unused */) override
|
2012-09-25 07:24:44 +04:00
|
|
|
{ return new nsHostObjectURI(); }
|
2012-08-02 10:02:29 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIPrincipal> mPrincipal;
|
2014-07-09 01:23:16 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsHostObjectURI() {}
|
2012-08-02 10:02:29 +04:00
|
|
|
};
|
|
|
|
|
2012-09-25 07:24:44 +04:00
|
|
|
#define NS_HOSTOBJECTURI_CID \
|
2012-08-02 10:02:29 +04:00
|
|
|
{ 0xf5475c51, 0x59a7, 0x4757, \
|
|
|
|
{ 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } }
|
|
|
|
|
2012-09-25 07:24:44 +04:00
|
|
|
#endif /* nsHostObjectURI_h */
|