| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/desktop_session_win.h" | 5 #include "remoting/host/desktop_session_win.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <sddl.h> | 8 #include <sddl.h> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 host_size = webrtc::DesktopSize( | 249 host_size = webrtc::DesktopSize( |
| 250 std::min(kMaxRdpScreenWidth, | 250 std::min(kMaxRdpScreenWidth, |
| 251 std::max(kMinRdpScreenWidth, host_size.width())), | 251 std::max(kMinRdpScreenWidth, host_size.width())), |
| 252 std::min(kMaxRdpScreenHeight, | 252 std::min(kMaxRdpScreenHeight, |
| 253 std::max(kMinRdpScreenHeight, host_size.height()))); | 253 std::max(kMinRdpScreenHeight, host_size.height()))); |
| 254 | 254 |
| 255 // Create an RDP session. | 255 // Create an RDP session. |
| 256 base::win::ScopedComPtr<IRdpDesktopSessionEventHandler> event_handler( | 256 base::win::ScopedComPtr<IRdpDesktopSessionEventHandler> event_handler( |
| 257 new EventHandler(weak_factory_.GetWeakPtr())); | 257 new EventHandler(weak_factory_.GetWeakPtr())); |
| 258 terminal_id_ = base::GenerateGUID(); | 258 terminal_id_ = base::GenerateGUID(); |
| 259 base::win::ScopedBstr terminal_id(UTF8ToUTF16(terminal_id_).c_str()); | 259 base::win::ScopedBstr terminal_id(base::UTF8ToUTF16(terminal_id_).c_str()); |
| 260 result = rdp_desktop_session_->Connect(host_size.width(), | 260 result = rdp_desktop_session_->Connect(host_size.width(), |
| 261 host_size.height(), | 261 host_size.height(), |
| 262 terminal_id, | 262 terminal_id, |
| 263 event_handler); | 263 event_handler); |
| 264 if (FAILED(result)) { | 264 if (FAILED(result)) { |
| 265 LOG(ERROR) << "RdpSession::Create() failed, 0x" | 265 LOG(ERROR) << "RdpSession::Create() failed, 0x" |
| 266 << std::hex << result << std::dec << "."; | 266 << std::hex << result << std::dec << "."; |
| 267 return false; | 267 return false; |
| 268 } | 268 } |
| 269 | 269 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 // Copy the command line switches enabling verbose logging. | 537 // Copy the command line switches enabling verbose logging. |
| 538 target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), | 538 target->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), |
| 539 kCopiedSwitchNames, | 539 kCopiedSwitchNames, |
| 540 arraysize(kCopiedSwitchNames)); | 540 arraysize(kCopiedSwitchNames)); |
| 541 | 541 |
| 542 // Create a delegate capable of launching a process in a different session. | 542 // Create a delegate capable of launching a process in a different session. |
| 543 scoped_ptr<WtsSessionProcessDelegate> delegate( | 543 scoped_ptr<WtsSessionProcessDelegate> delegate( |
| 544 new WtsSessionProcessDelegate(io_task_runner_, | 544 new WtsSessionProcessDelegate(io_task_runner_, |
| 545 target.Pass(), | 545 target.Pass(), |
| 546 launch_elevated, | 546 launch_elevated, |
| 547 WideToUTF8(kDaemonIpcSecurityDescriptor))); | 547 base::WideToUTF8( |
| 548 kDaemonIpcSecurityDescriptor))); |
| 548 if (!delegate->Initialize(session_id)) { | 549 if (!delegate->Initialize(session_id)) { |
| 549 TerminateSession(); | 550 TerminateSession(); |
| 550 return; | 551 return; |
| 551 } | 552 } |
| 552 | 553 |
| 553 // Create a launcher for the desktop process, using the per-session delegate. | 554 // Create a launcher for the desktop process, using the per-session delegate. |
| 554 launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this)); | 555 launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this)); |
| 555 } | 556 } |
| 556 | 557 |
| 557 void DesktopSessionWin::OnSessionDetached() { | 558 void DesktopSessionWin::OnSessionDetached() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 exploded.hour, | 602 exploded.hour, |
| 602 exploded.minute, | 603 exploded.minute, |
| 603 exploded.second, | 604 exploded.second, |
| 604 exploded.millisecond, | 605 exploded.millisecond, |
| 605 passed.c_str()); | 606 passed.c_str()); |
| 606 | 607 |
| 607 last_timestamp_ = now; | 608 last_timestamp_ = now; |
| 608 } | 609 } |
| 609 | 610 |
| 610 } // namespace remoting | 611 } // namespace remoting |
| OLD | NEW |