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

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)

Created:
4 years, 2 months ago by Nate Chapin
Modified:
4 years, 1 month ago
CC:
aboxhall+watch_chromium.org, aboxhall, apavlov+blink_chromium.org, awdf+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, caseq+blink_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dcheng, devtools-reviews_chromium.org, dglazkov+blink, dmazzoni+watch_chromium.org, dmazzoni, dtapuska+blinkwatch_chromium.org, dtseng+watch_chromium.org, eae+blinkwatch, eric.carlson_apple.com, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, gavinp+loader_chromium.org, haraken, jam, je_julie, kinuko+watch, kozyatinskiy+blink_chromium.org, loading-reviews_chromium.org, lushnikov+blink_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-blink_chromium.org, nasko+codewatch_chromium.org, nektar+watch_chromium.org, nektarios, Navid Zolghadr, nzolghadr+blinkwatch_chromium.org, ojan, Peter Beverloo, pfeldman+blink_chromium.org, rwlbuis, sof, Srirama, tyoshino+watch_chromium.org, yuzo+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move persistent gesture state to Document, add DocumentUserGestureToken Non-test gesture tokens are now created as a DocumentUserGestureToken, which take a Document* (which can be null, but such uses are limited). When it is created, it sets the m_hasReceivedUserGesture flag on Document. Remove UserGestureIndicator::s_processedUserGestureSinceLoad, as Document::m_hasReceivedUserGesture is very similar and not process-wide. BUG=624061 Committed: https://crrev.com/26ce312cc8b3f53dc76df85e45c17bba93685fc3 Cr-Commit-Position: refs/heads/master@{#427481}

Patch Set 1 #

Patch Set 2 : Move persistent state to Document #

Patch Set 3 : Move persistent state to Document #

Patch Set 4 : a #

Total comments: 28

Patch Set 5 : Rebase #

Patch Set 6 : Address comments #

Total comments: 3

Patch Set 7 : Rebase #

Total comments: 1

Patch Set 8 : DCHECK in Notifications.cpp, give user gesture bit to ancestors #

Patch Set 9 : Switch back to checkign context->isDocument() #

Total comments: 5

Patch Set 10 : Rebase #

Patch Set 11 : Add TODO, null check toNode() result in PointerEventManager #

Total comments: 1

Patch Set 12 : Skip over RemoteFrames, rather than stopping at them #

Patch Set 13 : Re-add dropped null check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+294 lines, -180 lines) Patch
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -4 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 5 6 1 chunk +5 lines, -2 lines 0 comments Download
M extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/messaging_bindings.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/user_gestures_native_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +45 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 4 7 8 9 2 chunks +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/AutoplayExperimentTest.cpp View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElementTest.cpp View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 2 3 4 5 6 5 chunks +24 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/input/GestureManager.cpp View 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/input/KeyboardEventManager.cpp View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/PointerEventManager.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/TouchEventManager.cpp View 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/DevToolsHost.cpp View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/page/DragController.cpp View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.cpp View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/accessibility/AXObject.cpp View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/notifications/Notification.cpp View 5 6 8 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp View 1 2 3 4 5 6 7 3 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp View 1 2 3 4 5 6 chunks +11 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/platform/UserGestureIndicator.h View 1 2 3 4 3 chunks +3 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/platform/UserGestureIndicator.cpp View 1 2 3 4 3 chunks +0 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/platform/UserGestureIndicatorTest.cpp View 6 chunks +23 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp View 1 2 3 4 5 6 4 chunks +9 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebPluginContainerImpl.cpp View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebScopedUserGesture.cpp View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/WebUserGestureIndicator.cpp View 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 9 chunks +24 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 10 chunks +10 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebUserGestureTokenTest.cpp View 4 chunks +3 lines, -7 lines 0 comments Download
M third_party/WebKit/public/web/WebScopedUserGesture.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/public/web/WebUserGestureIndicator.h View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 84 (51 generated)
Nate Chapin
This is another lead in to https://codereview.chromium.org/2392773002. I'm not super confident I got the right ...
4 years, 2 months ago (2016-10-13 20:03:19 UTC) #19
Rick Byers
Still reviewing the details, but a couple high-level comments: There's some risk of breaking changes ...
4 years, 2 months ago (2016-10-17 15:35:53 UTC) #20
Rick Byers
The overall approach here seems really good (much better than the previous attempt at a ...
4 years, 2 months ago (2016-10-17 17:02:47 UTC) #22
Navid Zolghadr
https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/input/PointerEventManager.cpp File third_party/WebKit/Source/core/input/PointerEventManager.cpp (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/input/PointerEventManager.cpp#newcode176 third_party/WebKit/Source/core/input/PointerEventManager.cpp:176: DocumentUserGestureToken::create(m_frame->document()))); On 2016/10/17 17:02:46, Rick Byers wrote: > I'm ...
4 years, 2 months ago (2016-10-17 17:18:06 UTC) #24
ojan
https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/loader/FrameLoader.cpp File third_party/WebKit/Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/loader/FrameLoader.cpp#newcode787 third_party/WebKit/Source/core/loader/FrameLoader.cpp:787: !m_frame->document()->hasReceivedUserGesture() && initiatingDocument) What happens in this case? 1. ...
4 years, 2 months ago (2016-10-18 16:39:50 UTC) #26
Nate Chapin
+mathp for the autofill question. See the comments in WebViewImpl.cpp https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/dom/Document.h File third_party/WebKit/Source/core/dom/Document.h (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/dom/Document.h#newcode1287 ...
4 years, 2 months ago (2016-10-18 23:26:33 UTC) #32
ojan
https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/loader/FrameLoader.cpp File third_party/WebKit/Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/loader/FrameLoader.cpp#newcode787 third_party/WebKit/Source/core/loader/FrameLoader.cpp:787: !m_frame->document()->hasReceivedUserGesture() && initiatingDocument) On 2016/10/18 at 23:26:33, Nate Chapin ...
4 years, 2 months ago (2016-10-18 23:40:25 UTC) #33
Peter Beverloo
Minor drive-by https://codereview.chromium.org/2408333004/diff/100001/third_party/WebKit/Source/modules/notifications/Notification.cpp File third_party/WebKit/Source/modules/notifications/Notification.cpp (right): https://codereview.chromium.org/2408333004/diff/100001/third_party/WebKit/Source/modules/notifications/Notification.cpp#newcode225 third_party/WebKit/Source/modules/notifications/Notification.cpp:225: context->isDocument() ? toDocument(context) : nullptr, Prefer DCHECK(context->isDocument()) ...
4 years, 2 months ago (2016-10-19 16:36:48 UTC) #35
Mathieu
https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode285 third_party/WebKit/Source/web/WebViewImpl.cpp:285: m_frame->autofillClient()->firstUserGestureObserved(); On 2016/10/18 23:40:25, ojan wrote: > On 2016/10/18 ...
4 years, 2 months ago (2016-10-19 17:20:31 UTC) #36
Rick Byers
On 2016/10/19 17:20:31, Mathieu Perreault wrote: > https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp > File third_party/WebKit/Source/web/WebViewImpl.cpp (right): > > https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode285 ...
4 years, 2 months ago (2016-10-19 18:01:31 UTC) #37
Nate Chapin
On 2016/10/19 18:01:31, Rick Byers wrote: > On 2016/10/19 17:20:31, Mathieu Perreault wrote: > > ...
4 years, 2 months ago (2016-10-21 17:20:07 UTC) #38
Nate Chapin
https://codereview.chromium.org/2408333004/diff/100001/third_party/WebKit/Source/modules/notifications/Notification.cpp File third_party/WebKit/Source/modules/notifications/Notification.cpp (right): https://codereview.chromium.org/2408333004/diff/100001/third_party/WebKit/Source/modules/notifications/Notification.cpp#newcode225 third_party/WebKit/Source/modules/notifications/Notification.cpp:225: context->isDocument() ? toDocument(context) : nullptr, On 2016/10/19 16:36:48, Peter ...
4 years, 2 months ago (2016-10-21 18:11:04 UTC) #41
Nate Chapin
https://codereview.chromium.org/2408333004/diff/100001/third_party/WebKit/Source/modules/notifications/Notification.cpp File third_party/WebKit/Source/modules/notifications/Notification.cpp (right): https://codereview.chromium.org/2408333004/diff/100001/third_party/WebKit/Source/modules/notifications/Notification.cpp#newcode225 third_party/WebKit/Source/modules/notifications/Notification.cpp:225: context->isDocument() ? toDocument(context) : nullptr, On 2016/10/21 18:11:04, Nate ...
4 years, 2 months ago (2016-10-21 20:43:28 UTC) #44
ojan
https://codereview.chromium.org/2408333004/diff/160001/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h File third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h (right): https://codereview.chromium.org/2408333004/diff/160001/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h#newcode31 third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h:31: if (document) This can early return if the document->hasReceivedUserGesture(), ...
4 years, 2 months ago (2016-10-21 21:33:07 UTC) #47
Nate Chapin
https://codereview.chromium.org/2408333004/diff/160001/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h File third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h (right): https://codereview.chromium.org/2408333004/diff/160001/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h#newcode31 third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h:31: if (document) On 2016/10/21 21:33:06, ojan wrote: > This ...
4 years, 2 months ago (2016-10-21 21:36:49 UTC) #48
Rick Byers
On 2016/10/17 17:02:47, Rick Byers wrote: > The overall approach here seems really good (much ...
4 years, 1 month ago (2016-10-24 16:56:16 UTC) #52
Nate Chapin
On 2016/10/24 16:56:16, Rick Byers wrote: > On 2016/10/17 17:02:47, Rick Byers wrote: > > ...
4 years, 1 month ago (2016-10-24 18:25:46 UTC) #53
Rick Byers
https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/input/PointerEventManager.cpp File third_party/WebKit/Source/core/input/PointerEventManager.cpp (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/input/PointerEventManager.cpp#newcode176 third_party/WebKit/Source/core/input/PointerEventManager.cpp:176: DocumentUserGestureToken::create(m_frame->document()))); On 2016/10/18 23:26:33, Nate Chapin wrote: > On ...
4 years, 1 month ago (2016-10-24 18:30:47 UTC) #54
Nate Chapin
https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/input/PointerEventManager.cpp File third_party/WebKit/Source/core/input/PointerEventManager.cpp (right): https://codereview.chromium.org/2408333004/diff/60001/third_party/WebKit/Source/core/input/PointerEventManager.cpp#newcode176 third_party/WebKit/Source/core/input/PointerEventManager.cpp:176: DocumentUserGestureToken::create(m_frame->document()))); On 2016/10/24 18:30:46, Rick Byers wrote: > On ...
4 years, 1 month ago (2016-10-24 18:45:19 UTC) #56
Rick Byers
LGTM from my perspective. Thanks for keeping the rebases separate - made reviewing updates really ...
4 years, 1 month ago (2016-10-24 19:04:15 UTC) #58
ojan
lgtm
4 years, 1 month ago (2016-10-24 20:06:53 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2408333004/200001
4 years, 1 month ago (2016-10-24 20:08:43 UTC) #63
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/288069)
4 years, 1 month ago (2016-10-24 20:45:33 UTC) #65
Nate Chapin
reillyg, would you mind reviewing these mechanical extensions/renderer changes? creis: 4 lines in render_frame_impl.cc, please?
4 years, 1 month ago (2016-10-24 20:50:10 UTC) #67
Charlie Reis
render_frame_impl.cc looks ok, but I'm concerned about the OOPIF TODO, since OOPIFs are on by ...
4 years, 1 month ago (2016-10-24 21:38:16 UTC) #68
Nate Chapin
On 2016/10/24 21:38:16, Charlie Reis wrote: > render_frame_impl.cc looks ok, but I'm concerned about the ...
4 years, 1 month ago (2016-10-24 22:03:45 UTC) #69
alexmos
On 2016/10/24 22:03:45, Nate Chapin wrote: > On 2016/10/24 21:38:16, Charlie Reis wrote: > > ...
4 years, 1 month ago (2016-10-25 00:08:03 UTC) #70
Reilly Grant (use Gerrit)
The //extensions bit lgtm but that seems like just plumbing for the more interesting changes ...
4 years, 1 month ago (2016-10-25 00:53:23 UTC) #71
Nate Chapin
On 2016/10/25 00:08:03, alexmos wrote: > On 2016/10/24 22:03:45, Nate Chapin wrote: > > On ...
4 years, 1 month ago (2016-10-25 01:54:13 UTC) #72
Charlie Reis
On 2016/10/25 01:54:13, Nate Chapin wrote: > On 2016/10/25 00:08:03, alexmos wrote: > > On ...
4 years, 1 month ago (2016-10-25 18:24:37 UTC) #75
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2408333004/240001
4 years, 1 month ago (2016-10-25 19:25:09 UTC) #80
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 1 month ago (2016-10-25 21:30:41 UTC) #82
commit-bot: I haz the power
4 years, 1 month ago (2016-10-25 21:33:32 UTC) #84
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/26ce312cc8b3f53dc76df85e45c17bba93685fc3
Cr-Commit-Position: refs/heads/master@{#427481}

Powered by Google App Engine
This is Rietveld 408576698