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

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

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

Powered by Google App Engine
This is Rietveld 408576698