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

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

Issue 11234034: Crash the network process when a fatal daemon-to-network protocol error encountered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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 | « remoting/host/daemon_process_unittest.cc ('k') | remoting/host/remoting_me2me_host.cc » ('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 #include "remoting/host/daemon_process.h" 5 #include "remoting/host/daemon_process.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 virtual void SendToNetwork(IPC::Message* message) OVERRIDE; 46 virtual void SendToNetwork(IPC::Message* message) OVERRIDE;
47 47
48 protected: 48 protected:
49 // Stoppable implementation. 49 // Stoppable implementation.
50 virtual void DoStop() OVERRIDE; 50 virtual void DoStop() OVERRIDE;
51 51
52 // DaemonProcess implementation. 52 // DaemonProcess implementation.
53 virtual scoped_ptr<DesktopSession> DoCreateDesktopSession( 53 virtual scoped_ptr<DesktopSession> DoCreateDesktopSession(
54 int terminal_id) OVERRIDE; 54 int terminal_id) OVERRIDE;
55 virtual void LaunchNetworkProcess() OVERRIDE; 55 virtual void LaunchNetworkProcess() OVERRIDE;
56 virtual void RestartNetworkProcess() OVERRIDE;
57 56
58 private: 57 private:
59 scoped_ptr<WorkerProcessLauncher> network_launcher_; 58 scoped_ptr<WorkerProcessLauncher> network_launcher_;
60 59
61 DISALLOW_COPY_AND_ASSIGN(DaemonProcessWin); 60 DISALLOW_COPY_AND_ASSIGN(DaemonProcessWin);
62 }; 61 };
63 62
64 DaemonProcessWin::DaemonProcessWin( 63 DaemonProcessWin::DaemonProcessWin(
65 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 64 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
66 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 65 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 return; 109 return;
111 } 110 }
112 111
113 scoped_ptr<UnprivilegedProcessDelegate> delegate( 112 scoped_ptr<UnprivilegedProcessDelegate> delegate(
114 new UnprivilegedProcessDelegate(caller_task_runner(), io_task_runner(), 113 new UnprivilegedProcessDelegate(caller_task_runner(), io_task_runner(),
115 host_binary)); 114 host_binary));
116 network_launcher_.reset(new WorkerProcessLauncher( 115 network_launcher_.reset(new WorkerProcessLauncher(
117 caller_task_runner(), delegate.Pass(), this)); 116 caller_task_runner(), delegate.Pass(), this));
118 } 117 }
119 118
120 void DaemonProcessWin::RestartNetworkProcess() {
121 DCHECK(caller_task_runner()->BelongsToCurrentThread());
122
123 network_launcher_.reset();
124 LaunchNetworkProcess();
125 }
126
127 scoped_ptr<DaemonProcess> DaemonProcess::Create( 119 scoped_ptr<DaemonProcess> DaemonProcess::Create(
128 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 120 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
129 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 121 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
130 const base::Closure& stopped_callback) { 122 const base::Closure& stopped_callback) {
131 scoped_ptr<DaemonProcessWin> daemon_process( 123 scoped_ptr<DaemonProcessWin> daemon_process(
132 new DaemonProcessWin(caller_task_runner, io_task_runner, 124 new DaemonProcessWin(caller_task_runner, io_task_runner,
133 stopped_callback)); 125 stopped_callback));
134 daemon_process->Initialize(); 126 daemon_process->Initialize();
135 return daemon_process.PassAs<DaemonProcess>(); 127 return daemon_process.PassAs<DaemonProcess>();
136 } 128 }
137 129
138 } // namespace remoting 130 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/daemon_process_unittest.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698