Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2333)

Unified Diff: remoting/host/client_session.cc

Issue 13983010: Use webrtc::DesktopCapturer for screen capturer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_param_traits.cc ('k') | remoting/host/client_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 8636b7a0a79a8382563635dca2762f842c6f5505..38ec520d6dc9219316a5ec56acac5fbc6fbccd3a 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -99,8 +99,13 @@ void ClientSession::NotifyClientResolution(
const protocol::ClientResolution& resolution) {
DCHECK(CalledOnValidThread());
- if (!resolution.has_dips_width() || !resolution.has_dips_height())
+ // TODO(sergeyu): Move these checks to protocol layer.
+ if (!resolution.has_dips_width() || !resolution.has_dips_height() ||
+ resolution.dips_width() < 0 || resolution.dips_height() < 0 ||
+ resolution.width() <= 0 || resolution.height() <= 0) {
+ LOG(ERROR) << "Received invalid ClientResolution message.";
return;
+ }
VLOG(1) << "Received ClientResolution (dips_width="
<< resolution.dips_width() << ", dips_height="
@@ -110,12 +115,11 @@ void ClientSession::NotifyClientResolution(
return;
ScreenResolution client_resolution(
- SkISize::Make(resolution.dips_width(), resolution.dips_height()),
- SkIPoint::Make(kDefaultDPI, kDefaultDPI));
+ webrtc::DesktopSize(resolution.dips_width(), resolution.dips_height()),
+ webrtc::DesktopVector(kDefaultDPI, kDefaultDPI));
// Try to match the client's resolution.
- if (client_resolution.IsValid())
- screen_controls_->SetScreenResolution(client_resolution);
+ screen_controls_->SetScreenResolution(client_resolution);
}
void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {
« no previous file with comments | « remoting/host/chromoting_param_traits.cc ('k') | remoting/host/client_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698