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

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: Rebase Created 6 years, 9 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLTrackElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 return paused() || ended() || m_readyState < HAVE_METADATA; 2483 return paused() || ended() || m_readyState < HAVE_METADATA;
2484 } 2484 }
2485 2485
2486 void HTMLMediaElement::mediaPlayerDidAddTextTrack(WebInbandTextTrack* webTrack) 2486 void HTMLMediaElement::mediaPlayerDidAddTextTrack(WebInbandTextTrack* webTrack)
2487 { 2487 {
2488 if (!RuntimeEnabledFeatures::videoTrackEnabled()) 2488 if (!RuntimeEnabledFeatures::videoTrackEnabled())
2489 return; 2489 return;
2490 2490
2491 // 4.8.10.12.2 Sourcing in-band text tracks 2491 // 4.8.10.12.2 Sourcing in-band text tracks
2492 // 1. Associate the relevant data with a new text track and its correspondin g new TextTrack object. 2492 // 1. Associate the relevant data with a new text track and its correspondin g new TextTrack object.
2493 RefPtr<InbandTextTrack> textTrack = InbandTextTrack::create(document(), this , webTrack); 2493 RefPtr<InbandTextTrack> textTrack = InbandTextTrack::create(document(), webT rack);
2494 2494
2495 // 2. Set the new text track's kind, label, and language based on the semant ics of the relevant data, 2495 // 2. Set the new text track's kind, label, and language based on the semant ics of the relevant data,
2496 // as defined by the relevant specification. If there is no label in that da ta, then the label must 2496 // as defined by the relevant specification. If there is no label in that da ta, then the label must
2497 // be set to the empty string. 2497 // be set to the empty string.
2498 // 3. Associate the text track list of cues with the rules for updating the text track rendering appropriate 2498 // 3. Associate the text track list of cues with the rules for updating the text track rendering appropriate
2499 // for the format in question. 2499 // for the format in question.
2500 // 4. If the new text track's kind is metadata, then set the text track in-b and metadata track dispatch type 2500 // 4. If the new text track's kind is metadata, then set the text track in-b and metadata track dispatch type
2501 // as follows, based on the type of the media resource: 2501 // as follows, based on the type of the media resource:
2502 // 5. Populate the new text track's list of cues with the cues parsed so far , folllowing the guidelines for exposing 2502 // 5. Populate the new text track's list of cues with the cues parsed so far , folllowing the guidelines for exposing
2503 // cues, and begin updating it dynamically as necessary. 2503 // cues, and begin updating it dynamically as necessary.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 exceptionState.throwDOMException(SyntaxError, "The 'kind' provided ('" + kind + "') is invalid."); 2577 exceptionState.throwDOMException(SyntaxError, "The 'kind' provided ('" + kind + "') is invalid.");
2578 return nullptr; 2578 return nullptr;
2579 } 2579 }
2580 2580
2581 // 2. If the label argument was omitted, let label be the empty string. 2581 // 2. If the label argument was omitted, let label be the empty string.
2582 // 3. If the language argument was omitted, let language be the empty string . 2582 // 3. If the language argument was omitted, let language be the empty string .
2583 // 4. Create a new TextTrack object. 2583 // 4. Create a new TextTrack object.
2584 2584
2585 // 5. Create a new text track corresponding to the new object, and set its t ext track kind to kind, its text 2585 // 5. Create a new text track corresponding to the new object, and set its t ext track kind to kind, its text
2586 // track label to label, its text track language to language... 2586 // track label to label, its text track language to language...
2587 RefPtr<TextTrack> textTrack = TextTrack::create(document(), this, kind, labe l, language); 2587 RefPtr<TextTrack> textTrack = TextTrack::create(document(), kind, label, lan guage);
2588 2588
2589 // Note, due to side effects when changing track parameters, we have to 2589 // Note, due to side effects when changing track parameters, we have to
2590 // first append the track to the text track list. 2590 // first append the track to the text track list.
2591 2591
2592 // 6. Add the new text track to the media element's list of text tracks. 2592 // 6. Add the new text track to the media element's list of text tracks.
2593 addTextTrack(textTrack.get()); 2593 addTextTrack(textTrack.get());
2594 2594
2595 // ... its text track readiness state to the text track loaded state ... 2595 // ... its text track readiness state to the text track loaded state ...
2596 textTrack->setReadinessState(TextTrack::Loaded); 2596 textTrack->setReadinessState(TextTrack::Loaded);
2597 2597
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
3927 { 3927 {
3928 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3928 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3929 } 3929 }
3930 3930
3931 bool HTMLMediaElement::isInteractiveContent() const 3931 bool HTMLMediaElement::isInteractiveContent() const
3932 { 3932 {
3933 return fastHasAttribute(controlsAttr); 3933 return fastHasAttribute(controlsAttr);
3934 } 3934 }
3935 3935
3936 } 3936 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLTrackElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698