#include "core/fetch/ResourceFetcher.h"
#include "core/frame/DOMTimer.h"
#include "core/frame/LocalDOMWindow.h"
-#include "core/frame/EventHandlerRegistry.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/page/StorageClient.h"
#include "core/page/ValidationMessageClient.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/rendering/FastTextAutosizer.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/TextAutosizer.h"
#include "core/storage/StorageNamespace.h"
#include "wtf/StdLibExtras.h"
#include "wtf/text/Base64.h"
-namespace WebCore {
+namespace blink {
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, pageCounter, ("Page"));
, m_timerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval())
, m_visibilityState(PageVisibilityStateVisible)
, m_isCursorVisible(true)
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
, m_isPainting(false)
#endif
, m_frameHost(FrameHost::create(*this))
void Page::setMainFrame(Frame* mainFrame)
{
- ASSERT(!m_mainFrame); // Should only be called during initialization
+ // Should only be called during initialization or swaps between local and
+ // remote frames.
+ // FIXME: Unfortunately we can't assert on this at the moment, because this
+ // is called in the base constructor for both LocalFrame and RemoteFrame,
+ // when the vtables for the derived classes have not yet been setup.
m_mainFrame = mainFrame;
}
m_contextMenuController->documentDetached(document);
if (m_validationMessageClient)
m_validationMessageClient->documentDetached(*document);
- m_frameHost->eventHandlerRegistry().documentDetached(*document);
}
bool Page::openedByDOM() const
return m_timerAlignmentInterval;
}
-#if ASSERT_ENABLED
+#if ENABLE(ASSERT)
void Page::checkSubframeCountConsistency() const
{
ASSERT(m_subframeCount >= 0);
return;
m_visibilityState = visibilityState;
- if (visibilityState == WebCore::PageVisibilityStateHidden)
- setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval());
- else
+ if (visibilityState == blink::PageVisibilityStateVisible)
setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval());
+ else
+ setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval());
if (!isInitialState)
lifecycleNotifier().notifyPageVisibilityChanged();
case SettingsDelegate::TextAutosizingChange:
if (!mainFrame() || !mainFrame()->isLocalFrame())
break;
- if (FastTextAutosizer* textAutosizer = deprecatedLocalMainFrame()->document()->fastTextAutosizer()) {
+ if (TextAutosizer* textAutosizer = deprecatedLocalMainFrame()->document()->textAutosizer())
textAutosizer->updatePageInfoInAllFrames();
- } else {
- for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
- if (!frame->isLocalFrame())
- continue;
- if (TextAutosizer* textAutosizer = toLocalFrame(frame)->document()->textAutosizer())
- textAutosizer->recalculateMultipliers();
- }
- // TextAutosizing updates RenderStyle during layout phase (via TextAutosizer::processSubtree).
- // We should invoke setNeedsLayout here.
- setNeedsLayoutInAllFrames();
- }
break;
case SettingsDelegate::ScriptEnableChange:
m_inspectorController->scriptsEnabled(settings().scriptEnabled());
void Page::trace(Visitor* visitor)
{
+#if ENABLE(OILPAN)
visitor->trace(m_dragCaretController);
visitor->trace(m_dragController);
+ visitor->trace(m_contextMenuController);
+ visitor->trace(m_inspectorController);
visitor->trace(m_pointerLockController);
visitor->trace(m_undoStack);
visitor->trace(m_validationMessageClient);
visitor->trace(m_multisamplingChangedObservers);
visitor->trace(m_frameHost);
+#endif
WillBeHeapSupplementable<Page>::trace(visitor);
+ LifecycleContext<Page>::trace(visitor);
}
void Page::willBeDestroyed()
{
RefPtr<Frame> mainFrame = m_mainFrame;
- if (mainFrame->isLocalFrame())
- toLocalFrame(mainFrame.get())->loader().frameDetached();
+ mainFrame->detach();
// Disable all agents prior to resetting the frame view.
m_inspectorController->willBeDestroyed();
{
}
-} // namespace WebCore
+} // namespace blink