Bug 1398659. P7 - tighten up the assertions in OpenChannel(). r=gerald
authorJW Wang <jwwang@mozilla.com>
Thu, 07 Sep 2017 15:15:18 +0800
changeset 662281 44e400e8dc12a39dc0acdfb7bad79325df6b6b52
parent 662280 020a6054e22840ec66c1f0e0a0bfa3a83040cc7c
child 662282 9692fc0d793721f8dc2cddf5081dc00dde7dea50
push id79014
push userbmo:bpostelnicu@mozilla.com
push dateMon, 11 Sep 2017 09:58:20 +0000
reviewersgerald
bugs1398659
milestone57.0a1
Bug 1398659. P7 - tighten up the assertions in OpenChannel(). r=gerald MozReview-Commit-ID: IPCLOJKx3f3
dom/media/MediaResource.cpp
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -540,19 +540,19 @@ ChannelMediaResource::Open(nsIStreamList
   *aStreamListener = mListener;
   NS_ADDREF(*aStreamListener);
   return NS_OK;
 }
 
 nsresult
 ChannelMediaResource::OpenChannel()
 {
-  NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
-  NS_ENSURE_TRUE(mChannel, NS_ERROR_NULL_POINTER);
-  NS_ASSERTION(!mListener, "Listener should have been removed by now");
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(mChannel);
+  MOZ_ASSERT(!mListener, "Listener should have been removed by now");
 
   // Set the content length, if it's available as an HTTP header.
   // This ensures that MediaResource wrapping objects for platform libraries
   // that expect to know the length of a resource can get it before
   // OnStartRequest() fires.
   nsCOMPtr<nsIHttpChannel> hc = do_QueryInterface(mChannel);
   if (hc && !IsPayloadCompressed(hc)) {
     int64_t cl = -1;