diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 01:08:18 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 01:08:18 +0000 |
commit | c363d006a8806d1be4be58cd7689359ad24de6f0 (patch) | |
tree | 79394812b9c873e0dd4e355f5a9aa946f41581bb /remoting/client | |
parent | b7f7b7cce0bfa6daa351d95db93e260f4c04d81a (diff) | |
download | chromium_src-c363d006a8806d1be4be58cd7689359ad24de6f0.zip chromium_src-c363d006a8806d1be4be58cd7689359ad24de6f0.tar.gz chromium_src-c363d006a8806d1be4be58cd7689359ad24de6f0.tar.bz2 |
Fix 2 crashers in remoting client.
There are two issues:
1) VideoReader::Create() was returning null for VP8 over TCP.
2) InputHandler was trying to send events before InputStub is created.
BUG=None
TEST=remoting client works
Review URL: http://codereview.chromium.org/5327002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/input_handler.cc | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/remoting/client/input_handler.cc b/remoting/client/input_handler.cc index 87c3c89..7048e73 100644 --- a/remoting/client/input_handler.cc +++ b/remoting/client/input_handler.cc @@ -19,31 +19,37 @@ InputHandler::InputHandler(ClientContext* context, } void InputHandler::SendKeyEvent(bool press, int keycode) { - KeyEvent* event = new KeyEvent(); - event->set_key(keycode); - event->set_pressed(press); - protocol::InputStub* stub = connection_->input_stub(); - stub->InjectKeyEvent(event, new DeleteTask<KeyEvent>(event)); + if (stub) { + KeyEvent* event = new KeyEvent(); + event->set_key(keycode); + event->set_pressed(press); + + stub->InjectKeyEvent(event, new DeleteTask<KeyEvent>(event)); + } } void InputHandler::SendMouseMoveEvent(int x, int y) { - MouseEvent* event = new MouseEvent(); - event->set_x(x); - event->set_y(y); - protocol::InputStub* stub = connection_->input_stub(); - stub->InjectMouseEvent(event, new DeleteTask<MouseEvent>(event)); + if (stub) { + MouseEvent* event = new MouseEvent(); + event->set_x(x); + event->set_y(y); + + stub->InjectMouseEvent(event, new DeleteTask<MouseEvent>(event)); + } } void InputHandler::SendMouseButtonEvent(bool button_down, MouseButton button) { - MouseEvent* event = new MouseEvent(); - event->set_button(button); - event->set_button_down(button_down); - protocol::InputStub* stub = connection_->input_stub(); - stub->InjectMouseEvent(event, new DeleteTask<MouseEvent>(event)); + if (stub) { + MouseEvent* event = new MouseEvent(); + event->set_button(button); + event->set_button_down(button_down); + + stub->InjectMouseEvent(event, new DeleteTask<MouseEvent>(event)); + } } } // namespace remoting |