Bug 1383628. P5 - move CanClone() from MediaResource to BaseMediaResource. r=gerald
1. we move clone related methods to BaseMediaResource which is the only cloneable sub-class of MediaResource. 2. add CanClone() to ChannelMediaDecoder to reduce the dependency on MediaResource for HTMLMediaElement. MediaResource should be internal details to MediaDecoder. MozReview-Commit-ID: Hl2nAiuyTO0
This commit is contained in:
@@ -3744,9 +3744,11 @@ HTMLMediaElement::LookupMediaElementURITable(nsIURI* aURI)
|
||||
// Ditto for anything else that could cause us to send different headers.
|
||||
if (NS_SUCCEEDED(elem->NodePrincipal()->Equals(NodePrincipal(), &equal)) && equal &&
|
||||
elem->mCORSMode == mCORSMode) {
|
||||
NS_ASSERTION(elem->mDecoder && elem->mDecoder->GetResource(), "Decoder gone");
|
||||
MediaResource* resource = elem->mDecoder->GetResource();
|
||||
if (resource->CanClone()) {
|
||||
// See SetupDecoder() below. We only add a element to the table when
|
||||
// mDecoder is a ChannelMediaDecoder.
|
||||
auto decoder = static_cast<ChannelMediaDecoder*>(elem->mDecoder.get());
|
||||
NS_ASSERTION(decoder, "Decoder gone");
|
||||
if (decoder->CanClone()) {
|
||||
return elem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user