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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2449473003: Log to UMA why we would load a third-party frame (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index bd96f08d07e60c11154acaff753ba2cb3557824c..4b6d3a913de787c76fbc64a2797bdc8e92fb9175 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -4408,11 +4408,28 @@ void FrameView::updateViewportIntersectionIfNeeded() {
m_viewportIntersectionValid = true;
FrameView* parent = parentFrameView();
if (!parent) {
+ HTMLFrameOwnerElement* element = frame().deprecatedLocalOwner();
+ if (!element)
+ frame().document()->maybeRecordLoadReason(WouldLoadOutOfProcess);
+ // Having no layout object means the frame is not drawn.
+ else if (!element->layoutObject())
+ frame().document()->maybeRecordLoadReason(WouldLoadDisplayNone);
m_viewportIntersection = frameRect();
return;
}
ASSERT(!parent->m_needsUpdateViewportIntersection);
+ bool parentLoaded = parent->frame().document()->wouldLoadReason() > Created;
+ // If the parent wasn't loaded, the children won't be either.
+ if (parentLoaded) {
+ if (frameRect().isEmpty())
+ frame().document()->maybeRecordLoadReason(WouldLoadZeroByZero);
+ else if (frameRect().maxY() < 0)
+ frame().document()->maybeRecordLoadReason(WouldLoadAbove);
+ else if (frameRect().maxX() < 0)
+ frame().document()->maybeRecordLoadReason(WouldLoadLeft);
+ }
+
// If our parent is hidden, then we are too.
if (parent->m_viewportIntersection.isEmpty()) {
m_viewportIntersection = parent->m_viewportIntersection;
@@ -4432,6 +4449,9 @@ void FrameView::updateViewportIntersectionIfNeeded() {
// content while scrolling.
IntRect viewport = parent->m_viewportIntersection;
m_viewportIntersection.intersect(viewport);
+
+ if (parentLoaded && !m_viewportIntersection.isEmpty())
+ frame().document()->maybeRecordLoadReason(WouldLoadVisible);
}
void FrameView::updateViewportIntersectionsForSubtree(
@@ -4517,8 +4537,6 @@ void FrameView::notifyRenderThrottlingObservers() {
updateThrottlingStatus();
- frame().document()->onVisibilityMaybeChanged(!m_hiddenForThrottling);
-
bool becameThrottled = !wasThrottled && canThrottleRendering();
bool becameUnthrottled = wasThrottled && !canThrottleRendering();
ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698