Skip to content

Commit

Permalink
Don't crash when we get unexpected pointer events. (flutter#4230)
Browse files Browse the repository at this point in the history
Just log them as errors
  • Loading branch information
abarth authored Oct 17, 2017
1 parent 04ad284 commit 2528e53
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion content_handler/runtime_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,19 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event,
pointer_data.change = blink::PointerData::Change::kHover;
break;
case blink::PointerData::Change::kAdd:
if (down_pointers_.count(pointer_data.device) != 0) {
FXL_DLOG(ERROR) << "Received add event for down pointer.";
}
break;
case blink::PointerData::Change::kRemove:
if (down_pointers_.count(pointer_data.device) != 0) {
FXL_DLOG(ERROR) << "Received remove event for down pointer.";
}
break;
case blink::PointerData::Change::kHover:
FXL_DCHECK(down_pointers_.count(pointer_data.device) == 0);
if (down_pointers_.count(pointer_data.device) != 0) {
FXL_DLOG(ERROR) << "Received hover event for down pointer.";
}
break;
}

Expand Down

0 comments on commit 2528e53

Please sign in to comment.