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

Issue 2454433002: [Extensions + Blink] Account for user gesture in v8 function calls (Closed)

Created:
4 years, 1 month ago by Devlin
Modified:
4 years, 1 month ago
Reviewers:
haraken, Nate Chapin, dcheng
CC:
chromium-reviews, blink-reviews, chromium-apps-reviews_chromium.org, kinuko+watch, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions + Blink] Account for user gesture in v8 function calls Determine whether or not a user gesture is being processed when using the SuspendableScriptExecutor to execute a v8 function. BUG=629431 Committed: https://crrev.com/57d2116813649148c761075f528db81ec51265db Cr-Commit-Position: refs/heads/master@{#429805}

Patch Set 1 : rebase #

Patch Set 2 : hmm #

Total comments: 3

Patch Set 3 : change + test #

Patch Set 4 : whoops #

Total comments: 16

Patch Set 5 : script state changes #

Total comments: 19

Patch Set 6 : more comments #

Total comments: 4

Patch Set 7 : more #

Total comments: 6

Patch Set 8 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -25 lines) Patch
M extensions/renderer/user_gestures_native_handler.cc View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/SuspendableScriptExecutor.h View 1 2 3 4 5 6 3 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp View 1 2 3 4 5 6 7 9 chunks +31 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 2 chunks +110 lines, -4 lines 0 comments Download

Messages

Total messages: 65 (40 generated)
Devlin
+dcheng, haraken@, please take a look when you have time. https://codereview.chromium.org/2454433002/diff/60001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/60001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode128 ...
4 years, 1 month ago (2016-10-26 22:45:22 UTC) #18
dcheng
https://codereview.chromium.org/2454433002/diff/60001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/60001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode128 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:128: if (m_userGesture && !UserGestureIndicator::processingUserGesture()) { On 2016/10/26 22:45:22, Devlin ...
4 years, 1 month ago (2016-10-26 23:16:49 UTC) #19
Devlin
https://codereview.chromium.org/2454433002/diff/60001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/60001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode128 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:128: if (m_userGesture && !UserGestureIndicator::processingUserGesture()) { On 2016/10/26 23:16:49, dcheng ...
4 years, 1 month ago (2016-10-27 23:33:28 UTC) #24
haraken
https://codereview.chromium.org/2454433002/diff/100001/extensions/renderer/user_gestures_native_handler.cc File extensions/renderer/user_gestures_native_handler.cc (right): https://codereview.chromium.org/2454433002/diff/100001/extensions/renderer/user_gestures_native_handler.cc#newcode42 extensions/renderer/user_gestures_native_handler.cc:42: context()->CallFunctionSafe(v8::Local<v8::Function>::Cast(args[0]), 0, Where is CallFunctionSafe defined? I couldn't find ...
4 years, 1 month ago (2016-10-28 08:45:14 UTC) #25
Devlin
https://codereview.chromium.org/2454433002/diff/100001/extensions/renderer/user_gestures_native_handler.cc File extensions/renderer/user_gestures_native_handler.cc (right): https://codereview.chromium.org/2454433002/diff/100001/extensions/renderer/user_gestures_native_handler.cc#newcode42 extensions/renderer/user_gestures_native_handler.cc:42: context()->CallFunctionSafe(v8::Local<v8::Function>::Cast(args[0]), 0, On 2016/10/28 08:45:14, haraken wrote: > > ...
4 years, 1 month ago (2016-10-28 15:00:06 UTC) #26
Devlin
4 years, 1 month ago (2016-10-28 15:00:07 UTC) #27
haraken
https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode212 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:212: ScriptState::Scope scriptScope(scriptState); On 2016/10/28 15:00:05, Devlin wrote: > On ...
4 years, 1 month ago (2016-10-28 15:47:51 UTC) #28
Devlin
https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode212 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:212: ScriptState::Scope scriptScope(scriptState); On 2016/10/28 15:47:51, haraken wrote: > On ...
4 years, 1 month ago (2016-10-28 16:00:00 UTC) #29
haraken
https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode212 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:212: ScriptState::Scope scriptScope(scriptState); On 2016/10/28 16:00:00, Devlin wrote: > On ...
4 years, 1 month ago (2016-10-28 16:18:57 UTC) #30
dcheng
https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode207 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:207: v8::HandleScope scope(v8::Isolate::GetCurrent()); Btw, assuming we combine the two separate ...
4 years, 1 month ago (2016-10-28 17:24:18 UTC) #31
Devlin
If at any point this seems like something the blink team should be working on, ...
4 years, 1 month ago (2016-10-28 20:31:37 UTC) #34
haraken
Mostly looks good. https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode83 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:83: RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld( Can you ...
4 years, 1 month ago (2016-10-29 01:41:06 UTC) #37
dcheng
https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode33 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:33: ScriptState* getScriptState(LocalFrame*) override; It is possible to bind ScriptState ...
4 years, 1 month ago (2016-10-29 04:36:21 UTC) #38
Devlin
Just replying - will address other comments on Monday. https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode33 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:33: ...
4 years, 1 month ago (2016-10-29 17:45:50 UTC) #39
Devlin
https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/tests/WebFrameTest.cpp File third_party/WebKit/Source/web/tests/WebFrameTest.cpp (right): https://codereview.chromium.org/2454433002/diff/100001/third_party/WebKit/Source/web/tests/WebFrameTest.cpp#newcode400 third_party/WebKit/Source/web/tests/WebFrameTest.cpp:400: EXPECT_EQ(document->body(), On 2016/10/28 20:31:37, Devlin wrote: > On 2016/10/28 ...
4 years, 1 month ago (2016-10-31 17:00:47 UTC) #42
dcheng
As for the UGI stuff, let me try to find someone who knows what the ...
4 years, 1 month ago (2016-11-01 00:14:05 UTC) #45
Nate Chapin
https://codereview.chromium.org/2454433002/diff/140001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/140001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode134 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:134: // It's important that we don't pass the gesture ...
4 years, 1 month ago (2016-11-01 17:40:18 UTC) #47
Devlin
https://codereview.chromium.org/2454433002/diff/140001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/140001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode134 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:134: // It's important that we don't pass the gesture ...
4 years, 1 month ago (2016-11-01 17:56:10 UTC) #48
Devlin
haraken + dcheng, mind taking another look? https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/120001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode33 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:33: ScriptState* getScriptState(LocalFrame*) ...
4 years, 1 month ago (2016-11-03 01:17:08 UTC) #51
dcheng
LGTM FWIW, I would still personally prefer a non-null callback (since we have to sprinkle ...
4 years, 1 month ago (2016-11-03 08:04:44 UTC) #54
haraken
LGTM https://codereview.chromium.org/2454433002/diff/160001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp File third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp (right): https://codereview.chromium.org/2454433002/diff/160001/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp#newcode143 third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp:143: frame, *DOMWrapperWorld::fromWorldId(v8::Isolate::GetCurrent(), worldID, Use toIsolate(frame), or explicitly pass ...
4 years, 1 month ago (2016-11-03 14:37:04 UTC) #55
Devlin
> FWIW, I would still personally prefer a non-null callback (since we have to > ...
4 years, 1 month ago (2016-11-04 05:40:32 UTC) #58
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/2454433002/180001
4 years, 1 month ago (2016-11-04 05:40:58 UTC) #62
commit-bot: I haz the power
Committed patchset #8 (id:180001)
4 years, 1 month ago (2016-11-04 06:00:38 UTC) #63
commit-bot: I haz the power
4 years, 1 month ago (2016-11-04 06:02:18 UTC) #65
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/57d2116813649148c761075f528db81ec51265db
Cr-Commit-Position: refs/heads/master@{#429805}

Powered by Google App Engine
This is Rietveld 408576698