Bug 1447341 - make blob: protocol handler support nsISupportsWeakReference, r?baku
MozReview-Commit-ID: 1UqdssdVs3b
--- a/dom/file/nsHostObjectProtocolHandler.cpp
+++ b/dom/file/nsHostObjectProtocolHandler.cpp
@@ -827,17 +827,18 @@ nsHostObjectProtocolHandler::Traverse(co
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCallback, "HostObjectProtocolHandler DataInfo.mMediaStream");
aCallback.NoteXPCOMChild(res->mMediaStream);
}
// -----------------------------------------------------------------------
// Protocol handler
-NS_IMPL_ISUPPORTS(nsHostObjectProtocolHandler, nsIProtocolHandler)
+NS_IMPL_ISUPPORTS(nsHostObjectProtocolHandler, nsIProtocolHandler,
+ nsISupportsWeakReference)
NS_IMETHODIMP
nsHostObjectProtocolHandler::GetDefaultPort(int32_t *result)
{
*result = -1;
return NS_OK;
}
--- a/dom/file/nsHostObjectProtocolHandler.h
+++ b/dom/file/nsHostObjectProtocolHandler.h
@@ -8,16 +8,17 @@
#define nsHostObjectProtocolHandler_h
#include "mozilla/Attributes.h"
#include "nsIProtocolHandler.h"
#include "nsIURI.h"
#include "nsCOMPtr.h"
#include "nsIInputStream.h"
#include "nsTArray.h"
+#include "nsWeakReference.h"
#define BLOBURI_SCHEME "blob"
#define FONTTABLEURI_SCHEME "moz-fonttable"
#define RTSPURI_SCHEME "rtsp"
class nsIPrincipal;
namespace mozilla {
@@ -29,16 +30,17 @@ class BlobImpl;
class BlobURLRegistrationData;
class ContentParent;
class MediaSource;
} // namespace dom
} // namespace mozilla
class nsHostObjectProtocolHandler : public nsIProtocolHandler
, public nsIProtocolHandlerWithDynamicFlags
+ , public nsSupportsWeakReference
{
public:
nsHostObjectProtocolHandler();
NS_DECL_ISUPPORTS
// nsIProtocolHandler methods, except for GetScheme which is only defined
// in subclasses.
NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override;