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

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

Issue 108313015: Make calls to AtomicString(const String&) explicit in html/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take feedback into consideration Created 6 years, 11 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
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 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 break; 2074 break;
2075 case MediaPlayer::Auto: 2075 case MediaPlayer::Auto:
2076 return "auto"; 2076 return "auto";
2077 break; 2077 break;
2078 } 2078 }
2079 2079
2080 ASSERT_NOT_REACHED(); 2080 ASSERT_NOT_REACHED();
2081 return String(); 2081 return String();
2082 } 2082 }
2083 2083
2084 void HTMLMediaElement::setPreload(const String& preload) 2084 void HTMLMediaElement::setPreload(const AtomicString& preload)
2085 { 2085 {
2086 WTF_LOG(Media, "HTMLMediaElement::setPreload(%s)", preload.utf8().data()); 2086 WTF_LOG(Media, "HTMLMediaElement::setPreload(%s)", preload.string().utf8().d ata());
eseidel 2014/01/02 19:18:28 Yup, definitely should add an AtomicString::utf8()
2087 setAttribute(preloadAttr, preload); 2087 setAttribute(preloadAttr, preload);
2088 } 2088 }
2089 2089
2090 void HTMLMediaElement::play() 2090 void HTMLMediaElement::play()
2091 { 2091 {
2092 WTF_LOG(Media, "HTMLMediaElement::play()"); 2092 WTF_LOG(Media, "HTMLMediaElement::play()");
2093 2093
2094 if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingU serGesture()) 2094 if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingU serGesture())
2095 return; 2095 return;
2096 if (UserGestureIndicator::processingUserGesture()) 2096 if (UserGestureIndicator::processingUserGesture())
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 2527
2528 TrackDisplayUpdateScope scope(this); 2528 TrackDisplayUpdateScope scope(this);
2529 for (int i = m_textTracks->length() - 1; i >= 0; --i) { 2529 for (int i = m_textTracks->length() - 1; i >= 0; --i) {
2530 TextTrack* track = m_textTracks->item(i); 2530 TextTrack* track = m_textTracks->item(i);
2531 2531
2532 if (track->trackType() == TextTrack::InBand) 2532 if (track->trackType() == TextTrack::InBand)
2533 removeTrack(track); 2533 removeTrack(track);
2534 } 2534 }
2535 } 2535 }
2536 2536
2537 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const S tring& label, const String& language, ExceptionState& exceptionState) 2537 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const AtomicString& kind, c onst AtomicString& label, const AtomicString& language, ExceptionState& exceptio nState)
2538 { 2538 {
2539 ASSERT(RuntimeEnabledFeatures::videoTrackEnabled()); 2539 ASSERT(RuntimeEnabledFeatures::videoTrackEnabled());
2540 2540
2541 // 4.8.10.12.4 Text track API 2541 // 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: 2542 // The addTextTrack(kind, label, language) method of media elements, when in voked, must run the following steps:
2543 2543
2544 // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps 2544 // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps
2545 if (!TextTrack::isValidKindKeyword(kind)) { 2545 if (!TextTrack::isValidKindKeyword(kind)) {
2546 exceptionState.throwUninformativeAndGenericDOMException(SyntaxError); 2546 exceptionState.throwUninformativeAndGenericDOMException(SyntaxError);
2547 return 0; 2547 return 0;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get()); 2638 size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get());
2639 if (index != kNotFound) 2639 if (index != kNotFound)
2640 m_textTracksWhenResourceSelectionBegan.remove(index); 2640 m_textTracksWhenResourceSelectionBegan.remove(index);
2641 } 2641 }
2642 2642
2643 static int textTrackLanguageSelectionScore(const TextTrack& track) 2643 static int textTrackLanguageSelectionScore(const TextTrack& track)
2644 { 2644 {
2645 if (track.language().isEmpty()) 2645 if (track.language().isEmpty())
2646 return 0; 2646 return 0;
2647 2647
2648 Vector<String> languages = userPreferredLanguages(); 2648 Vector<AtomicString> languages = userPreferredLanguages();
2649 size_t languageMatchIndex = indexOfBestMatchingLanguageInList(track.language (), languages); 2649 size_t languageMatchIndex = indexOfBestMatchingLanguageInList(track.language (), languages);
2650 if (languageMatchIndex >= languages.size()) 2650 if (languageMatchIndex >= languages.size())
2651 return 0; 2651 return 0;
2652 2652
2653 // Matching a track language is more important than matching track type, so this multiplier must be 2653 // Matching a track language is more important than matching track type, so this multiplier must be
2654 // greater than the maximum value returned by textTrackSelectionScore. 2654 // greater than the maximum value returned by textTrackSelectionScore.
2655 return (languages.size() - languageMatchIndex) * 10; 2655 return (languages.size() - languageMatchIndex) * 10;
2656 } 2656 }
2657 2657
2658 static int textTrackSelectionScore(const TextTrack& track, Settings* settings) 2658 static int textTrackSelectionScore(const TextTrack& track, Settings* settings)
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
3910 if (m_webLayer) 3910 if (m_webLayer)
3911 m_webLayer->setOpaque(m_opaque); 3911 m_webLayer->setOpaque(m_opaque);
3912 } 3912 }
3913 3913
3914 bool HTMLMediaElement::isInteractiveContent() const 3914 bool HTMLMediaElement::isInteractiveContent() const
3915 { 3915 {
3916 return fastHasAttribute(controlsAttr); 3916 return fastHasAttribute(controlsAttr);
3917 } 3917 }
3918 3918
3919 } 3919 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698