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

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

Issue 61763017: Replace redundant <track> runtime checks with asserts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: revert some Created 7 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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 2517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 for (int i = m_textTracks->length() - 1; i >= 0; --i) { 2528 for (int i = m_textTracks->length() - 1; i >= 0; --i) {
2529 TextTrack* track = m_textTracks->item(i); 2529 TextTrack* track = m_textTracks->item(i);
2530 2530
2531 if (track->trackType() == TextTrack::InBand) 2531 if (track->trackType() == TextTrack::InBand)
2532 removeTrack(track); 2532 removeTrack(track);
2533 } 2533 }
2534 } 2534 }
2535 2535
2536 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const S tring& label, const String& language, ExceptionState& es) 2536 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const S tring& label, const String& language, ExceptionState& es)
2537 { 2537 {
2538 if (!RuntimeEnabledFeatures::videoTrackEnabled()) 2538 ASSERT(RuntimeEnabledFeatures::videoTrackEnabled());
2539 return 0;
2540 2539
2541 // 4.8.10.12.4 Text track API 2540 // 4.8.10.12.4 Text track API
2542 // The addTextTrack(kind, label, language) method of media elements, when in voked, must run the following steps: 2541 // The addTextTrack(kind, label, language) method of media elements, when in voked, must run the following steps:
2543 2542
2544 // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps 2543 // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps
2545 if (!TextTrack::isValidKindKeyword(kind)) { 2544 if (!TextTrack::isValidKindKeyword(kind)) {
2546 es.throwUninformativeAndGenericDOMException(SyntaxError); 2545 es.throwUninformativeAndGenericDOMException(SyntaxError);
2547 return 0; 2546 return 0;
2548 } 2547 }
2549 2548
(...skipping 15 matching lines...) Expand all
2565 textTrack->setReadinessState(TextTrack::Loaded); 2564 textTrack->setReadinessState(TextTrack::Loaded);
2566 2565
2567 // ... its text track mode to the text track hidden mode, and its text track list of cues to an empty list ... 2566 // ... its text track mode to the text track hidden mode, and its text track list of cues to an empty list ...
2568 textTrack->setMode(TextTrack::hiddenKeyword()); 2567 textTrack->setMode(TextTrack::hiddenKeyword());
2569 2568
2570 return textTrack.release(); 2569 return textTrack.release();
2571 } 2570 }
2572 2571
2573 TextTrackList* HTMLMediaElement::textTracks() 2572 TextTrackList* HTMLMediaElement::textTracks()
2574 { 2573 {
2575 if (!RuntimeEnabledFeatures::videoTrackEnabled()) 2574 ASSERT(RuntimeEnabledFeatures::videoTrackEnabled());
2576 return 0;
2577 2575
2578 if (!m_textTracks) 2576 if (!m_textTracks)
2579 m_textTracks = TextTrackList::create(this); 2577 m_textTracks = TextTrackList::create(this);
2580 2578
2581 return m_textTracks.get(); 2579 return m_textTracks.get();
2582 } 2580 }
2583 2581
2584 void HTMLMediaElement::didAddTrack(HTMLTrackElement* trackElement) 2582 void HTMLMediaElement::didAddTrack(HTMLTrackElement* trackElement)
2585 { 2583 {
2586 ASSERT(trackElement->hasTagName(trackTag)); 2584 ASSERT(trackElement->hasTagName(trackTag));
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
3872 { 3870 {
3873 scheduleLayerUpdate(); 3871 scheduleLayerUpdate();
3874 } 3872 }
3875 3873
3876 bool HTMLMediaElement::isInteractiveContent() const 3874 bool HTMLMediaElement::isInteractiveContent() const
3877 { 3875 {
3878 return fastHasAttribute(controlsAttr); 3876 return fastHasAttribute(controlsAttr);
3879 } 3877 }
3880 3878
3881 } 3879 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698