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

Issue 1897363003: Use correct WebView from EventSender. (Closed)

Created:
4 years, 8 months ago by Łukasz Anforowicz
Modified:
4 years, 8 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jochen+watch_chromium.org, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, Peter Beverloo, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use correct WebView from EventSender. EventSender provides javascript bindings for test functions that tests can use to inject input events (i.e. mouse events) into WebView. Before this CL EventSender would act on the WebView associated with the main test window, rather than acting on the WebView associated with the frame owning the javascript bindings. This could lead to UaF - i.e. when EventSender::PointerDown tries to access an already destroyed WebView (no good repro at ToT - repro would happen after other OOPIF refactorings when running in --site-per-process mode). Changes in the current CL: - EventSender's lifetime is now owned by WebViewTestProxy (rather than having EventSender owned by the global TestInterfaces object). - EventSender now uses WebView and WebTestDelegate from the correct WebViewTestProxy (rather than ones associted with the main test window). - TestInterfaces object no longer has a pointer to an EventSender object (because there is no longer a central/global EventSender object). This means having to move code that calls EventSender::Install and EventSender::set_send_wheel_gestures away from TestInterfaces. Additional changes: - Some methods of EventSender can be made private - EventSender does not need to inherit from base::SupportsWeakPtr<...> (because EventSender already has a weak_factory_ field). BUG=595089 Committed: https://crrev.com/335bb76db170d76ba46fa003a8838255a5d46187 Cr-Commit-Position: refs/heads/master@{#389139}

Patch Set 1 #

Patch Set 2 : Self-review. #

Patch Set 3 : Moving where Reset is trigerred + small self-review tweaks. #

Patch Set 4 : Removing unused include. #

Patch Set 5 : Fixed initial state of EventSender. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -161 lines) Patch
M components/test_runner/event_sender.h View 1 2 5 chunks +17 lines, -16 lines 0 comments Download
M components/test_runner/event_sender.cc View 1 2 3 4 35 chunks +71 lines, -91 lines 1 comment Download
M components/test_runner/test_interfaces.h View 1 3 chunks +0 lines, -3 lines 0 comments Download
M components/test_runner/test_interfaces.cc View 1 2 8 chunks +3 lines, -12 lines 0 comments Download
M components/test_runner/web_frame_test_client.h View 3 chunks +4 lines, -3 lines 0 comments Download
M components/test_runner/web_frame_test_client.cc View 1 2 3 4 chunks +11 lines, -4 lines 0 comments Download
M components/test_runner/web_frame_test_proxy.h View 1 chunk +5 lines, -0 lines 0 comments Download
M components/test_runner/web_test_interfaces.h View 2 chunks +3 lines, -4 lines 0 comments Download
M components/test_runner/web_test_interfaces.cc View 1 4 chunks +4 lines, -15 lines 0 comments Download
M components/test_runner/web_test_proxy.h View 1 2 3 chunks +10 lines, -1 line 0 comments Download
M components/test_runner/web_test_proxy.cc View 1 2 3 chunks +15 lines, -1 line 0 comments Download
M components/test_runner/web_view_test_client.h View 2 chunks +0 lines, -2 lines 0 comments Download
M components/test_runner/web_view_test_client.cc View 2 chunks +1 line, -4 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M content/shell/renderer/layout_test/layout_test_content_renderer_client.cc View 3 chunks +6 lines, -1 line 0 comments Download
M content/shell/renderer/layout_test/layout_test_render_thread_observer.cc View 2 chunks +0 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 11 (6 generated)
Łukasz Anforowicz
jochen@, could you please take a look? https://codereview.chromium.org/1897363003/diff/80001/components/test_runner/event_sender.cc File components/test_runner/event_sender.cc (left): https://codereview.chromium.org/1897363003/diff/80001/components/test_runner/event_sender.cc#oldcode1223 components/test_runner/event_sender.cc:1223: click_count_(0), All ...
4 years, 8 months ago (2016-04-21 23:01:45 UTC) #3
jochen (gone - plz use gerrit)
lgtm
4 years, 8 months ago (2016-04-22 15:24:51 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1897363003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1897363003/80001
4 years, 8 months ago (2016-04-22 16:05:44 UTC) #7
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 8 months ago (2016-04-22 16:44:16 UTC) #9
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:48:46 UTC) #11
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/335bb76db170d76ba46fa003a8838255a5d46187
Cr-Commit-Position: refs/heads/master@{#389139}

Powered by Google App Engine
This is Rietveld 408576698