Bug 1447341 - make blob: protocol handler support nsISupportsWeakReference, r=baku
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 17 Apr 2018 15:36:25 +0100
changeset 467804 1299c9a06811537495e7402d9e9cd4de1fe0eb57
parent 467803 c75acc48f536809b2c1ac58a857742cd1b107eb8
child 467805 d4e360e27b2ff3b72344d6cd74e254202ef718bc
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1447341
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;