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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2780953002: When historyEntryRequiresUserGesture is enabled, exempt docs that have been committed for 5 seconds (Closed)
Patch Set: Centralize checking the setting Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index eba719d78293ca7cfb4fa3f3d8c579cd972336ff..7be58ea0cb5cab775a7731eb5f90103bcde74b77 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -3191,6 +3191,12 @@ int Document::elapsedTime() const {
return static_cast<int>((currentTime() - m_startTime) * 1000);
}
+bool Document::canCreateHistoryEntry() const {
+ if (!m_frame->settings()->getHistoryEntryRequiresUserGesture())
+ return true;
+ return elapsedTime() >= 5000 || m_frame->hasReceivedUserGesture();
ojan 2017/04/03 21:03:54 I think you could test this as a SimTest that fast
Nate Chapin 2017/04/04 20:42:19 I could find ways to mess with last time of a comp
+}
+
void Document::write(const SegmentedString& text,
Document* enteredDocument,
ExceptionState& exceptionState) {

Powered by Google App Engine
This is Rietveld 408576698