Chromium Code Reviews
DescriptionUse 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
Dependent Patchsets: Messages
Total messages: 11 (6 generated)
|