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

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: CR feedback 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
« no previous file with comments | « remoting/host/daemon_process.h ('k') | remoting/host/daemon_process_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/daemon_process.cc
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
index 2fcf3d8c1a163ecddb703b18df9317735367e11a..9d2cdbc26ce2546163c3903e3416d1a2cfa9b620 100644
--- a/remoting/host/daemon_process.cc
+++ b/remoting/host/daemon_process.cc
@@ -18,25 +18,24 @@
#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 remoting {
+
namespace {
-std::ostream& operator<<(std::ostream& os, const SkIPoint& point) {
- return os << "(" << point.x() << ", " << point.y() << ")";
-}
+// This is used for tagging system event logs.
+const char kApplicationName[] = "chromoting";
-std::ostream& operator<<(std::ostream& os, const SkISize& size) {
- return os << size.width() << "x" << size.height();
+std::ostream& operator<<(std::ostream& os, const ScreenResolution& resolution) {
+ return os << resolution.dimensions_.width() << "x"
+ << resolution.dimensions_.height() << " at "
+ << resolution.dpi_.x() << "x" << resolution.dpi_.y() << " DPI";
}
} // namespace
-namespace remoting {
-
-// This is used for tagging system event logs.
-const char kApplicationName[] = "chromoting";
-
DaemonProcess::~DaemonProcess() {
DCHECK(!config_watcher_.get());
DCHECK(desktop_sessions_.empty());
@@ -171,7 +170,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 +186,9 @@ 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) {
- LOG(ERROR) << "Invalid DPI of the remote screen specified: "
- << 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_;
+ // Validate |resolution|.
+ if (!resolution.IsValid()) {
+ LOG(ERROR) << "Invalid resolution specified: " << resolution;
SendToNetwork(
new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id));
return;
@@ -205,7 +196,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(
« no previous file with comments | « remoting/host/daemon_process.h ('k') | remoting/host/daemon_process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698