summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_environment.h
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 01:39:01 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 01:39:01 +0000
commitea41e2bcaff5770690f7d7033fbf1079c44a770d (patch)
tree2cfa767836b56d39115fd0b49461d78c07f6397e /remoting/host/desktop_environment.h
parentad83ca24dd512449ba02910ac50431458be4b182 (diff)
downloadchromium_src-ea41e2bcaff5770690f7d7033fbf1079c44a770d.zip
chromium_src-ea41e2bcaff5770690f7d7033fbf1079c44a770d.tar.gz
chromium_src-ea41e2bcaff5770690f7d7033fbf1079c44a770d.tar.bz2
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
Diffstat (limited to 'remoting/host/desktop_environment.h')
-rw-r--r--remoting/host/desktop_environment.h20
1 files changed, 17 insertions, 3 deletions
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<DesktopEnvironment> continue_window_timer_;
+ scoped_refptr<UIThreadProxy> proxy_;
+
DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
};
} // namespace remoting
-DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DesktopEnvironment);
-
#endif // REMOTING_HOST_DESKTOP_ENVIRONMENT_H_