Prevent TouchEvent Crash on X
commit5444194bd4e2f4dda4725169b879af6077dd240a
authorjonross <jonross@chromium.org>
Fri, 20 Mar 2015 13:13:45 +0000 (20 06:13 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 20 Mar 2015 13:14:22 +0000 (20 13:14 +0000)
treec23660a812dc9c755b6521f9727c553571fb3883
parenta77f0444b8bc31c6ac57817f3259f50d4c291e0e
Prevent TouchEvent Crash on X

When TouchEvents are copied the base::NativeEvent of the copy is set as null for
GenericEvent types, such as touchs.

Touch Release and Cancel events are set to remove a native touch id mapping upon
destruction.

This causes copied Touch Release/Cancel events to attempt to remove a mapping on
a null native event. Leading to a crash.

I've explicitly defined a copy constructor on TouchEvent to stop copied events
from attempting to remove this mapping.

TEST=EventsXTest.CopiedTouchEventNotRemovingFromNativeMapping
BUG=467102

Review URL: https://codereview.chromium.org/1026573002

Cr-Commit-Position: refs/heads/master@{#321563}
ui/events/event.cc
ui/events/event.h
ui/events/x/events_x_unittest.cc