Commit 460deb76 authored by Matt Wolenetz's avatar Matt Wolenetz Committed by Commit Bot

MSE-in-Workers: Rename MediaSourceTracerImpl

Like the recent rename of MediaSourceAttachmentImpl to
SameThreadMediaSourceAttachment [1], this change renames
MediaSourceTracerImpl to SameThreadMediaSourceTracer. There is no
behavior change.

This change makes it more clear that the tracer being renamed here is
the same-thread version, since later changes will introduce a
cross-thread version.

[1] https://crrev.com/803635

BUG=878133

Change-Id: I3cfa000db21ca87fe79bf73ea2d2490c1976df32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390966Reviewed-by: default avatarWill Cassella <cassew@google.com>
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804446}
parent 5d17caa9
...@@ -14,10 +14,10 @@ blink_modules_sources("mediasource") { ...@@ -14,10 +14,10 @@ blink_modules_sources("mediasource") {
"media_source_attachment_supplement.h", "media_source_attachment_supplement.h",
"media_source_registry_impl.cc", "media_source_registry_impl.cc",
"media_source_registry_impl.h", "media_source_registry_impl.h",
"media_source_tracer_impl.cc",
"media_source_tracer_impl.h",
"same_thread_media_source_attachment.cc", "same_thread_media_source_attachment.cc",
"same_thread_media_source_attachment.h", "same_thread_media_source_attachment.h",
"same_thread_media_source_tracer.cc",
"same_thread_media_source_tracer.h",
"source_buffer.cc", "source_buffer.cc",
"source_buffer.h", "source_buffer.h",
"source_buffer_list.cc", "source_buffer_list.cc",
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/html/track/audio_track_list.h" #include "third_party/blink/renderer/core/html/track/audio_track_list.h"
#include "third_party/blink/renderer/core/html/track/video_track_list.h" #include "third_party/blink/renderer/core/html/track/video_track_list.h"
#include "third_party/blink/renderer/modules/mediasource/media_source_tracer_impl.h" #include "third_party/blink/renderer/modules/mediasource/same_thread_media_source_tracer.h"
#include "third_party/blink/renderer/modules/mediasource/source_buffer_track_base_supplement.h" #include "third_party/blink/renderer/modules/mediasource/source_buffer_track_base_supplement.h"
#include "third_party/blink/renderer/platform/bindings/exception_messages.h" #include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h"
...@@ -855,7 +855,7 @@ MediaSourceTracer* MediaSource::StartAttachingToMediaElement( ...@@ -855,7 +855,7 @@ MediaSourceTracer* MediaSource::StartAttachingToMediaElement(
attached_element_ = element; attached_element_ = element;
media_source_attachment_ = attachment; media_source_attachment_ = attachment;
attachment_tracer_ = attachment_tracer_ =
MakeGarbageCollected<MediaSourceTracerImpl>(element, this); MakeGarbageCollected<SameThreadMediaSourceTracer>(element, this);
return attachment_tracer_; return attachment_tracer_;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "third_party/blink/renderer/modules/mediasource/media_source_attachment_supplement.h" #include "third_party/blink/renderer/modules/mediasource/media_source_attachment_supplement.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_tracer_impl.h" #include "third_party/blink/renderer/modules/mediasource/same_thread_media_source_tracer.h"
namespace blink { namespace blink {
......
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/media/html_media_element.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_tracer_impl.h" #include "third_party/blink/renderer/modules/mediasource/same_thread_media_source_tracer.h"
namespace { namespace {
// Downcasts |tracer| to the expected same-thread attachment's tracer type. // Downcasts |tracer| to the expected same-thread attachment's tracer type.
// Includes a debug-mode check that the tracer matches the expected attachment // Includes a debug-mode check that the tracer matches the expected attachment
// semantic. // semantic.
blink::MediaSourceTracerImpl* GetTracerImpl(blink::MediaSourceTracer* tracer) { blink::SameThreadMediaSourceTracer* GetTracerImpl(
blink::MediaSourceTracer* tracer) {
DCHECK(!tracer || !tracer->IsCrossThreadForDebugging()); DCHECK(!tracer || !tracer->IsCrossThreadForDebugging());
return static_cast<blink::MediaSourceTracerImpl*>(tracer); return static_cast<blink::SameThreadMediaSourceTracer*>(tracer);
} }
blink::MediaSource* GetMediaSource(blink::MediaSourceTracer* tracer) { blink::MediaSource* GetMediaSource(blink::MediaSourceTracer* tracer) {
......
...@@ -2,18 +2,19 @@ ...@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "third_party/blink/renderer/modules/mediasource/media_source_tracer_impl.h" #include "third_party/blink/renderer/modules/mediasource/same_thread_media_source_tracer.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/modules/mediasource/media_source.h" #include "third_party/blink/renderer/modules/mediasource/media_source.h"
namespace blink { namespace blink {
MediaSourceTracerImpl::MediaSourceTracerImpl(HTMLMediaElement* media_element, SameThreadMediaSourceTracer::SameThreadMediaSourceTracer(
MediaSource* media_source) HTMLMediaElement* media_element,
MediaSource* media_source)
: media_element_(media_element), media_source_(media_source) {} : media_element_(media_element), media_source_(media_source) {}
void MediaSourceTracerImpl::Trace(Visitor* visitor) const { void SameThreadMediaSourceTracer::Trace(Visitor* visitor) const {
visitor->Trace(media_element_); visitor->Trace(media_element_);
visitor->Trace(media_source_); visitor->Trace(media_source_);
MediaSourceTracer::Trace(visitor); MediaSourceTracer::Trace(visitor);
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_TRACER_IMPL_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_TRACER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_TRACER_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_TRACER_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/platform/heap/handle.h" #include "third_party/blink/renderer/platform/heap/handle.h"
...@@ -17,13 +17,13 @@ class MediaSource; ...@@ -17,13 +17,13 @@ class MediaSource;
// MediaSource on the same (main) thread to trace into each other. This enables // MediaSource on the same (main) thread to trace into each other. This enables
// garbage collection to automatically detect and collect idle attachments of // garbage collection to automatically detect and collect idle attachments of
// these objects that have no other strong references. Concrete // these objects that have no other strong references. Concrete
// MediaSourceAttachments use MediaSourceTracerImpls as the authoritative // MediaSourceAttachments use SameThreadMediaSourceTracers as the authoritative
// reference holders for each side of the attachments. // reference holders for each side of the attachments.
class MediaSourceTracerImpl final : public MediaSourceTracer { class SameThreadMediaSourceTracer final : public MediaSourceTracer {
public: public:
MediaSourceTracerImpl(HTMLMediaElement* media_element, SameThreadMediaSourceTracer(HTMLMediaElement* media_element,
MediaSource* media_source); MediaSource* media_source);
~MediaSourceTracerImpl() override = default; ~SameThreadMediaSourceTracer() override = default;
void Trace(Visitor* visitor) const override; void Trace(Visitor* visitor) const override;
...@@ -40,4 +40,4 @@ class MediaSourceTracerImpl final : public MediaSourceTracer { ...@@ -40,4 +40,4 @@ class MediaSourceTracerImpl final : public MediaSourceTracer {
} // namespace blink } // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_TRACER_IMPL_H_ #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SAME_THREAD_MEDIA_SOURCE_TRACER_H_
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