Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Document.h |
| diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h |
| index dbf24300948695646d45183b83c1007d842adeab..3a2c42933206dc26417b50950cade4be169c7328 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.h |
| +++ b/third_party/WebKit/Source/core/dom/Document.h |
| @@ -235,6 +235,28 @@ enum CreateElementFlags { |
| CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements, |
| }; |
| +// Collect data about deferred loading of offscreen cross-origin documents. All |
| +// cross-origin documents log Created. Only those that would load log a reason. |
| +// We can then see the % of cross-origin documents that never have to load. |
| +// See https://crbug.com/635105. |
| +// Logged to UMA, don't re-arrange entries without creating a new histogram. |
| +enum WouldLoadReason { |
| + Created, |
| + // If outer and inner frames aren't in the same process we can't determine |
| + // 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.
|
| + WouldLoadOutOfProcess, |
| + // The next four indicate frames that are probably used for cross-origin |
| + // communication. |
| + WouldLoadDisplayNone, |
| + WouldLoadZeroByZero, |
| + WouldLoadAbove, |
| + WouldLoadLeft, |
| + // We have to load documents in visible frames. |
| + WouldLoadVisible, |
| + |
| + WouldLoadReasonEnd |
| +}; |
| + |
| using DocumentClassFlags = unsigned char; |
| class CORE_EXPORT Document : public ContainerNode, |
| @@ -1280,7 +1302,8 @@ class CORE_EXPORT Document : public ContainerNode, |
| bool isInMainFrame() const; |
| - void onVisibilityMaybeChanged(bool visible); |
| + void wouldLoadBecause(WouldLoadReason); |
| + WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; } |
| PropertyRegistry* propertyRegistry(); |
| @@ -1636,7 +1659,7 @@ class CORE_EXPORT Document : public ContainerNode, |
| Member<SnapCoordinator> m_snapCoordinator; |
| - bool m_visibilityWasLogged; |
| + WouldLoadReason m_wouldLoadReason; |
| Member<PropertyRegistry> m_propertyRegistry; |
| }; |