| OLD | NEW |
| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // https://html.spec.whatwg.org/#create-an-element-for-the-token | 224 // https://html.spec.whatwg.org/#create-an-element-for-the-token |
| 225 CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements, | 225 CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements, |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 // Collect data about deferred loading of offscreen cross-origin documents. All | 228 // Collect data about deferred loading of offscreen cross-origin documents. All |
| 229 // cross-origin documents log Created. Only those that would load log a reason. | 229 // cross-origin documents log Created. Only those that would load log a reason. |
| 230 // We can then see the % of cross-origin documents that never have to load. | 230 // We can then see the % of cross-origin documents that never have to load. |
| 231 // See https://crbug.com/635105. | 231 // See https://crbug.com/635105. |
| 232 // Logged to UMA, don't re-arrange entries without creating a new histogram. | 232 // Logged to UMA, don't re-arrange entries without creating a new histogram. |
| 233 enum WouldLoadReason { | 233 enum WouldLoadReason { |
| 234 Invalid, |
| 234 Created, | 235 Created, |
| 236 WouldLoad3ScreensAway, |
| 237 WouldLoad2ScreensAway, |
| 238 WouldLoad1ScreenAway, |
| 239 WouldLoadVisible, |
| 235 // If outer and inner frames aren't in the same process we can't determine | 240 // If outer and inner frames aren't in the same process we can't determine |
| 236 // if the inner frame is visible, so just load it. | 241 // if the inner frame is visible, so just load it. |
| 237 // TODO(dgrogan): Revisit after https://crbug.com/650433 is fixed. | 242 // TODO(dgrogan): Revisit after https://crbug.com/650433 is fixed. |
| 238 WouldLoadOutOfProcess, | 243 WouldLoadNoParent, |
| 239 // The next five indicate frames that are probably used for cross-origin | |
| 240 // communication. | |
| 241 WouldLoadDisplayNone, | |
| 242 WouldLoadZeroByZero, | |
| 243 WouldLoadAboveAndLeft, | |
| 244 WouldLoadAbove, | |
| 245 WouldLoadLeft, | |
| 246 // We have to load documents in visible frames. | |
| 247 WouldLoadVisible, | |
| 248 | 244 |
| 249 WouldLoadReasonEnd | 245 WouldLoadReasonEnd |
| 250 }; | 246 }; |
| 251 | 247 |
| 252 using DocumentClassFlags = unsigned char; | 248 using DocumentClassFlags = unsigned char; |
| 253 | 249 |
| 254 class CORE_EXPORT Document : public ContainerNode, | 250 class CORE_EXPORT Document : public ContainerNode, |
| 255 public TreeScope, | 251 public TreeScope, |
| 256 public SecurityContext, | 252 public SecurityContext, |
| 257 public ExecutionContext, | 253 public ExecutionContext, |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 | 1282 |
| 1287 Element* rootScroller() const; | 1283 Element* rootScroller() const; |
| 1288 void setRootScroller(Element*, ExceptionState&); | 1284 void setRootScroller(Element*, ExceptionState&); |
| 1289 RootScrollerController& rootScrollerController() const { | 1285 RootScrollerController& rootScrollerController() const { |
| 1290 DCHECK(m_rootScrollerController); | 1286 DCHECK(m_rootScrollerController); |
| 1291 return *m_rootScrollerController; | 1287 return *m_rootScrollerController; |
| 1292 } | 1288 } |
| 1293 | 1289 |
| 1294 bool isInMainFrame() const; | 1290 bool isInMainFrame() const; |
| 1295 | 1291 |
| 1296 void maybeRecordLoadReason(WouldLoadReason); | 1292 void recordDeferredLoadReason(WouldLoadReason); |
| 1297 WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; } | 1293 WouldLoadReason deferredLoadReason() { return m_wouldLoadReason; } |
| 1298 | 1294 |
| 1299 PropertyRegistry* propertyRegistry(); | 1295 PropertyRegistry* propertyRegistry(); |
| 1300 | 1296 |
| 1301 // Indicates whether the user has interacted with this particular Document. | 1297 // Indicates whether the user has interacted with this particular Document. |
| 1302 void setHasReceivedUserGesture() { m_hasReceivedUserGesture = true; } | 1298 void setHasReceivedUserGesture() { m_hasReceivedUserGesture = true; } |
| 1303 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; } | 1299 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; } |
| 1304 | 1300 |
| 1305 // Document maintains a counter of visible non-secure password | 1301 // Document maintains a counter of visible non-secure password |
| 1306 // fields in the page. Used to notify the embedder when all visible | 1302 // fields in the page. Used to notify the embedder when all visible |
| 1307 // non-secure passwords fields are no longer visible. | 1303 // non-secure passwords fields are no longer visible. |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); | 1715 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); |
| 1720 | 1716 |
| 1721 } // namespace blink | 1717 } // namespace blink |
| 1722 | 1718 |
| 1723 #ifndef NDEBUG | 1719 #ifndef NDEBUG |
| 1724 // Outside the WebCore namespace for ease of invocation from gdb. | 1720 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1725 CORE_EXPORT void showLiveDocumentInstances(); | 1721 CORE_EXPORT void showLiveDocumentInstances(); |
| 1726 #endif | 1722 #endif |
| 1727 | 1723 |
| 1728 #endif // Document_h | 1724 #endif // Document_h |
| OLD | NEW |