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

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

Issue 2746763009: Migrate WTF::Deque::prepend() to ::push_front() (Closed)
Patch Set: 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 // For OOPIF scenarios, |docs| will only contain documents for local 426 // For OOPIF scenarios, |docs| will only contain documents for local
427 // ancestors, and remote ancestors will be processed in their 427 // ancestors, and remote ancestors will be processed in their
428 // respective processes. This preserves the spec's event firing order 428 // respective processes. This preserves the spec's event firing order
429 // for local ancestors, but not for remote ancestors. However, that 429 // for local ancestors, but not for remote ancestors. However, that
430 // difference shouldn't be observable in practice: a fullscreenchange 430 // difference shouldn't be observable in practice: a fullscreenchange
431 // event handler would need to postMessage a frame in another renderer 431 // event handler would need to postMessage a frame in another renderer
432 // process, where the message should be queued up and processed after 432 // process, where the message should be queued up and processed after
433 // the IPC that dispatches fullscreenchange. 433 // the IPC that dispatches fullscreenchange.
434 HeapDeque<Member<Document>> docs; 434 HeapDeque<Member<Document>> docs;
435 for (Document* doc = &document; doc; doc = nextLocalAncestor(*doc)) 435 for (Document* doc = &document; doc; doc = nextLocalAncestor(*doc))
436 docs.prepend(doc); 436 docs.push_front(doc);
437 437
438 // 4. For each document in docs, run these substeps: 438 // 4. For each document in docs, run these substeps:
439 HeapDeque<Member<Document>>::iterator current = docs.begin(), 439 HeapDeque<Member<Document>>::iterator current = docs.begin(),
440 following = docs.begin(); 440 following = docs.begin();
441 441
442 do { 442 do {
443 ++following; 443 ++following;
444 444
445 // 1. Let following document be the document after document in docs, or 445 // 1. Let following document be the document after document in docs, or
446 // null if there is no such document. 446 // null if there is no such document.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // with a non-empty fullscreen element stack (if any), ordered so that the 539 // with a non-empty fullscreen element stack (if any), ordered so that the
540 // child of the doc is last and the document furthest away from the doc is 540 // child of the doc is last and the document furthest away from the doc is
541 // first. 541 // first.
542 HeapDeque<Member<Document>> descendants; 542 HeapDeque<Member<Document>> descendants;
543 for (Frame* descendant = document.frame()->tree().traverseNext(); descendant; 543 for (Frame* descendant = document.frame()->tree().traverseNext(); descendant;
544 descendant = descendant->tree().traverseNext()) { 544 descendant = descendant->tree().traverseNext()) {
545 if (!descendant->isLocalFrame()) 545 if (!descendant->isLocalFrame())
546 continue; 546 continue;
547 DCHECK(toLocalFrame(descendant)->document()); 547 DCHECK(toLocalFrame(descendant)->document());
548 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) 548 if (fullscreenElementFrom(*toLocalFrame(descendant)->document()))
549 descendants.prepend(toLocalFrame(descendant)->document()); 549 descendants.push_front(toLocalFrame(descendant)->document());
550 } 550 }
551 551
552 // 4. For each descendant in descendants, empty descendant's fullscreen 552 // 4. For each descendant in descendants, empty descendant's fullscreen
553 // element stack, and queue a task to fire an event named fullscreenchange 553 // element stack, and queue a task to fire an event named fullscreenchange
554 // with its bubbles attribute set to true on descendant. 554 // with its bubbles attribute set to true on descendant.
555 for (auto& descendant : descendants) { 555 for (auto& descendant : descendants) {
556 DCHECK(descendant); 556 DCHECK(descendant);
557 RequestType requestType = 557 RequestType requestType =
558 from(*descendant).m_fullscreenElementStack.back().second; 558 from(*descendant).m_fullscreenElementStack.back().second;
559 from(*descendant).clearFullscreenElementStack(); 559 from(*descendant).clearFullscreenElementStack();
(...skipping 305 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

Powered by Google App Engine
This is Rietveld 408576698