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

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

Issue 11316247: Use AutoThread in ChromotingHostContext & NPAPI plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromotingHostContext.StartAndStop test to run message loop. Created 8 years 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
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 a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 1060 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1061 gfx::GtkInitFromCommandLine(*cmd_line); 1061 gfx::GtkInitFromCommandLine(*cmd_line);
1062 #endif // TOOLKIT_GTK 1062 #endif // TOOLKIT_GTK
1063 1063
1064 // Enable support for SSL server sockets, which must be done while still 1064 // Enable support for SSL server sockets, which must be done while still
1065 // single-threaded. 1065 // single-threaded.
1066 net::EnableSSLServerSockets(); 1066 net::EnableSSLServerSockets();
1067 1067
1068 // Create the main message loop and start helper threads. 1068 // Create the main message loop and start helper threads.
1069 MessageLoop message_loop(MessageLoop::TYPE_UI); 1069 MessageLoop message_loop(MessageLoop::TYPE_UI);
1070 base::Closure quit_message_loop = base::Bind(&QuitMessageLoop, &message_loop); 1070 scoped_ptr<remoting::ChromotingHostContext> context =
1071 scoped_ptr<remoting::ChromotingHostContext> context( 1071 remoting::ChromotingHostContext::Create(
1072 new remoting::ChromotingHostContext(
1073 new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(), 1072 new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(),
1074 quit_message_loop))); 1073 MessageLoop::QuitClosure()));
1075 1074 if (context)
1076 if (!context->Start())
1077 return remoting::kInitializationFailed; 1075 return remoting::kInitializationFailed;
1078 1076
1079 // Create & start the HostProcess using these threads. 1077 // Create & start the HostProcess using these threads.
1080 // TODO(wez): The HostProcess holds a reference to itself until Shutdown(). 1078 // TODO(wez): The HostProcess holds a reference to itself until Shutdown().
1081 // Remove this hack as part of the multi-process refactoring. 1079 // Remove this hack as part of the multi-process refactoring.
1082 int exit_code = remoting::kSuccessExitCode; 1080 int exit_code = remoting::kSuccessExitCode;
1083 new remoting::HostProcess(context.Pass(), &exit_code); 1081 new remoting::HostProcess(context.Pass(), &exit_code);
1084 1082
1085 // Run the main (also UI) message loop until the host no longer needs it. 1083 // Run the main (also UI) message loop until the host no longer needs it.
1086 message_loop.Run(); 1084 message_loop.Run();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 user32.GetFunctionPointer("SetProcessDPIAware")); 1120 user32.GetFunctionPointer("SetProcessDPIAware"));
1123 set_process_dpi_aware(); 1121 set_process_dpi_aware();
1124 } 1122 }
1125 1123
1126 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting 1124 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
1127 // the command line from GetCommandLineW(), so we can safely pass NULL here. 1125 // the command line from GetCommandLineW(), so we can safely pass NULL here.
1128 return main(0, NULL); 1126 return main(0, NULL);
1129 } 1127 }
1130 1128
1131 #endif // defined(OS_WIN) 1129 #endif // defined(OS_WIN)
OLDNEW
« no previous file with comments | « remoting/host/plugin/host_script_object.cc ('k') | remoting/host/win/session_desktop_environment_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698