summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 01:08:18 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 01:08:18 +0000
commitc363d006a8806d1be4be58cd7689359ad24de6f0 (patch)
tree79394812b9c873e0dd4e355f5a9aa946f41581bb
parentb7f7b7cce0bfa6daa351d95db93e260f4c04d81a (diff)
downloadchromium_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
-rw-r--r--remoting/client/input_handler.cc36
-rw-r--r--remoting/protocol/video_reader.cc5
2 files changed, 25 insertions, 16 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
diff --git a/remoting/protocol/video_reader.cc b/remoting/protocol/video_reader.cc
index 2c1585a..b3bc5ed 100644
--- a/remoting/protocol/video_reader.cc
+++ b/remoting/protocol/video_reader.cc
@@ -19,11 +19,14 @@ VideoReader* VideoReader::Create(const SessionConfig* config) {
if (video_config.transport == ChannelConfig::TRANSPORT_SRTP) {
return new RtpVideoReader();
} else if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) {
- if (video_config.codec == ChannelConfig::CODEC_ZIP)
+ if (video_config.codec == ChannelConfig::CODEC_VP8)
+ return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8);
+ else if (video_config.codec == ChannelConfig::CODEC_ZIP)
return new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB);
else if (video_config.codec == ChannelConfig::CODEC_VERBATIM)
return new ProtobufVideoReader(VideoPacketFormat::ENCODING_VERBATIM);
}
+ NOTREACHED();
return NULL;
}