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 429490 44e400e8dc12a39dc0acdfb7bad79325df6b6b52
parent 429489 020a6054e22840ec66c1f0e0a0bfa3a83040cc7c
child 429491 9692fc0d793721f8dc2cddf5081dc00dde7dea50
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1398659
milestone57.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 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;