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

Side by Side Diff: remoting/host/desktop_process.cc

Issue 12302042: Add more IPC unit tests: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DesktopProcess shutdown. Test IpcDesktopEnvironmentFactory too." Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/desktop_session_connector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This file implements the Windows service controlling Me2Me host processes 5 // This file implements the Windows service controlling Me2Me host processes
6 // running within user sessions. 6 // running within user sessions.
7 7
8 #include "remoting/host/desktop_process.h" 8 #include "remoting/host/desktop_process.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return handled; 64 return handled;
65 } 65 }
66 66
67 void DesktopProcess::OnChannelConnected(int32 peer_pid) { 67 void DesktopProcess::OnChannelConnected(int32 peer_pid) {
68 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 68 DCHECK(caller_task_runner_->BelongsToCurrentThread());
69 69
70 VLOG(1) << "IPC: desktop <- daemon (" << peer_pid << ")"; 70 VLOG(1) << "IPC: desktop <- daemon (" << peer_pid << ")";
71 } 71 }
72 72
73 void DesktopProcess::OnChannelError() { 73 void DesktopProcess::OnChannelError() {
74 DCHECK(caller_task_runner_->BelongsToCurrentThread());
75
76 // Shutdown the desktop process. 74 // Shutdown the desktop process.
77 daemon_channel_.reset(); 75 daemon_channel_.reset();
78 desktop_agent_->Stop(); 76 if (desktop_agent_) {
79 desktop_agent_ = NULL; 77 desktop_agent_->Stop();
78 desktop_agent_ = NULL;
79 }
80
80 caller_task_runner_ = NULL; 81 caller_task_runner_ = NULL;
81 } 82 }
82 83
83 bool DesktopProcess::Start( 84 bool DesktopProcess::Start(
84 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory) { 85 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory) {
85 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 86 DCHECK(caller_task_runner_->BelongsToCurrentThread());
86 DCHECK(!desktop_environment_factory_); 87 DCHECK(!desktop_environment_factory_);
87 DCHECK(desktop_environment_factory); 88 DCHECK(desktop_environment_factory);
88 89
89 desktop_environment_factory_ = desktop_environment_factory.Pass(); 90 desktop_environment_factory_ = desktop_environment_factory.Pass();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 145 }
145 146
146 void DesktopProcess::OnCrash(const std::string& function_name, 147 void DesktopProcess::OnCrash(const std::string& function_name,
147 const std::string& file_name, 148 const std::string& file_name,
148 const int& line_number) { 149 const int& line_number) {
149 // The daemon requested us to crash the process. 150 // The daemon requested us to crash the process.
150 CHECK(false); 151 CHECK(false);
151 } 152 }
152 153
153 } // namespace remoting 154 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/desktop_session_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698