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

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

Issue 1394803004: Don't use base::MessageLoop::{Quit,QuitClosure} in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 // network thread. base::GetLinuxDistro() caches the result. 1621 // network thread. base::GetLinuxDistro() caches the result.
1622 base::GetLinuxDistro(); 1622 base::GetLinuxDistro();
1623 #endif 1623 #endif
1624 1624
1625 // Enable support for SSL server sockets, which must be done while still 1625 // Enable support for SSL server sockets, which must be done while still
1626 // single-threaded. 1626 // single-threaded.
1627 net::EnableSSLServerSockets(); 1627 net::EnableSSLServerSockets();
1628 1628
1629 // Create the main message loop and start helper threads. 1629 // Create the main message loop and start helper threads.
1630 base::MessageLoopForUI message_loop; 1630 base::MessageLoopForUI message_loop;
1631 scoped_ptr<ChromotingHostContext> context = 1631 scoped_ptr<ChromotingHostContext> context = ChromotingHostContext::Create(
1632 ChromotingHostContext::Create(new AutoThreadTaskRunner( 1632 new AutoThreadTaskRunner(message_loop.task_runner(),
1633 message_loop.task_runner(), base::MessageLoop::QuitClosure())); 1633 base::MessageLoop::QuitWhenIdleClosure()));
1634 if (!context) 1634 if (!context)
1635 return kInitializationFailed; 1635 return kInitializationFailed;
1636 1636
1637 // NetworkChangeNotifier must be initialized after MessageLoop. 1637 // NetworkChangeNotifier must be initialized after MessageLoop.
1638 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier( 1638 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier(
1639 net::NetworkChangeNotifier::Create()); 1639 net::NetworkChangeNotifier::Create());
1640 1640
1641 // Create & start the HostProcess using these threads. 1641 // Create & start the HostProcess using these threads.
1642 // TODO(wez): The HostProcess holds a reference to itself until Shutdown(). 1642 // TODO(wez): The HostProcess holds a reference to itself until Shutdown().
1643 // Remove this hack as part of the multi-process refactoring. 1643 // Remove this hack as part of the multi-process refactoring.
1644 int exit_code = kSuccessExitCode; 1644 int exit_code = kSuccessExitCode;
1645 ShutdownWatchdog shutdown_watchdog( 1645 ShutdownWatchdog shutdown_watchdog(
1646 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); 1646 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds));
1647 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); 1647 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog);
1648 1648
1649 // Run the main (also UI) message loop until the host no longer needs it. 1649 // Run the main (also UI) message loop until the host no longer needs it.
1650 message_loop.Run(); 1650 message_loop.Run();
1651 1651
1652 return exit_code; 1652 return exit_code;
1653 } 1653 }
1654 1654
1655 } // namespace remoting 1655 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_status_logger_unittest.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698