diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-11 01:27:23 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-11 01:27:23 +0000 |
commit | a46bcef82b29d30836a0f26226e3d4aca4fa9612 (patch) | |
tree | 297ff3b78e05b2fb83971d3dee51e0d12ebcf181 /remoting/host/screen_recorder_unittest.cc | |
parent | e7cd8dc6e9199cade000dc48da230f9ada0ccf28 (diff) | |
download | chromium_src-a46bcef82b29d30836a0f26226e3d4aca4fa9612.zip chromium_src-a46bcef82b29d30836a0f26226e3d4aca4fa9612.tar.gz chromium_src-a46bcef82b29d30836a0f26226e3d4aca4fa9612.tar.bz2 |
Access ChromotingHost::clients_ only on network thread.
Previously ChromotingHost was doing some work on the main thread and
some on the network thread. |clients_| and some other members were
accessed without lock on both of these threads. Moved most of the
ChromotingHost activity to the network thread to avoid possible
race conditions.
BUG=96325
TEST=Chromoting works
Review URL: http://codereview.chromium.org/8495024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/screen_recorder_unittest.cc')
-rw-r--r-- | remoting/host/screen_recorder_unittest.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/remoting/host/screen_recorder_unittest.cc b/remoting/host/screen_recorder_unittest.cc index 9540997..86608ba 100644 --- a/remoting/host/screen_recorder_unittest.cc +++ b/remoting/host/screen_recorder_unittest.cc @@ -87,7 +87,16 @@ class ScreenRecorderTest : public testing::Test { &capturer_, encoder_); } + virtual void TearDown() OVERRIDE { + record_ = NULL; + connection_ = NULL; + // Run message loop before destroying because protocol::Session is + // destroyed asynchronously. + message_loop_.RunAllPending(); + } + protected: + MessageLoop message_loop_; scoped_refptr<ScreenRecorder> record_; MockConnectionToClientEventHandler handler_; @@ -99,7 +108,7 @@ class ScreenRecorderTest : public testing::Test { // The following mock objects are owned by ScreenRecorder. MockCapturer capturer_; MockEncoder* encoder_; - MessageLoop message_loop_; + private: DISALLOW_COPY_AND_ASSIGN(ScreenRecorderTest); }; |