From ea41e2bcaff5770690f7d7033fbf1079c44a770d Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Fri, 29 Jul 2011 01:39:01 +0000 Subject: Fix crashes when shutting down DesktopEnvironment BUG=90602,90108 TEST=Host plugin doesn't crash. Review URL: http://codereview.chromium.org/7514031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94614 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/desktop_environment.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'remoting/host/desktop_environment.h') diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h index 0f473e3..99fd33d 100644 --- a/remoting/host/desktop_environment.h +++ b/remoting/host/desktop_environment.h @@ -9,7 +9,6 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" -#include "base/threading/thread.h" #include "base/timer.h" namespace remoting { @@ -22,6 +21,7 @@ class Curtain; class DisconnectWindow; class EventExecutor; class LocalInputMonitor; +class UIThreadProxy; class DesktopEnvironment { public: @@ -37,6 +37,10 @@ class DesktopEnvironment { LocalInputMonitor* monitor); virtual ~DesktopEnvironment(); + // Shuts down the object and all its resources synchronously. Must + // be called on the UI thread. + void Shutdown(); + void set_host(ChromotingHost* host) { host_ = host; } Capturer* capturer() const { return capturer_.get(); } @@ -53,6 +57,10 @@ class DesktopEnvironment { void OnPause(bool pause); private: + void ProcessOnConnect(const std::string& username); + void ProcessOnLastDisconnect(); + void ProcessOnPause(bool pause); + void MonitorLocalInputs(bool enable); // Show or hide the Disconnect window on the UI thread. If |show| is false, @@ -98,13 +106,19 @@ class DesktopEnvironment { // Timer controlling the "continue session" dialog. The timer is started when // a connection is made or re-confirmed. On expiry, inputs to the host are // blocked and the dialog is shown. + // + // TODO(sergeyu): It is wrong that we use OneShotTimer on the UI + // thread of the plugin. UI thread runs MessageLoop that is compiled + // as part of chrome, but the timer compiled as part of the + // plugin. This will crash when plugin and chrome are compiled with + // different version of MessageLoop. See crbug.com/90785 . base::OneShotTimer continue_window_timer_; + scoped_refptr proxy_; + DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment); }; } // namespace remoting -DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DesktopEnvironment); - #endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_ -- cgit v1.1