Chromium Code Reviews| Index: remoting/host/simple_host_process.cc |
| diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc |
| index 98d93036a8ca7dcfc5993f14bfe64d0ac851e0c1..2e6c9f1030bd02bf0e1019d3cd02af22fabd12ca 100644 |
| --- a/remoting/host/simple_host_process.cc |
| +++ b/remoting/host/simple_host_process.cc |
| @@ -71,20 +71,26 @@ int main(int argc, char** argv) { |
| const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| base::AtExitManager exit_manager; |
| - |
| base::EnsureNSPRInit(); |
| + // Allocate a chromoting context and starts it. |
| + remoting::ChromotingHostContext context; |
| + context.Start(); |
| + |
| scoped_ptr<remoting::Capturer> capturer; |
| - scoped_ptr<remoting::EventExecutor> event_handler; |
| + scoped_ptr<remoting::protocol::InputStub> input_stub; |
| #if defined(OS_WIN) |
| capturer.reset(new remoting::CapturerGdi()); |
| - event_handler.reset(new remoting::EventExecutorWin(capturer.get())); |
| + input_stub.reset(new remoting::EventExecutorWin( |
| + context.capture_message_loop_proxy(), capturer.get())); |
| #elif defined(OS_LINUX) |
| capturer.reset(new remoting::CapturerLinux()); |
| - event_handler.reset(new remoting::EventExecutorLinux(capturer.get())); |
| + input_stub.reset(new remoting::EventExecutorLinux( |
| + context.capture_message_loop_proxy(), capturer.get())); |
| #elif defined(OS_MACOSX) |
| capturer.reset(new remoting::CapturerMac()); |
| - event_handler.reset(new remoting::EventExecutorMac(capturer.get())); |
| + input_stub.reset(new remoting::EventExecutorMac( |
| + context.capture_message_loop_proxy(), capturer.get())); |
| #endif |
| // Check the argument to see if we should use a fake capturer. |
| @@ -117,13 +123,10 @@ int main(int argc, char** argv) { |
| if (!config->Read()) { |
| LOG(ERROR) << "Failed to read configuration file " << config_path.value(); |
| + context.Stop(); |
|
awong
2010/11/12 01:40:10
Don't we want to do an explicit stop in the normal
Alpha Left Google
2010/11/12 22:56:40
Not sure what this means. But this error code path
awong
2010/11/12 23:29:04
Sorry...I just misread the code. Please ignore my
|
| return 1; |
| } |
| - // Allocate a chromoting context and starts it. |
| - remoting::ChromotingHostContext context; |
| - context.Start(); |
| - |
| FilePath module_path; |
| PathService::Get(base::DIR_MODULE, &module_path); |
| CHECK(media::InitializeMediaLibrary(module_path)) |
| @@ -134,7 +137,7 @@ int main(int argc, char** argv) { |
| new remoting::ChromotingHost(&context, |
| config, |
| capturer.release(), |
| - event_handler.release())); |
| + input_stub.release())); |
| // Let the chromoting host run until the shutdown task is executed. |
| MessageLoop message_loop(MessageLoop::TYPE_UI); |