Commit 6004f756 authored by Matt Wolenetz's avatar Matt Wolenetz Committed by Commit Bot

MSE-in-Workers: Drop unused attachment interface methods

This change drops two unnecessary methods from the MediaSourceAttachment
interface:

1) As of r680382, HTMLMediaElement no longer needs the
   Oilpan/GarbageCollected TimeRanges version of Buffered() from the
   MediaSource API. Rather, it constructs its own TimeRanges when needed
   by consulting the underlying WebTimeRanges produced by
   BufferedInternal.

2) Also, when creating the core attachment interface and removing the
   core MediaSource interface, the duration() method was unnecessarily
   included in the attachment. Even before this MSE-in-Workers feature
   work, duration notification updates (where the media element is
   notified that the underlying MSE resource's duration has changed) did
   not involve this method.

This change also includes some minor clean-ups of the
modules/mediasource attachment includes.

BUG=878133

Change-Id: I125f9db2bf1383c2eafb312225e3f843371a744f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2402169
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807289}
parent f1cc25e4
...@@ -19,7 +19,6 @@ namespace blink { ...@@ -19,7 +19,6 @@ namespace blink {
class HTMLMediaElement; class HTMLMediaElement;
class MediaSourceRegistry; class MediaSourceRegistry;
class TimeRanges;
class TrackBase; class TrackBase;
class WebMediaSource; class WebMediaSource;
...@@ -95,13 +94,12 @@ class CORE_EXPORT MediaSourceAttachment ...@@ -95,13 +94,12 @@ class CORE_EXPORT MediaSourceAttachment
std::unique_ptr<WebMediaSource>) = 0; std::unique_ptr<WebMediaSource>) = 0;
virtual void Close(MediaSourceTracer* tracer) = 0; virtual void Close(MediaSourceTracer* tracer) = 0;
virtual double duration(MediaSourceTracer* tracer) const = 0;
// 'Internal' in these methods doesn't mean private, it means that they are // 'Internal' in these methods doesn't mean private, it means that they are
// internal to chromium and are not exposed to JavaScript. // internal to chromium and are not exposed to JavaScript.
virtual WebTimeRanges BufferedInternal(MediaSourceTracer* tracer) const = 0; virtual WebTimeRanges BufferedInternal(MediaSourceTracer* tracer) const = 0;
virtual WebTimeRanges SeekableInternal(MediaSourceTracer* tracer) const = 0; virtual WebTimeRanges SeekableInternal(MediaSourceTracer* tracer) const = 0;
virtual TimeRanges* Buffered(MediaSourceTracer* tracer) const = 0;
virtual void OnTrackChanged(MediaSourceTracer* tracer, TrackBase*) = 0; virtual void OnTrackChanged(MediaSourceTracer* tracer, TrackBase*) = 0;
// Provide state updates to the MediaSource that are necessary for its // Provide state updates to the MediaSource that are necessary for its
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_ATTACHMENT_SUPPLEMENT_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_ATTACHMENT_SUPPLEMENT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_ATTACHMENT_SUPPLEMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_ATTACHMENT_SUPPLEMENT_H_
#include <memory>
#include "third_party/blink/public/platform/web_time_range.h"
#include "third_party/blink/renderer/core/html/media/media_source_attachment.h" #include "third_party/blink/renderer/core/html/media/media_source_attachment.h"
#include "third_party/blink/renderer/core/html/media/media_source_tracer.h" #include "third_party/blink/renderer/core/html/media/media_source_tracer.h"
#include "third_party/blink/renderer/modules/mediasource/media_source.h" #include "third_party/blink/renderer/modules/mediasource/media_source.h"
......
...@@ -123,13 +123,6 @@ void SameThreadMediaSourceAttachment::Close(MediaSourceTracer* tracer) { ...@@ -123,13 +123,6 @@ void SameThreadMediaSourceAttachment::Close(MediaSourceTracer* tracer) {
GetMediaSource(tracer)->Close(); GetMediaSource(tracer)->Close();
} }
double SameThreadMediaSourceAttachment::duration(
MediaSourceTracer* tracer) const {
VerifyCalledWhileContextsAliveForDebugging();
return GetMediaSource(tracer)->duration();
}
WebTimeRanges SameThreadMediaSourceAttachment::BufferedInternal( WebTimeRanges SameThreadMediaSourceAttachment::BufferedInternal(
MediaSourceTracer* tracer) const { MediaSourceTracer* tracer) const {
VerifyCalledWhileContextsAliveForDebugging(); VerifyCalledWhileContextsAliveForDebugging();
...@@ -144,13 +137,6 @@ WebTimeRanges SameThreadMediaSourceAttachment::SeekableInternal( ...@@ -144,13 +137,6 @@ WebTimeRanges SameThreadMediaSourceAttachment::SeekableInternal(
return GetMediaSource(tracer)->SeekableInternal(); return GetMediaSource(tracer)->SeekableInternal();
} }
TimeRanges* SameThreadMediaSourceAttachment::Buffered(
MediaSourceTracer* tracer) const {
VerifyCalledWhileContextsAliveForDebugging();
return GetMediaSource(tracer)->Buffered();
}
void SameThreadMediaSourceAttachment::OnTrackChanged(MediaSourceTracer* tracer, void SameThreadMediaSourceAttachment::OnTrackChanged(MediaSourceTracer* tracer,
TrackBase* track) { TrackBase* track) {
// In this same thread implementation, the MSE side of the attachment can loop // In this same thread implementation, the MSE side of the attachment can loop
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_ATTACHMENT_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_ATTACHMENT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_ATTACHMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_ATTACHMENT_H_
#include <memory>
#include "third_party/blink/public/platform/web_time_range.h"
#include "third_party/blink/renderer/modules/mediasource/media_source.h" #include "third_party/blink/renderer/modules/mediasource/media_source.h"
#include "third_party/blink/renderer/modules/mediasource/media_source_attachment_supplement.h" #include "third_party/blink/renderer/modules/mediasource/media_source_attachment_supplement.h"
...@@ -32,10 +35,8 @@ class SameThreadMediaSourceAttachment final ...@@ -32,10 +35,8 @@ class SameThreadMediaSourceAttachment final
std::unique_ptr<WebMediaSource>) override; std::unique_ptr<WebMediaSource>) override;
void Close(MediaSourceTracer* tracer) override; void Close(MediaSourceTracer* tracer) override;
double duration(MediaSourceTracer* tracer) const override;
WebTimeRanges BufferedInternal(MediaSourceTracer* tracer) const override; WebTimeRanges BufferedInternal(MediaSourceTracer* tracer) const override;
WebTimeRanges SeekableInternal(MediaSourceTracer* tracer) const override; WebTimeRanges SeekableInternal(MediaSourceTracer* tracer) const override;
TimeRanges* Buffered(MediaSourceTracer* tracer) const override;
void OnTrackChanged(MediaSourceTracer* tracer, TrackBase*) override; void OnTrackChanged(MediaSourceTracer* tracer, TrackBase*) override;
void OnElementTimeUpdate(double time) final; void OnElementTimeUpdate(double time) final;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment