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

Side by Side Diff: Source/core/dom/FullscreenElementStack.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/MainThreadTaskRunner.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) 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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // 5. Return, and run the remaining steps asynchronously. 245 // 5. Return, and run the remaining steps asynchronously.
246 // 6. Optionally, perform some animation. 246 // 6. Optionally, perform some animation.
247 m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT; 247 m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT;
248 document()->frameHost()->chrome().client().enterFullScreenForElement(ele ment); 248 document()->frameHost()->chrome().client().enterFullScreenForElement(ele ment);
249 249
250 // 7. Optionally, display a message indicating how the user can exit dis playing the context object fullscreen. 250 // 7. Optionally, display a message indicating how the user can exit dis playing the context object fullscreen.
251 return; 251 return;
252 } while (0); 252 } while (0);
253 253
254 m_fullScreenErrorEventTargetQueue.append(element ? element : document()->doc umentElement()); 254 m_fullScreenErrorEventTargetQueue.append(element ? element : document()->doc umentElement());
255 m_fullScreenChangeDelayTimer.startOneShot(0); 255 m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HERE);
256 } 256 }
257 257
258 void FullscreenElementStack::webkitCancelFullScreen() 258 void FullscreenElementStack::webkitCancelFullScreen()
259 { 259 {
260 // The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit ful lscreen" behavior, which 260 // The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit ful lscreen" behavior, which
261 // is defined as: 261 // is defined as:
262 // "To fully exit fullscreen act as if the exitFullscreen() method was invok ed on the top-level browsing 262 // "To fully exit fullscreen act as if the exitFullscreen() method was invok ed on the top-level browsing
263 // context's document and subsequently empty that document's fullscreen elem ent stack." 263 // context's document and subsequently empty that document's fullscreen elem ent stack."
264 if (!fullscreenElementFrom(document()->topDocument())) 264 if (!fullscreenElementFrom(document()->topDocument()))
265 return; 265 return;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 void FullscreenElementStack::webkitDidEnterFullScreenForElement(Element*) 400 void FullscreenElementStack::webkitDidEnterFullScreenForElement(Element*)
401 { 401 {
402 if (!m_fullScreenElement) 402 if (!m_fullScreenElement)
403 return; 403 return;
404 404
405 if (!document()->isActive()) 405 if (!document()->isActive())
406 return; 406 return;
407 407
408 m_fullScreenElement->didBecomeFullscreenElement(); 408 m_fullScreenElement->didBecomeFullscreenElement();
409 409
410 m_fullScreenChangeDelayTimer.startOneShot(0); 410 m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HERE);
411 } 411 }
412 412
413 void FullscreenElementStack::webkitWillExitFullScreenForElement(Element*) 413 void FullscreenElementStack::webkitWillExitFullScreenForElement(Element*)
414 { 414 {
415 if (!m_fullScreenElement) 415 if (!m_fullScreenElement)
416 return; 416 return;
417 417
418 if (!document()->isActive()) 418 if (!document()->isActive())
419 return; 419 return;
420 420
(...skipping 18 matching lines...) Expand all
439 m_fullScreenElement = nullptr; 439 m_fullScreenElement = nullptr;
440 document()->setNeedsStyleRecalc(SubtreeStyleChange); 440 document()->setNeedsStyleRecalc(SubtreeStyleChange);
441 441
442 // When webkitCancelFullScreen is called, we call webkitExitFullScreen on th e topDocument(). That 442 // When webkitCancelFullScreen is called, we call webkitExitFullScreen on th e topDocument(). That
443 // means that the events will be queued there. So if we have no events here, start the timer on 443 // means that the events will be queued there. So if we have no events here, start the timer on
444 // the exiting document. 444 // the exiting document.
445 Document* exitingDocument = document(); 445 Document* exitingDocument = document();
446 if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTa rgetQueue.isEmpty()) 446 if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTa rgetQueue.isEmpty())
447 exitingDocument = &document()->topDocument(); 447 exitingDocument = &document()->topDocument();
448 ASSERT(exitingDocument); 448 ASSERT(exitingDocument);
449 from(*exitingDocument).m_fullScreenChangeDelayTimer.startOneShot(0); 449 from(*exitingDocument).m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HER E);
450 } 450 }
451 451
452 void FullscreenElementStack::setFullScreenRenderer(RenderFullScreen* renderer) 452 void FullscreenElementStack::setFullScreenRenderer(RenderFullScreen* renderer)
453 { 453 {
454 if (renderer == m_fullScreenRenderer) 454 if (renderer == m_fullScreenRenderer)
455 return; 455 return;
456 456
457 if (renderer && m_savedPlaceholderRenderStyle) { 457 if (renderer && m_savedPlaceholderRenderStyle) {
458 renderer->createPlaceholder(m_savedPlaceholderRenderStyle.release(), m_s avedPlaceholderFrameRect); 458 renderer->createPlaceholder(m_savedPlaceholderRenderStyle.release(), m_s avedPlaceholderFrameRect);
459 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho lder()) { 459 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho lder()) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (!target) 570 if (!target)
571 target = fullscreen->webkitCurrentFullScreenElement(); 571 target = fullscreen->webkitCurrentFullScreenElement();
572 } 572 }
573 573
574 if (!target) 574 if (!target)
575 target = doc; 575 target = doc;
576 m_fullScreenChangeEventTargetQueue.append(target); 576 m_fullScreenChangeEventTargetQueue.append(target);
577 } 577 }
578 578
579 } // namespace WebCore 579 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/MainThreadTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698