mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
3dafb8d491
- Bug 1162293 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj (20456f454)
- Bug 1162293 - Part 2: Fix string leak in logging code. r=froydnj (2b7552940)
- Bug 1162748 - Remove instances of #ifdef PR_LOGGING in graphics. r=froydnj (1ec0e8140)
- Bug 1156632 - Remove unused forward class declarations - patch 1 - dom/base, r=ehsan (eba98c427)
- Bug 1149420 - Make the IndexedDB permissions prompt work in e10s. r=bent/mfinkle (fc977c048)
- Bug 1156632 - Remove unused forward class declarations - patch 2 - dom/media, dom/indexedDB, dom/svg, r=ehsan (011caf393)
- Bug 1156632 - Remove unused forward class declarations - patch 3 - dom/{events,xbl,xslt,xul} and others, r=ehsan (72051c70b)
- Bug 1148005; Update WebVR APIs based on latest spec changes; r=baku (15b0a712f)
- Bug 1156632 - Remove unused forward class declarations - patch 4 - netwerk image and dom, r=ehsan (5ee4f1679)
- Bug 1139972 - IPC Proxy for charAt, r=tbsaunde (95d3626ec)
- Bug 1139887 - IPC Proxy for caretOffset, r=tbsaunde (c44893cd5)
- Bug 1141228 - include GfxMessageUtils.h in PDocAccessible.ipdl, r=tbsaunde (773e741f9)
- goannaCoordType -> geckoCoordType (b6ede7903)
- Bug 1145292 - IPC Proxy for ImageAccessible, r=tbsaunde (ca37ce753)
- bug 1128751 - handle unbinding and rebinding of documents in content processes r=davidb (0ad3331ab)
- Bug 1145366 - IPC Proxy for HyperLink, r=tbsaunde (87bc696f5)
- Bug 1146615 - IPC Proxy for HyperText, r=tbsaunde (de5322207)
- Bug 1146665 - IPC Proxy for TableCell, r=tbsaunde (895e24eee)
- Bug 1147079 - IPC Proxy for Table, r=tbsaunde (6e54178fe)
- Bug 1147168 - IPC Proxy for Selection, r=tbsaunde (40b8fa16e)
- Bug 1147518 - IPC Proxy for Action, r=davidb (12d5a235f)
- Bug 1147551 - IPC Proxy for min/cur/max values, r=davidb (3728abc54)
- Bug 1148025 - IPC Proxy for 'Component', r=tbsaunde (38bea1f4a)
- Bug 1148083 - IPC Proxy for Document, r=davidb (a7d53936d)
- Bug 1132854 - Make nsIntSize a typedef of gfx::IntSize. r=Bas, roc (09d0ae0d9)
- goannaRole -> geckoRole (421bdcd36)
- bug 1138436 - start on proxying IAccessible2 r=surkov, r=davidb (b2be8ba44)
- bug 1151402 - proxy most of IAccessibleText and IAccessibleEditableText r=davidb (dff7da028)
- Bug 1162740 - Part 1: Remove instances of #ifdef PR_LOGGING in rdf. r=froydnj (e398edb14)
- Bug 1162740 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj (d873be4f4)
- Bug 1067054 - Remove generic SQLITE_ERROR warning & suppress warning if transaction exists. r=mak (cdc03b034)
- Bug 1137287 - Part 1: Shift some code from InterceptedChannelContent to HttpChannelChild. r=mayhemer (6141690a1)
- Bug 1136969 - Add a check that OnStartRequest is called just once during the lifetime of a channel. r=mcmanus (3b6aa0560)
- Bug 1053650 - Part 1: Add attribute 'networkInterfaceId' to XMLHttpRequest. r=bz Bug 1053650 - Part 2: Populate networkInterfaceId to SocketTransport r=mcmanus Bug 1053650 - Part 3: Make use of gonk-specific per-interface DNS lookup. r=mcmanus Bug 1053650 follow-up: Mark GetNetworkInterfaceId/SetNetworkInterfaceId as override (e308fc405)
151 lines
4.6 KiB
C++
151 lines
4.6 KiB
C++
/* 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/. */
|
|
|
|
#ifndef nsHostObjectProtocolHandler_h
|
|
#define nsHostObjectProtocolHandler_h
|
|
|
|
#include "mozilla/Attributes.h"
|
|
#include "nsIProtocolHandler.h"
|
|
#include "nsIURI.h"
|
|
#include "nsCOMPtr.h"
|
|
#include "nsIInputStream.h"
|
|
|
|
#define BLOBURI_SCHEME "blob"
|
|
#define MEDIASTREAMURI_SCHEME "mediastream"
|
|
#define MEDIASOURCEURI_SCHEME "mediasource"
|
|
#define FONTTABLEURI_SCHEME "moz-fonttable"
|
|
#define RTSPURI_SCHEME "rtsp"
|
|
|
|
class nsIPrincipal;
|
|
|
|
namespace mozilla {
|
|
class DOMMediaStream;
|
|
namespace dom {
|
|
class FileImpl;
|
|
class MediaSource;
|
|
} // namespace dom
|
|
} // namespace mozilla
|
|
|
|
class nsHostObjectProtocolHandler : public nsIProtocolHandler
|
|
{
|
|
public:
|
|
nsHostObjectProtocolHandler();
|
|
NS_DECL_ISUPPORTS
|
|
|
|
// nsIProtocolHandler methods, except for GetScheme which is only defined
|
|
// in subclasses.
|
|
NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override;
|
|
NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override;
|
|
NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) override;
|
|
NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval) override;
|
|
NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel * *_retval) override;
|
|
NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override;
|
|
|
|
// If principal is not null, its origin will be used to generate the URI.
|
|
static nsresult GenerateURIString(const nsACString &aScheme,
|
|
nsIPrincipal* aPrincipal,
|
|
nsACString &aUri);
|
|
|
|
// Methods for managing uri->object mapping
|
|
// AddDataEntry creates the URI with the given scheme and returns it in aUri
|
|
static nsresult AddDataEntry(const nsACString& aScheme,
|
|
nsISupports* aObject,
|
|
nsIPrincipal* aPrincipal,
|
|
nsACString& aUri);
|
|
static void RemoveDataEntry(const nsACString& aUri);
|
|
static nsIPrincipal* GetDataEntryPrincipal(const nsACString& aUri);
|
|
static void Traverse(const nsACString& aUri, nsCycleCollectionTraversalCallback& aCallback);
|
|
|
|
protected:
|
|
virtual ~nsHostObjectProtocolHandler() {}
|
|
|
|
private:
|
|
static void Init(void);
|
|
};
|
|
|
|
class nsBlobProtocolHandler : public nsHostObjectProtocolHandler
|
|
{
|
|
public:
|
|
NS_IMETHOD GetScheme(nsACString &result) override;
|
|
};
|
|
|
|
class nsMediaStreamProtocolHandler : public nsHostObjectProtocolHandler
|
|
{
|
|
public:
|
|
NS_IMETHOD GetScheme(nsACString &result) override;
|
|
};
|
|
|
|
class nsMediaSourceProtocolHandler : public nsHostObjectProtocolHandler
|
|
{
|
|
public:
|
|
NS_IMETHOD GetScheme(nsACString &result) override;
|
|
};
|
|
|
|
class nsFontTableProtocolHandler : public nsHostObjectProtocolHandler
|
|
{
|
|
public:
|
|
NS_IMETHOD GetScheme(nsACString &result);
|
|
NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval);
|
|
};
|
|
|
|
inline bool IsBlobURI(nsIURI* aUri)
|
|
{
|
|
bool isBlob;
|
|
return NS_SUCCEEDED(aUri->SchemeIs(BLOBURI_SCHEME, &isBlob)) && isBlob;
|
|
}
|
|
|
|
inline bool IsRtspURI(nsIURI* aUri)
|
|
{
|
|
bool isRtsp;
|
|
return NS_SUCCEEDED(aUri->SchemeIs(RTSPURI_SCHEME, &isRtsp)) && isRtsp;
|
|
}
|
|
|
|
inline bool IsMediaStreamURI(nsIURI* aUri)
|
|
{
|
|
bool isStream;
|
|
return NS_SUCCEEDED(aUri->SchemeIs(MEDIASTREAMURI_SCHEME, &isStream)) && isStream;
|
|
}
|
|
|
|
inline bool IsMediaSourceURI(nsIURI* aUri)
|
|
{
|
|
bool isMediaSource;
|
|
return NS_SUCCEEDED(aUri->SchemeIs(MEDIASOURCEURI_SCHEME, &isMediaSource)) && isMediaSource;
|
|
}
|
|
|
|
inline bool IsFontTableURI(nsIURI* aUri)
|
|
{
|
|
bool isFont;
|
|
return NS_SUCCEEDED(aUri->SchemeIs(FONTTABLEURI_SCHEME, &isFont)) && isFont;
|
|
}
|
|
|
|
extern nsresult
|
|
NS_GetBlobForBlobURI(nsIURI* aURI, mozilla::dom::FileImpl** aBlob);
|
|
|
|
extern nsresult
|
|
NS_GetStreamForBlobURI(nsIURI* aURI, nsIInputStream** aStream);
|
|
|
|
extern nsresult
|
|
NS_GetStreamForMediaStreamURI(nsIURI* aURI, mozilla::DOMMediaStream** aStream);
|
|
|
|
extern nsresult
|
|
NS_GetSourceForMediaSourceURI(nsIURI* aURI, mozilla::dom::MediaSource** aSource);
|
|
|
|
#define NS_BLOBPROTOCOLHANDLER_CID \
|
|
{ 0xb43964aa, 0xa078, 0x44b2, \
|
|
{ 0xb0, 0x6b, 0xfd, 0x4d, 0x1b, 0x17, 0x2e, 0x66 } }
|
|
|
|
#define NS_MEDIASTREAMPROTOCOLHANDLER_CID \
|
|
{ 0x27d1fa24, 0x2b73, 0x4db3, \
|
|
{ 0xab, 0x48, 0xb9, 0x83, 0x83, 0x40, 0xe0, 0x81 } }
|
|
|
|
#define NS_MEDIASOURCEPROTOCOLHANDLER_CID \
|
|
{ 0x12ef31fc, 0xa8fb, 0x4661, \
|
|
{ 0x9a, 0x63, 0xfb, 0x61, 0x04,0x5d, 0xb8, 0x61 } }
|
|
|
|
#define NS_FONTTABLEPROTOCOLHANDLER_CID \
|
|
{ 0x3fc8f04e, 0xd719, 0x43ca, \
|
|
{ 0x9a, 0xd0, 0x18, 0xee, 0x32, 0x02, 0x11, 0xf2 } }
|
|
|
|
#endif /* nsHostObjectProtocolHandler_h */
|