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

Issue 519113002: Do not mutate ui::Event properties during nested event processing (Closed)

Created:
6 years, 3 months ago by tdanderson
Modified:
6 years, 3 months ago
Reviewers:
flackr, sadrul, kpschoedel
CC:
chromium-reviews, tdresser+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Do not mutate ui::Event properties during nested event processing If an EventProcessor starts to process a ui::Event while it is already being processed by another EventProcessor, then the properties of the event (e.g., target, phase) should not be mutated by the inner processor before control is returned to the outer processor. The exception being whether or not the event has been handled. To guarantee this, the inner processor should dispatch a copy of the event rather than the original event itself. This CL also introduces the static ui::Event::Clone() method, which is used to create a copy of a ui::Event. BUG=404232 TEST=EventProcessorTest.NestedEventProcessing, updated WindowManagerTest.Focus Committed: https://crrev.com/88d8e4e3f6ced79844bf7a296bb5b9d6ac0ef4f5 Cr-Commit-Position: refs/heads/master@{#293410}

Patch Set 1 #

Total comments: 4

Patch Set 2 : forgot a Clone() override in a test suite #

Patch Set 3 : allow copying of TestEvent #

Patch Set 4 : comments addressed, test modified #

Total comments: 4

Patch Set 5 : only Clone() when needed #

Total comments: 4

Patch Set 6 : comments changed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -1 line) Patch
M ash/wm/window_manager_unittest.cc View 1 2 3 3 chunks +3 lines, -0 lines 0 comments Download
M ui/events/event.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M ui/events/event.cc View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
M ui/events/event_processor.cc View 1 2 3 4 5 1 chunk +18 lines, -1 line 0 comments Download
M ui/events/event_processor_unittest.cc View 1 chunk +85 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (5 generated)
tdanderson
Sadrul and Kevin, can you please take a look? As-is, I am making the assumption ...
6 years, 3 months ago (2014-08-29 20:18:49 UTC) #2
kpschoedel
On 2014/08/29 20:18:49, tdanderson wrote: > Sadrul and Kevin, can you please take a look? ...
6 years, 3 months ago (2014-08-29 20:49:17 UTC) #3
kpschoedel
On 2014/08/29 20:49:17, kpschoedel wrote: > It doesn't copy the native event, so your patch ...
6 years, 3 months ago (2014-08-29 20:51:29 UTC) #4
sadrul
https://codereview.chromium.org/519113002/diff/1/ui/events/event.h File ui/events/event.h (right): https://codereview.chromium.org/519113002/diff/1/ui/events/event.h#newcode219 ui/events/event.h:219: virtual scoped_ptr<Event> Clone() const = 0; Can we have ...
6 years, 3 months ago (2014-08-29 21:12:17 UTC) #5
tdanderson
Can you please take another look? Note that I updated WindowManagerTest.Focus to not dispatch the ...
6 years, 3 months ago (2014-09-02 22:57:09 UTC) #6
sadrul
https://codereview.chromium.org/519113002/diff/60001/ui/events/event_processor.cc File ui/events/event_processor.cc (right): https://codereview.chromium.org/519113002/diff/60001/ui/events/event_processor.cc#newcode20 ui/events/event_processor.cc:20: scoped_ptr<Event> event_copy(Event::Clone(*event)); I was thinking of something more like ...
6 years, 3 months ago (2014-09-03 16:23:53 UTC) #7
tdanderson
Sadrul, can you please take a look at the next patch set and my inline ...
6 years, 3 months ago (2014-09-03 20:20:02 UTC) #8
sadrul
LGTM https://codereview.chromium.org/519113002/diff/80001/ui/events/event_processor.cc File ui/events/event_processor.cc (right): https://codereview.chromium.org/519113002/diff/80001/ui/events/event_processor.cc#newcode22 ui/events/event_processor.cc:22: // EventProcessor. If the event is in the ...
6 years, 3 months ago (2014-09-04 15:45:06 UTC) #9
tdanderson
Rob, can you please review the change in ash/ ?
6 years, 3 months ago (2014-09-04 17:03:12 UTC) #11
tdanderson
https://codereview.chromium.org/519113002/diff/80001/ui/events/event_processor.cc File ui/events/event_processor.cc (right): https://codereview.chromium.org/519113002/diff/80001/ui/events/event_processor.cc#newcode22 ui/events/event_processor.cc:22: // EventProcessor. On 2014/09/04 15:45:06, sadrul wrote: > If ...
6 years, 3 months ago (2014-09-04 17:19:03 UTC) #12
flackr
ash/ LGTM
6 years, 3 months ago (2014-09-04 17:42:38 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tdanderson@chromium.org/519113002/100001
6 years, 3 months ago (2014-09-04 18:21:02 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_swarming on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_swarming/builds/10266)
6 years, 3 months ago (2014-09-04 23:18:47 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tdanderson@chromium.org/519113002/100001
6 years, 3 months ago (2014-09-05 01:15:30 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:100001) as 5e4ae076275c91a23d69eabaaed3876f3a8a7626
6 years, 3 months ago (2014-09-05 02:45:29 UTC) #20
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:35:53 UTC) #21
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/88d8e4e3f6ced79844bf7a296bb5b9d6ac0ef4f5
Cr-Commit-Position: refs/heads/master@{#293410}

Powered by Google App Engine
This is Rietveld 408576698