Bug 1192708 - Remove redundant call to CloseChannel. r=roc.
authorJW Wang <jwwang@mozilla.com>
Fri, 14 Aug 2015 11:17:29 +0800
changeset 257767 8c50d6b8b009124dfef4a93e22965730e9ddf5bf
parent 257766 03b1eb0b1f9bcb470c1996dedc45992eb4acef59
child 257768 5c74a78094884ca900eff6475ccaddeac57f09f0
push id29226
push userryanvm@gmail.com
push dateFri, 14 Aug 2015 13:01:14 +0000
treeherdermozilla-central@1b2402247429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1192708
milestone43.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 1192708 - Remove redundant call to CloseChannel. r=roc.
dom/media/MediaResource.cpp
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -1003,23 +1003,23 @@ ChannelMediaResource::CacheClientSeek(in
   if (aResume) {
     NS_ASSERTION(mSuspendCount > 0, "Too many resumes!");
     // No need to mess with the channel, since we're making a new one
     --mSuspendCount;
   }
 
   mOffset = aOffset;
 
+  // Don't report close of the channel because the channel is not closed for
+  // download ended, but for internal changes in the read position.
+  mIgnoreClose = true;
+
+  // Don't create a new channel if we are still suspended. The channel will
+  // be recreated when we are resumed.
   if (mSuspendCount > 0) {
-    // Close the existing channel to force the channel to be recreated at
-    // the correct offset upon resume.
-    if (mChannel) {
-      mIgnoreClose = true;
-      CloseChannel();
-    }
     return NS_OK;
   }
 
   nsresult rv = RecreateChannel();
   NS_ENSURE_SUCCESS(rv, rv);
 
   return OpenChannel(nullptr);
 }