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

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

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check 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 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 return m_rootScrollerController.get(); 1307 return m_rootScrollerController.get();
1308 } 1308 }
1309 1309
1310 bool isInMainFrame() const; 1310 bool isInMainFrame() const;
1311 1311
1312 void maybeRecordLoadReason(WouldLoadReason); 1312 void maybeRecordLoadReason(WouldLoadReason);
1313 WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; } 1313 WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; }
1314 1314
1315 PropertyRegistry* propertyRegistry(); 1315 PropertyRegistry* propertyRegistry();
1316 1316
1317 // Indicates whether the user has interacted with this particular Document.
1318 void setHasReceivedUserGesture() { m_hasReceivedUserGesture = true; }
1319 // Consume user interaction state. Used for an experiment that restricts
1320 // adding history entries to Documents that have had a user gesture since
1321 // last history state change.
1322 void clearHasReceivedUserGesture() { m_hasReceivedUserGesture = false; }
1323 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; }
1324
1317 protected: 1325 protected:
1318 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); 1326 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass);
1319 1327
1320 void didUpdateSecurityOrigin() final; 1328 void didUpdateSecurityOrigin() final;
1321 1329
1322 void clearXMLVersion() { m_xmlVersion = String(); } 1330 void clearXMLVersion() { m_xmlVersion = String(); }
1323 1331
1324 virtual Document* cloneDocumentWithoutChildren(); 1332 virtual Document* cloneDocumentWithoutChildren();
1325 1333
1326 bool importContainerNodeChildren(ContainerNode* oldContainerNode, 1334 bool importContainerNodeChildren(ContainerNode* oldContainerNode,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 String m_xmlVersion; 1559 String m_xmlVersion;
1552 unsigned m_xmlStandalone : 2; 1560 unsigned m_xmlStandalone : 2;
1553 unsigned m_hasXMLDeclaration : 1; 1561 unsigned m_hasXMLDeclaration : 1;
1554 1562
1555 AtomicString m_contentLanguage; 1563 AtomicString m_contentLanguage;
1556 1564
1557 DocumentEncodingData m_encodingData; 1565 DocumentEncodingData m_encodingData;
1558 1566
1559 bool m_designMode; 1567 bool m_designMode;
1560 bool m_isRunningExecCommand; 1568 bool m_isRunningExecCommand;
1569 bool m_hasReceivedUserGesture;
1561 1570
1562 HeapHashSet<WeakMember<const LiveNodeListBase>> m_listsInvalidatedAtDocument; 1571 HeapHashSet<WeakMember<const LiveNodeListBase>> m_listsInvalidatedAtDocument;
1563 // Oilpan keeps track of all registered NodeLists. 1572 // Oilpan keeps track of all registered NodeLists.
1564 // TODO(Oilpan): improve - only need to know if a NodeList 1573 // TODO(Oilpan): improve - only need to know if a NodeList
1565 // is currently alive or not for the different types. 1574 // is currently alive or not for the different types.
1566 HeapHashSet<WeakMember<const LiveNodeListBase>> 1575 HeapHashSet<WeakMember<const LiveNodeListBase>>
1567 m_nodeLists[numNodeListInvalidationTypes]; 1576 m_nodeLists[numNodeListInvalidationTypes];
1568 1577
1569 Member<SVGDocumentExtensions> m_svgExtensions; 1578 Member<SVGDocumentExtensions> m_svgExtensions;
1570 1579
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1724 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1716 1725
1717 } // namespace blink 1726 } // namespace blink
1718 1727
1719 #ifndef NDEBUG 1728 #ifndef NDEBUG
1720 // Outside the WebCore namespace for ease of invocation from gdb. 1729 // Outside the WebCore namespace for ease of invocation from gdb.
1721 CORE_EXPORT void showLiveDocumentInstances(); 1730 CORE_EXPORT void showLiveDocumentInstances();
1722 #endif 1731 #endif
1723 1732
1724 #endif // Document_h 1733 #endif // Document_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698