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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.h

Issue 2389023002: Deferred frame loading stats v2 (Closed)
Patch Set: address comments 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 unified diff | Download patch
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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // Aliases by callers. 228 // Aliases by callers.
229 // Clone a node: https://dom.spec.whatwg.org/#concept-node-clone 229 // Clone a node: https://dom.spec.whatwg.org/#concept-node-clone
230 CreatedByCloneNode = AsynchronousCustomElements, 230 CreatedByCloneNode = AsynchronousCustomElements,
231 CreatedByImportNode = CreatedByCloneNode, 231 CreatedByImportNode = CreatedByCloneNode,
232 // https://dom.spec.whatwg.org/#dom-document-createelement 232 // https://dom.spec.whatwg.org/#dom-document-createelement
233 CreatedByCreateElement = SynchronousCustomElements, 233 CreatedByCreateElement = SynchronousCustomElements,
234 // https://html.spec.whatwg.org/#create-an-element-for-the-token 234 // https://html.spec.whatwg.org/#create-an-element-for-the-token
235 CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements, 235 CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements,
236 }; 236 };
237 237
238 // Collect data about deferred loading of offscreen cross-origin documents. All
239 // cross-origin documents log Created. Only those that would load log a reason.
240 // We can then see the % of cross-origin documents that never have to load.
241 // See https://crbug.com/635105.
242 // Logged to UMA, don't re-arrange entries without creating a new histogram.
243 enum WouldLoadReason {
244 Created,
245 // If outer and inner frames aren't in the same process we can't determine
246 // if the inner frame is visible, so just load it.
dcheng 2016/10/13 23:00:43 Maybe add a TODO pointing to https://crbug.com/650
dgrogan 2016/10/14 21:45:08 Done.
247 WouldLoadOutOfProcess,
248 // The next four indicate frames that are probably used for cross-origin
249 // communication.
250 WouldLoadDisplayNone,
251 WouldLoadZeroByZero,
252 WouldLoadAbove,
253 WouldLoadLeft,
254 // We have to load documents in visible frames.
255 WouldLoadVisible,
256
257 WouldLoadReasonEnd
258 };
259
238 using DocumentClassFlags = unsigned char; 260 using DocumentClassFlags = unsigned char;
239 261
240 class CORE_EXPORT Document : public ContainerNode, 262 class CORE_EXPORT Document : public ContainerNode,
241 public TreeScope, 263 public TreeScope,
242 public SecurityContext, 264 public SecurityContext,
243 public ExecutionContext, 265 public ExecutionContext,
244 public Supplementable<Document> { 266 public Supplementable<Document> {
245 DEFINE_WRAPPERTYPEINFO(); 267 DEFINE_WRAPPERTYPEINFO();
246 USING_GARBAGE_COLLECTED_MIXIN(Document); 268 USING_GARBAGE_COLLECTED_MIXIN(Document);
247 269
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 } 1295 }
1274 1296
1275 Element* rootScroller() const; 1297 Element* rootScroller() const;
1276 void setRootScroller(Element*, ExceptionState&); 1298 void setRootScroller(Element*, ExceptionState&);
1277 RootScrollerController* rootScrollerController() const { 1299 RootScrollerController* rootScrollerController() const {
1278 return m_rootScrollerController.get(); 1300 return m_rootScrollerController.get();
1279 } 1301 }
1280 1302
1281 bool isInMainFrame() const; 1303 bool isInMainFrame() const;
1282 1304
1283 void onVisibilityMaybeChanged(bool visible); 1305 void wouldLoadBecause(WouldLoadReason);
1306 WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; }
1284 1307
1285 PropertyRegistry* propertyRegistry(); 1308 PropertyRegistry* propertyRegistry();
1286 1309
1287 protected: 1310 protected:
1288 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); 1311 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass);
1289 1312
1290 void didUpdateSecurityOrigin() final; 1313 void didUpdateSecurityOrigin() final;
1291 1314
1292 void clearXMLVersion() { m_xmlVersion = String(); } 1315 void clearXMLVersion() { m_xmlVersion = String(); }
1293 1316
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 Member<IntersectionObserverController> m_intersectionObserverController; 1652 Member<IntersectionObserverController> m_intersectionObserverController;
1630 Member<NodeIntersectionObserverData> m_intersectionObserverData; 1653 Member<NodeIntersectionObserverData> m_intersectionObserverData;
1631 Member<ResizeObserverController> m_resizeObserverController; 1654 Member<ResizeObserverController> m_resizeObserverController;
1632 1655
1633 int m_nodeCount; 1656 int m_nodeCount;
1634 1657
1635 bool m_mayContainV0Shadow = false; 1658 bool m_mayContainV0Shadow = false;
1636 1659
1637 Member<SnapCoordinator> m_snapCoordinator; 1660 Member<SnapCoordinator> m_snapCoordinator;
1638 1661
1639 bool m_visibilityWasLogged; 1662 WouldLoadReason m_wouldLoadReason;
1640 1663
1641 Member<PropertyRegistry> m_propertyRegistry; 1664 Member<PropertyRegistry> m_propertyRegistry;
1642 }; 1665 };
1643 1666
1644 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>; 1667 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>;
1645 1668
1646 inline bool Document::shouldOverrideLegacyDescription( 1669 inline bool Document::shouldOverrideLegacyDescription(
1647 ViewportDescription::Type origin) const { 1670 ViewportDescription::Type origin) const {
1648 // The different (legacy) meta tags have different priorities based on the 1671 // The different (legacy) meta tags have different priorities based on the
1649 // type regardless of which order they appear in the DOM. The priority is 1672 // type regardless of which order they appear in the DOM. The priority is
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1709 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1687 1710
1688 } // namespace blink 1711 } // namespace blink
1689 1712
1690 #ifndef NDEBUG 1713 #ifndef NDEBUG
1691 // Outside the WebCore namespace for ease of invocation from gdb. 1714 // Outside the WebCore namespace for ease of invocation from gdb.
1692 CORE_EXPORT void showLiveDocumentInstances(); 1715 CORE_EXPORT void showLiveDocumentInstances();
1693 #endif 1716 #endif
1694 1717
1695 #endif // Document_h 1718 #endif // Document_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698