Backed out changeset 8ac015e40755 (bug 1441153) for web platform tests failre on media files
authorDorel Luca <dluca@mozilla.com>
Fri, 02 Mar 2018 04:06:22 +0200
changeset 461255 4000e7883aefcc7886a7eabb43ac6b9e592a0066
parent 461254 eec4330cfdb35bd38ce21fd78e7ba04af3a5e4a7
child 461256 b59a2fcd3435ec59ceaea010324db3761edb596e
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1441153
milestone60.0a1
backs out8ac015e407553baf5f4e60fe1e021d8d3f884e1a
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
Backed out changeset 8ac015e40755 (bug 1441153) for web platform tests failre on media files
dom/media/ChannelMediaDecoder.cpp
dom/media/ChannelMediaDecoder.h
dom/media/DecoderTraits.cpp
dom/media/DecoderTraits.h
dom/media/MediaDecoder.h
dom/media/test/test_seek_promise_bug1344357.html
--- a/dom/media/ChannelMediaDecoder.cpp
+++ b/dom/media/ChannelMediaDecoder.cpp
@@ -149,31 +149,16 @@ ChannelMediaDecoder::ResourceCallback::N
            "principal_changed",
            true);
   if (mDecoder) {
     mDecoder->NotifyPrincipalChanged();
   }
 }
 
 void
-ChannelMediaDecoder::NotifyPrincipalChanged()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MediaDecoder::NotifyPrincipalChanged();
-  if (!mSameOriginMedia &&
-      DecoderTraits::CrossOriginRedirectsProhibited(ContainerType())) {
-    // For some content types we block channel redirects to cross origin
-    // destinations due to security constraints. See bug 1441153.
-    LOG("ChannnelMediaDecoder prohibited cross origin redirect blocked.");
-    NetworkError(MediaResult(NS_ERROR_DOM_BAD_URI,
-                             "Prohibited cross origin redirect blocked"));
-  }
-}
-
-void
 ChannelMediaDecoder::ResourceCallback::NotifySuspendedStatusChanged(
   bool aSuspendedByCache)
 {
   MOZ_ASSERT(NS_IsMainThread());
   DDLOGEX2("ChannelMediaDecoder::ResourceCallback",
            this,
            DDLogCategory::Log,
            "suspended_status_changed",
--- a/dom/media/ChannelMediaDecoder.h
+++ b/dom/media/ChannelMediaDecoder.h
@@ -61,17 +61,16 @@ class ChannelMediaDecoder
   };
 
 protected:
   void OnPlaybackEvent(MediaPlaybackEvent&& aEvent) override;
   void DurationChanged() override;
   void MetadataLoaded(UniquePtr<MediaInfo> aInfo,
                       UniquePtr<MetadataTags> aTags,
                       MediaDecoderEventVisibility aEventVisibility) override;
-  void NotifyPrincipalChanged() override;
 
   RefPtr<ResourceCallback> mResourceCallback;
   RefPtr<BaseMediaResource> mResource;
 
   explicit ChannelMediaDecoder(MediaDecoderInit& aInit);
 
   nsCString GetDebugInfo() override;
 
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -320,16 +320,9 @@ bool DecoderTraits::IsSupportedInVideoDo
     ADTSDecoder::IsSupportedType(*type) ||
     FlacDecoder::IsSupportedType(*type) ||
 #ifdef MOZ_ANDROID_HLS_SUPPORT
     HLSDecoder::IsSupportedType(*type) ||
 #endif
     false;
 }
 
-/* static */
-bool
-DecoderTraits::CrossOriginRedirectsProhibited(const MediaContainerType& aType)
-{
-  return WaveDecoder::IsSupportedType(aType);
-}
-
 } // namespace mozilla
--- a/dom/media/DecoderTraits.h
+++ b/dom/media/DecoderTraits.h
@@ -52,18 +52,14 @@ public:
 
   // Returns true if aType is MIME type of hls.
   static bool IsHttpLiveStreamingType(const MediaContainerType& aType);
 
   // Returns true if aType is matroska type.
   static bool IsMatroskaType(const MediaContainerType& aType);
 
   static bool IsSupportedType(const MediaContainerType& aType);
-
-  // For some content types we block channel redirects to cross origin
-  // destinations due to security constraints. See bug 1441153.
-  static bool CrossOriginRedirectsProhibited(const MediaContainerType& aType);
 };
 
 } // namespace mozilla
 
 #endif
 
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -509,17 +509,17 @@ private:
 
 protected:
   void NotifyReaderDataArrived();
   void DiscardOngoingSeekIfExists();
   virtual void CallSeek(const SeekTarget& aTarget);
 
   // Called by MediaResource when the principal of the resource has
   // changed. Called on main thread only.
-  virtual void NotifyPrincipalChanged();
+  void NotifyPrincipalChanged();
 
   MozPromiseRequestHolder<SeekPromise> mSeekRequest;
 
   const char* PlayStateStr();
 
   void OnMetadataUpdate(TimedMetadata&& aMetadata);
 
   // This should only ever be accessed from the main thread.
--- a/dom/media/test/test_seek_promise_bug1344357.html
+++ b/dom/media/test/test_seek_promise_bug1344357.html
@@ -16,17 +16,17 @@
 let manager = new MediaTestManager;
 
 function initTest(test, token) {
   manager.started(token);
 
   var win = window.open();
   var video = win.document.createElement("video");
   video.autoplay = true;
-  video.src = window.origin + "/tests/dom/media/test/" + test.name;
+  video.src = "http://example.com/tests/dom/media/test/" + test.name;
   win.document.body.appendChild(video);
   video.currentTime = test.duration / 2;
   video.addEventListener("seeking", () => {
     win.close();
     manager.finished(token);
   }, true);
 }