diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 02:27:09 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-11 02:27:09 +0000 |
commit | 6387b4de56f0ac62bae8ab2c356e617db9cb9c55 (patch) | |
tree | db0c2f91281a6bb150b32c3bee1eb436c0047585 /remoting/protocol/host_event_dispatcher.cc | |
parent | 4a404e5356b27578de71b9b41de686768d2ecd42 (diff) | |
download | chromium_src-6387b4de56f0ac62bae8ab2c356e617db9cb9c55.zip chromium_src-6387b4de56f0ac62bae8ab2c356e617db9cb9c55.tar.gz chromium_src-6387b4de56f0ac62bae8ab2c356e617db9cb9c55.tar.bz2 |
This CL removes the unused trace.proto definition and build target, and makes all protobuf fields "optional".
Fields marked required cause protobuf messages to be silently ignored if those fields are not present. By moving the fields to be optional we have more flexibility to remove fields in future.
All of the previously-required fields were in client-to-host messages; clients will need to continue to provide those fields at least until all hosts are updated not to require them - this is primarily relevant for the KeyEvent "keycode" field.
Review URL: http://codereview.chromium.org/10024003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131698 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/host_event_dispatcher.cc')
-rw-r--r-- | remoting/protocol/host_event_dispatcher.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/remoting/protocol/host_event_dispatcher.cc b/remoting/protocol/host_event_dispatcher.cc index 6ec1f17..6ba6dd0 100644 --- a/remoting/protocol/host_event_dispatcher.cc +++ b/remoting/protocol/host_event_dispatcher.cc @@ -33,11 +33,13 @@ void HostEventDispatcher::OnMessageReceived( base::ScopedClosureRunner done_runner(done_task); - sequence_number_callback_.Run(message->sequence_number()); + if (message->has_sequence_number() && !sequence_number_callback_.is_null()) + sequence_number_callback_.Run(message->sequence_number()); if (message->has_key_event()) { const KeyEvent& event = message->key_event(); - if (event.has_keycode() && event.has_pressed()) { + if ((event.has_keycode() || event.has_usb_keycode()) && + event.has_pressed()) { input_stub_->InjectKeyEvent(event); } else { LOG(WARNING) << "Received invalid key event."; |