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

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

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/events/GenericEventQueue.cpp ('k') | Source/core/html/MediaFragmentURIParser.cpp » ('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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 void HTMLMediaElement::scheduleNextSourceChild() 541 void HTMLMediaElement::scheduleNextSourceChild()
542 { 542 {
543 // Schedule the timer to try the next <source> element WITHOUT resetting sta te ala prepareForLoad. 543 // Schedule the timer to try the next <source> element WITHOUT resetting sta te ala prepareForLoad.
544 m_pendingActionFlags |= LoadMediaResource; 544 m_pendingActionFlags |= LoadMediaResource;
545 m_loadTimer.startOneShot(0); 545 m_loadTimer.startOneShot(0);
546 } 546 }
547 547
548 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) 548 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
549 { 549 {
550 #if LOG_MEDIA_EVENTS 550 #if LOG_MEDIA_EVENTS
551 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventNam e.string().ascii().data()); 551 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventNam e.ascii().data());
552 #endif 552 #endif
553 m_asyncEventQueue->enqueueEvent(Event::createCancelable(eventName)); 553 m_asyncEventQueue->enqueueEvent(Event::createCancelable(eventName));
554 } 554 }
555 555
556 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*) 556 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*)
557 { 557 {
558 RefPtr<HTMLMediaElement> protect(this); // loadNextSourceChild may fire 'bef oreload', which can make arbitrary DOM mutations. 558 RefPtr<HTMLMediaElement> protect(this); // loadNextSourceChild may fire 'bef oreload', which can make arbitrary DOM mutations.
559 559
560 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L oadTextTrackResource)) 560 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L oadTextTrackResource))
561 configureTextTracks(); 561 configureTextTracks();
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 AtomicString& preload) 2084 void HTMLMediaElement::setPreload(const AtomicString& preload)
2085 { 2085 {
2086 WTF_LOG(Media, "HTMLMediaElement::setPreload(%s)", preload.string().utf8().d ata()); 2086 WTF_LOG(Media, "HTMLMediaElement::setPreload(%s)", preload.utf8().data());
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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2872 WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'src' is % s", urlForLoggingMedia(mediaURL).utf8().data()); 2872 WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'src' is % s", urlForLoggingMedia(mediaURL).utf8().data());
2873 #endif 2873 #endif
2874 if (mediaURL.isEmpty()) 2874 if (mediaURL.isEmpty())
2875 goto check_again; 2875 goto check_again;
2876 2876
2877 if (source->fastHasAttribute(mediaAttr)) { 2877 if (source->fastHasAttribute(mediaAttr)) {
2878 MediaQueryEvaluator screenEval("screen", document().frame(), rendere r() ? renderer()->style() : 0); 2878 MediaQueryEvaluator screenEval("screen", document().frame(), rendere r() ? renderer()->style() : 0);
2879 RefPtr<MediaQuerySet> media = MediaQuerySet::create(source->media()) ; 2879 RefPtr<MediaQuerySet> media = MediaQuerySet::create(source->media()) ;
2880 #if !LOG_DISABLED 2880 #if !LOG_DISABLED
2881 if (shouldLog) 2881 if (shouldLog)
2882 WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'media ' is %s", source->media().string().utf8().data()); 2882 WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'media ' is %s", source->media().utf8().data());
2883 #endif 2883 #endif
2884 if (!screenEval.eval(media.get())) { 2884 if (!screenEval.eval(media.get())) {
2885 UseCounter::count(document(), UseCounter::SourceElementNonMatchi ngMedia); 2885 UseCounter::count(document(), UseCounter::SourceElementNonMatchi ngMedia);
2886 goto check_again; 2886 goto check_again;
2887 } 2887 }
2888 } 2888 }
2889 2889
2890 type = source->type(); 2890 type = source->type();
2891 // FIXME(82965): Add support for keySystem in <source> and set system fr om source. 2891 // FIXME(82965): Add support for keySystem in <source> and set system fr om source.
2892 if (type.isEmpty() && mediaURL.protocolIsData()) 2892 if (type.isEmpty() && mediaURL.protocolIsData())
(...skipping 1017 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
« no previous file with comments | « Source/core/events/GenericEventQueue.cpp ('k') | Source/core/html/MediaFragmentURIParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698