Bug 1447341 - make blob: protocol handler support nsISupportsWeakReference, r?baku draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 17 Apr 2018 15:36:25 +0100
changeset 784345 69c9f315efedf348349b0b1bbc40e324ebc0a6b4
parent 784298 4af4ae0aee552a99a995ce4b32198b98294a95f7
child 784346 64f362f9694d974887640a20472217634bb45240
push id106899
push userbmo:gijskruitbosch+bugs@gmail.com
push dateWed, 18 Apr 2018 12:35:51 +0000
reviewersbaku
bugs1447341
milestone61.0a1
Bug 1447341 - make blob: protocol handler support nsISupportsWeakReference, r?baku MozReview-Commit-ID: 1UqdssdVs3b
dom/file/nsHostObjectProtocolHandler.cpp
dom/file/nsHostObjectProtocolHandler.h
--- 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;