Bug 905513 - Remove MediaSource support from HostObjectProtocolHandler::NewChannel. r=khuey
authorMatthew Gregan <kinetik@flim.org>
Fri, 27 Sep 2013 17:22:37 +1200
changeset 148928 6837a1ce616b882f35998d4996d95b2c92023eca
parent 148927 6fb1c750791f9d17f12efc2af063875940515e4f
child 148929 ba062e4be8fd4c05051f20aa3e85ba8952a4a774
push id34385
push usermgregan@mozilla.com
push dateFri, 27 Sep 2013 05:23:17 +0000
treeherdermozilla-inbound@808a8b288ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs905513
milestone27.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 905513 - Remove MediaSource support from HostObjectProtocolHandler::NewChannel. r=khuey
content/base/src/nsHostObjectProtocolHandler.cpp
--- a/content/base/src/nsHostObjectProtocolHandler.cpp
+++ b/content/base/src/nsHostObjectProtocolHandler.cpp
@@ -188,72 +188,61 @@ nsHostObjectProtocolHandler::NewChannel(
   uri->GetSpec(spec);
 
   DataInfo* info = GetDataInfo(spec);
 
   if (!info) {
     return NS_ERROR_DOM_BAD_URI;
   }
   nsCOMPtr<nsIDOMBlob> blob = do_QueryInterface(info->mObject);
-  nsCOMPtr<mozilla::dom::MediaSource> mediasource = do_QueryInterface(info->mObject);
-  if (!blob && !mediasource) {
+  if (!blob) {
     return NS_ERROR_DOM_BAD_URI;
   }
 
 #ifdef DEBUG
   {
     nsCOMPtr<nsIURIWithPrincipal> uriPrinc = do_QueryInterface(uri);
     nsCOMPtr<nsIPrincipal> principal;
     uriPrinc->GetPrincipal(getter_AddRefs(principal));
     NS_ASSERTION(info->mPrincipal == principal, "Wrong principal!");
   }
 #endif
 
   nsCOMPtr<nsIInputStream> stream;
-  nsresult rv = NS_OK;
-  if (blob) {
-    rv = blob->GetInternalStream(getter_AddRefs(stream));
-  } else {
-    stream = mediasource->CreateInternalStream();
-  }
+  nsresult rv = blob->GetInternalStream(getter_AddRefs(stream));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewInputStreamChannel(getter_AddRefs(channel),
                                 uri,
                                 stream);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupports> owner = do_QueryInterface(info->mPrincipal);
 
   nsString type;
-  if (blob) {
-    rv = blob->GetType(type);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    uint64_t size;
-    rv = blob->GetSize(&size);
-    NS_ENSURE_SUCCESS(rv, rv);
+  rv = blob->GetType(type);
+  NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCOMPtr<nsIDOMFile> file = do_QueryInterface(info->mObject);
-    if (file) {
-      nsString filename;
-      rv = file->GetName(filename);
-      NS_ENSURE_SUCCESS(rv, rv);
-      channel->SetContentDispositionFilename(filename);
-    }
+  nsCOMPtr<nsIDOMFile> file = do_QueryInterface(info->mObject);
+  if (file) {
+    nsString filename;
+    rv = file->GetName(filename);
+    NS_ENSURE_SUCCESS(rv, rv);
+    channel->SetContentDispositionFilename(filename);
+  }
 
-    channel->SetContentLength(size);
-  } else {
-    type = mediasource->GetType();
-  }
+  uint64_t size;
+  rv = blob->GetSize(&size);
+  NS_ENSURE_SUCCESS(rv, rv);
 
   channel->SetOwner(owner);
   channel->SetOriginalURI(uri);
   channel->SetContentType(NS_ConvertUTF16toUTF8(type));
+  channel->SetContentLength(size);
 
   channel.forget(result);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHostObjectProtocolHandler::AllowPort(int32_t port, const char *scheme,