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

Unified Diff: remoting/host/daemon_process.cc

Issue 12678008: Reworked the plumbing required to pass the client resolution to the desktop resizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: remoting/host/daemon_process.cc
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
index 2fcf3d8c1a163ecddb703b18df9317735367e11a..0b2ab9b6dccb1db970863a739b60f8b5e88fd584 100644
--- a/remoting/host/daemon_process.cc
+++ b/remoting/host/daemon_process.cc
@@ -18,6 +18,7 @@
#include "remoting/host/desktop_session.h"
#include "remoting/host/host_event_logger.h"
#include "remoting/host/host_status_observer.h"
+#include "remoting/host/screen_resolution.h"
#include "remoting/protocol/transport.h"
namespace {
@@ -171,7 +172,7 @@ DaemonProcess::DaemonProcess(
}
void DaemonProcess::CreateDesktopSession(int terminal_id,
- const DesktopSessionParams& params,
+ const ScreenResolution& resolution,
bool virtual_terminal) {
DCHECK(caller_task_runner()->BelongsToCurrentThread());
@@ -187,17 +188,10 @@ void DaemonProcess::CreateDesktopSession(int terminal_id,
// Terminal IDs cannot be reused. Update the expected next terminal ID.
next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1);
- // Validate |params|.
- if (params.client_dpi_.x() < 0 || params.client_dpi_.y() < 0) {
+ // Validate |resolution|.
+ if (!resolution.IsValid()) {
LOG(ERROR) << "Invalid DPI of the remote screen specified: "
Jamie 2013/03/15 18:33:24 "DPI/resolution" instead of "DPI"?
alexeypa (please no reviews) 2013/03/15 20:30:41 Done.
- << params.client_dpi_;
- SendToNetwork(
- new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id));
- return;
- }
- if (params.client_size_.width() < 0 || params.client_size_.height() < 0) {
- LOG(ERROR) << "Invalid resolution of the remote screen specified: "
- << params.client_size_;
+ << resolution.dimensions_ << ", " << resolution.dpi_;
SendToNetwork(
new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id));
return;
@@ -205,7 +199,7 @@ void DaemonProcess::CreateDesktopSession(int terminal_id,
// Create the desktop session.
scoped_ptr<DesktopSession> session = DoCreateDesktopSession(
- terminal_id, params, virtual_terminal);
+ terminal_id, resolution, virtual_terminal);
if (!session) {
LOG(ERROR) << "Failed to create a desktop session.";
SendToNetwork(

Powered by Google App Engine
This is Rietveld 408576698