Chromium Code Reviews

Side by Side Diff: Source/core/page/Page.cpp

Issue 551973005: Streamline frame detach (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 110 matching lines...)
121 , m_focusController(FocusController::create(this)) 121 , m_focusController(FocusController::create(this))
122 , m_contextMenuController(ContextMenuController::create(this, pageClients.co ntextMenuClient)) 122 , m_contextMenuController(ContextMenuController::create(this, pageClients.co ntextMenuClient))
123 , m_inspectorController(InspectorController::create(this, pageClients.inspec torClient)) 123 , m_inspectorController(InspectorController::create(this, pageClients.inspec torClient))
124 , m_pointerLockController(PointerLockController::create(this)) 124 , m_pointerLockController(PointerLockController::create(this))
125 , m_undoStack(UndoStack::create()) 125 , m_undoStack(UndoStack::create())
126 , m_mainFrame(0) 126 , m_mainFrame(0)
127 , m_backForwardClient(pageClients.backForwardClient) 127 , m_backForwardClient(pageClients.backForwardClient)
128 , m_editorClient(pageClients.editorClient) 128 , m_editorClient(pageClients.editorClient)
129 , m_spellCheckerClient(pageClients.spellCheckerClient) 129 , m_spellCheckerClient(pageClients.spellCheckerClient)
130 , m_storageClient(pageClients.storageClient) 130 , m_storageClient(pageClients.storageClient)
131 , m_subframeCount(0)
132 , m_openedByDOM(false) 131 , m_openedByDOM(false)
133 , m_tabKeyCyclesThroughElements(true) 132 , m_tabKeyCyclesThroughElements(true)
134 , m_defersLoading(false) 133 , m_defersLoading(false)
135 , m_deviceScaleFactor(1) 134 , m_deviceScaleFactor(1)
136 , m_timerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()) 135 , m_timerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval())
137 , m_visibilityState(PageVisibilityStateVisible) 136 , m_visibilityState(PageVisibilityStateVisible)
138 , m_isCursorVisible(true) 137 , m_isCursorVisible(true)
139 #if ENABLE(ASSERT) 138 #if ENABLE(ASSERT)
140 , m_isPainting(false) 139 , m_isPainting(false)
141 #endif 140 #endif
(...skipping 291 matching lines...)
433 if (frame->isLocalFrame() && toLocalFrame(frame)->document()) 432 if (frame->isLocalFrame() && toLocalFrame(frame)->document())
434 toLocalFrame(frame)->document()->didChangeTimerAlignmentInterval(); 433 toLocalFrame(frame)->document()->didChangeTimerAlignmentInterval();
435 } 434 }
436 } 435 }
437 436
438 double Page::timerAlignmentInterval() const 437 double Page::timerAlignmentInterval() const
439 { 438 {
440 return m_timerAlignmentInterval; 439 return m_timerAlignmentInterval;
441 } 440 }
442 441
443 #if ENABLE(ASSERT)
444 void Page::checkSubframeCountConsistency() const
445 {
446 ASSERT(m_subframeCount >= 0);
447
448 int subframeCount = 0;
449 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() )
450 ++subframeCount;
451
452 ASSERT(m_subframeCount + 1 == subframeCount);
453 }
454 #endif
455
456 void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia lState) 442 void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia lState)
457 { 443 {
458 if (m_visibilityState == visibilityState) 444 if (m_visibilityState == visibilityState)
459 return; 445 return;
460 m_visibilityState = visibilityState; 446 m_visibilityState = visibilityState;
461 447
462 if (visibilityState == blink::PageVisibilityStateVisible) 448 if (visibilityState == blink::PageVisibilityStateVisible)
463 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()); 449 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval());
464 else 450 else
465 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval()); 451 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval());
(...skipping 195 matching lines...)
661 , spellCheckerClient(0) 647 , spellCheckerClient(0)
662 , storageClient(0) 648 , storageClient(0)
663 { 649 {
664 } 650 }
665 651
666 Page::PageClients::~PageClients() 652 Page::PageClients::~PageClients()
667 { 653 {
668 } 654 }
669 655
670 } // namespace blink 656 } // namespace blink
OLDNEW

Powered by Google App Engine