Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 177003025: Remove TextTrackClient interface to simplify TextTrack code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 HTMLMediaElement::~HTMLMediaElement() 327 HTMLMediaElement::~HTMLMediaElement()
328 { 328 {
329 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); 329 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement");
330 330
331 m_asyncEventQueue->close(); 331 m_asyncEventQueue->close();
332 332
333 setShouldDelayLoadEvent(false); 333 setShouldDelayLoadEvent(false);
334 334
335 if (m_textTracks) 335 if (m_textTracks)
336 m_textTracks->clearOwnerAndClients(); 336 m_textTracks->clearOwner();
337 337
338 if (m_mediaController) { 338 if (m_mediaController) {
339 m_mediaController->removeMediaElement(this); 339 m_mediaController->removeMediaElement(this);
340 m_mediaController = nullptr; 340 m_mediaController = nullptr;
341 } 341 }
342 342
343 closeMediaSource(); 343 closeMediaSource();
344 344
345 setMediaKeysInternal(0); 345 setMediaKeysInternal(0);
346 346
(...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 return paused() || ended() || m_readyState < HAVE_METADATA; 2482 return paused() || ended() || m_readyState < HAVE_METADATA;
2483 } 2483 }
2484 2484
2485 void HTMLMediaElement::mediaPlayerDidAddTextTrack(WebInbandTextTrack* webTrack) 2485 void HTMLMediaElement::mediaPlayerDidAddTextTrack(WebInbandTextTrack* webTrack)
2486 { 2486 {
2487 if (!RuntimeEnabledFeatures::videoTrackEnabled()) 2487 if (!RuntimeEnabledFeatures::videoTrackEnabled())
2488 return; 2488 return;
2489 2489
2490 // 4.8.10.12.2 Sourcing in-band text tracks 2490 // 4.8.10.12.2 Sourcing in-band text tracks
2491 // 1. Associate the relevant data with a new text track and its correspondin g new TextTrack object. 2491 // 1. Associate the relevant data with a new text track and its correspondin g new TextTrack object.
2492 RefPtr<InbandTextTrack> textTrack = InbandTextTrack::create(document(), this , webTrack); 2492 RefPtr<InbandTextTrack> textTrack = InbandTextTrack::create(document(), webT rack);
2493 2493
2494 // 2. Set the new text track's kind, label, and language based on the semant ics of the relevant data, 2494 // 2. Set the new text track's kind, label, and language based on the semant ics of the relevant data,
2495 // as defined by the relevant specification. If there is no label in that da ta, then the label must 2495 // as defined by the relevant specification. If there is no label in that da ta, then the label must
2496 // be set to the empty string. 2496 // be set to the empty string.
2497 // 3. Associate the text track list of cues with the rules for updating the text track rendering appropriate 2497 // 3. Associate the text track list of cues with the rules for updating the text track rendering appropriate
2498 // for the format in question. 2498 // for the format in question.
2499 // 4. If the new text track's kind is metadata, then set the text track in-b and metadata track dispatch type 2499 // 4. If the new text track's kind is metadata, then set the text track in-b and metadata track dispatch type
2500 // as follows, based on the type of the media resource: 2500 // as follows, based on the type of the media resource:
2501 // 5. Populate the new text track's list of cues with the cues parsed so far , folllowing the guidelines for exposing 2501 // 5. Populate the new text track's list of cues with the cues parsed so far , folllowing the guidelines for exposing
2502 // cues, and begin updating it dynamically as necessary. 2502 // cues, and begin updating it dynamically as necessary.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 exceptionState.throwDOMException(SyntaxError, "The 'kind' provided ('" + kind + "') is invalid."); 2576 exceptionState.throwDOMException(SyntaxError, "The 'kind' provided ('" + kind + "') is invalid.");
2577 return nullptr; 2577 return nullptr;
2578 } 2578 }
2579 2579
2580 // 2. If the label argument was omitted, let label be the empty string. 2580 // 2. If the label argument was omitted, let label be the empty string.
2581 // 3. If the language argument was omitted, let language be the empty string . 2581 // 3. If the language argument was omitted, let language be the empty string .
2582 // 4. Create a new TextTrack object. 2582 // 4. Create a new TextTrack object.
2583 2583
2584 // 5. Create a new text track corresponding to the new object, and set its t ext track kind to kind, its text 2584 // 5. Create a new text track corresponding to the new object, and set its t ext track kind to kind, its text
2585 // track label to label, its text track language to language... 2585 // track label to label, its text track language to language...
2586 RefPtr<TextTrack> textTrack = TextTrack::create(document(), this, kind, labe l, language); 2586 RefPtr<TextTrack> textTrack = TextTrack::create(document(), kind, label, lan guage);
2587 2587
2588 // Note, due to side effects when changing track parameters, we have to 2588 // Note, due to side effects when changing track parameters, we have to
2589 // first append the track to the text track list. 2589 // first append the track to the text track list.
2590 2590
2591 // 6. Add the new text track to the media element's list of text tracks. 2591 // 6. Add the new text track to the media element's list of text tracks.
2592 addTextTrack(textTrack.get()); 2592 addTextTrack(textTrack.get());
2593 2593
2594 // ... its text track readiness state to the text track loaded state ... 2594 // ... its text track readiness state to the text track loaded state ...
2595 textTrack->setReadinessState(TextTrack::Loaded); 2595 textTrack->setReadinessState(TextTrack::Loaded);
2596 2596
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
3926 { 3926 {
3927 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3927 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3928 } 3928 }
3929 3929
3930 bool HTMLMediaElement::isInteractiveContent() const 3930 bool HTMLMediaElement::isInteractiveContent() const
3931 { 3931 {
3932 return fastHasAttribute(controlsAttr); 3932 return fastHasAttribute(controlsAttr);
3933 } 3933 }
3934 3934
3935 } 3935 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698