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

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

Issue 2746873002: Revert of Move FrameHost::m_subframeCount to Page (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
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.h ('k') | no next file » | 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All
3 * Rights Reserved. 3 * Rights Reserved.
4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 m_useCounter(pageClients.chromeClient && 113 m_useCounter(pageClients.chromeClient &&
114 pageClients.chromeClient->isSVGImageChromeClient() 114 pageClients.chromeClient->isSVGImageChromeClient()
115 ? UseCounter::SVGImageContext 115 ? UseCounter::SVGImageContext
116 : UseCounter::DefaultContext), 116 : UseCounter::DefaultContext),
117 m_openedByDOM(false), 117 m_openedByDOM(false),
118 m_tabKeyCyclesThroughElements(true), 118 m_tabKeyCyclesThroughElements(true),
119 m_suspended(false), 119 m_suspended(false),
120 m_deviceScaleFactor(1), 120 m_deviceScaleFactor(1),
121 m_visibilityState(PageVisibilityStateVisible), 121 m_visibilityState(PageVisibilityStateVisible),
122 m_isCursorVisible(true), 122 m_isCursorVisible(true),
123 m_subframeCount(0),
124 m_frameHost(FrameHost::create(*this)) { 123 m_frameHost(FrameHost::create(*this)) {
125 ASSERT(m_editorClient); 124 ASSERT(m_editorClient);
126 125
127 ASSERT(!allPages().contains(this)); 126 ASSERT(!allPages().contains(this));
128 allPages().insert(this); 127 allPages().insert(this);
129 } 128 }
130 129
131 Page::~Page() { 130 Page::~Page() {
132 // willBeDestroyed() must be called before Page destruction. 131 // willBeDestroyed() must be called before Page destruction.
133 ASSERT(!m_mainFrame); 132 ASSERT(!m_mainFrame);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 381 }
383 382
384 bool Page::isPageVisible() const { 383 bool Page::isPageVisible() const {
385 return visibilityState() == PageVisibilityStateVisible; 384 return visibilityState() == PageVisibilityStateVisible;
386 } 385 }
387 386
388 bool Page::isCursorVisible() const { 387 bool Page::isCursorVisible() const {
389 return m_isCursorVisible; 388 return m_isCursorVisible;
390 } 389 }
391 390
392 #if DCHECK_IS_ON()
393 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) {
394 DCHECK_GE(expectedFrameCount, 0);
395
396 int actualFrameCount = 0;
397 for (; frame; frame = frame->tree().traverseNext())
398 ++actualFrameCount;
399
400 DCHECK_EQ(expectedFrameCount, actualFrameCount);
401 }
402 #endif
403
404 int Page::subframeCount() const {
405 #if DCHECK_IS_ON()
406 checkFrameCountConsistency(m_subframeCount + 1, mainFrame());
407 #endif
408 return m_subframeCount;
409 }
410
411 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { 391 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) {
412 switch (changeType) { 392 switch (changeType) {
413 case SettingsDelegate::StyleChange: 393 case SettingsDelegate::StyleChange:
414 setNeedsRecalcStyleInAllFrames(); 394 setNeedsRecalcStyleInAllFrames();
415 break; 395 break;
416 case SettingsDelegate::ViewportDescriptionChange: 396 case SettingsDelegate::ViewportDescriptionChange:
417 if (mainFrame() && mainFrame()->isLocalFrame()) { 397 if (mainFrame() && mainFrame()->isLocalFrame()) {
418 deprecatedLocalMainFrame()->document()->updateViewportDescription(); 398 deprecatedLocalMainFrame()->document()->updateViewportDescription();
419 // The text autosizer has dependencies on the viewport. 399 // The text autosizer has dependencies on the viewport.
420 if (TextAutosizer* textAutosizer = 400 if (TextAutosizer* textAutosizer =
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 : chromeClient(nullptr), 605 : chromeClient(nullptr),
626 contextMenuClient(nullptr), 606 contextMenuClient(nullptr),
627 editorClient(nullptr), 607 editorClient(nullptr),
628 spellCheckerClient(nullptr) {} 608 spellCheckerClient(nullptr) {}
629 609
630 Page::PageClients::~PageClients() {} 610 Page::PageClients::~PageClients() {}
631 611
632 template class CORE_TEMPLATE_EXPORT Supplement<Page>; 612 template class CORE_TEMPLATE_EXPORT Supplement<Page>;
633 613
634 } // namespace blink 614 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698