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

Side by Side Diff: third_party/WebKit/Source/core/dom/Fullscreen.cpp

Issue 2743023002: Migrate WTF::Deque::append() to ::push_back() (Closed)
Patch Set: rebase Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } else { 773 } else {
774 DCHECK(document.hasFullscreenSupplement()); 774 DCHECK(document.hasFullscreenSupplement());
775 Fullscreen& fullscreen = from(document); 775 Fullscreen& fullscreen = from(document);
776 EventTarget* target = fullscreen.fullscreenElement(); 776 EventTarget* target = fullscreen.fullscreenElement();
777 if (!target) 777 if (!target)
778 target = fullscreen.currentFullScreenElement(); 778 target = fullscreen.currentFullScreenElement();
779 if (!target) 779 if (!target)
780 target = &document; 780 target = &document;
781 event = createEvent(EventTypeNames::webkitfullscreenchange, *target); 781 event = createEvent(EventTypeNames::webkitfullscreenchange, *target);
782 } 782 }
783 m_eventQueue.append(event); 783 m_eventQueue.push_back(event);
784 // NOTE: The timer is started in didEnterFullscreen/didExitFullscreen. 784 // NOTE: The timer is started in didEnterFullscreen/didExitFullscreen.
785 } 785 }
786 786
787 void Fullscreen::enqueueErrorEvent(Element& element, RequestType requestType) { 787 void Fullscreen::enqueueErrorEvent(Element& element, RequestType requestType) {
788 Event* event; 788 Event* event;
789 if (requestType == RequestType::Unprefixed) 789 if (requestType == RequestType::Unprefixed)
790 event = createEvent(EventTypeNames::fullscreenerror, element.document()); 790 event = createEvent(EventTypeNames::fullscreenerror, element.document());
791 else 791 else
792 event = createEvent(EventTypeNames::webkitfullscreenerror, element); 792 event = createEvent(EventTypeNames::webkitfullscreenerror, element);
793 m_eventQueue.append(event); 793 m_eventQueue.push_back(event);
794 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE); 794 m_eventQueueTimer.startOneShot(0, BLINK_FROM_HERE);
795 } 795 }
796 796
797 void Fullscreen::eventQueueTimerFired(TimerBase*) { 797 void Fullscreen::eventQueueTimerFired(TimerBase*) {
798 HeapDeque<Member<Event>> eventQueue; 798 HeapDeque<Member<Event>> eventQueue;
799 m_eventQueue.swap(eventQueue); 799 m_eventQueue.swap(eventQueue);
800 800
801 while (!eventQueue.isEmpty()) { 801 while (!eventQueue.isEmpty()) {
802 Event* event = eventQueue.takeFirst(); 802 Event* event = eventQueue.takeFirst();
803 Node* target = event->target()->toNode(); 803 Node* target = event->target()->toNode();
804 804
805 // If the element was removed from our tree, also message the 805 // If the element was removed from our tree, also message the
806 // documentElement. 806 // documentElement.
807 if (!target->isConnected() && document()->documentElement()) { 807 if (!target->isConnected() && document()->documentElement()) {
808 DCHECK(isPrefixed(event->type())); 808 DCHECK(isPrefixed(event->type()));
809 eventQueue.append( 809 eventQueue.push_back(
810 createEvent(event->type(), *document()->documentElement())); 810 createEvent(event->type(), *document()->documentElement()));
811 } 811 }
812 812
813 target->dispatchEvent(event); 813 target->dispatchEvent(event);
814 } 814 }
815 } 815 }
816 816
817 void Fullscreen::elementRemoved(Element& oldNode) { 817 void Fullscreen::elementRemoved(Element& oldNode) {
818 // Whenever the removing steps run with an |oldNode| and |oldNode| is in its 818 // Whenever the removing steps run with an |oldNode| and |oldNode| is in its
819 // node document's fullscreen element stack, run these steps: 819 // node document's fullscreen element stack, run these steps:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 DEFINE_TRACE(Fullscreen) { 865 DEFINE_TRACE(Fullscreen) {
866 visitor->trace(m_pendingFullscreenElement); 866 visitor->trace(m_pendingFullscreenElement);
867 visitor->trace(m_fullscreenElementStack); 867 visitor->trace(m_fullscreenElementStack);
868 visitor->trace(m_currentFullScreenElement); 868 visitor->trace(m_currentFullScreenElement);
869 visitor->trace(m_eventQueue); 869 visitor->trace(m_eventQueue);
870 Supplement<Document>::trace(visitor); 870 Supplement<Document>::trace(visitor);
871 ContextLifecycleObserver::trace(visitor); 871 ContextLifecycleObserver::trace(visitor);
872 } 872 }
873 873
874 } // namespace blink 874 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontFace.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698