summaryrefslogtreecommitdiffstats
path: root/remoting/client
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 23:10:25 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 23:10:25 +0000
commit788504f27317338b03c0e62498b781c3c193db3e (patch)
treeeac7b6031bccea34be73d7a0b42dd49f60873a26 /remoting/client
parentb602628bb20f7feada7cc7ff5112f55a48a4d898 (diff)
downloadchromium_src-788504f27317338b03c0e62498b781c3c193db3e.zip
chromium_src-788504f27317338b03c0e62498b781c3c193db3e.tar.gz
chromium_src-788504f27317338b03c0e62498b781c3c193db3e.tar.bz2
[Chromoting] Allow tasks to be posted to the plugin thread while a plugin instance is being shutdown.
This CL reliminates a restriction on posting tasks to the plugin thread making asynchronous shutdown logic more uniform and as result - simpler. The CL affects both the client and host plugins. BUG=150783 Review URL: https://chromiumcodereview.appspot.com/10998002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r--remoting/client/plugin/chromoting_instance.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 9038b4f..db90e9a 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -189,17 +189,17 @@ ChromotingInstance::~ChromotingInstance() {
view_.reset();
if (client_.get()) {
- base::WaitableEvent done_event(true, false);
- client_->Stop(base::Bind(&base::WaitableEvent::Signal,
- base::Unretained(&done_event)));
- done_event.Wait();
+ client_->Stop(base::Bind(&PluginThreadTaskRunner::Quit,
+ plugin_task_runner_));
+ } else {
+ plugin_task_runner_->Quit();
}
+ // Ensure that nothing touches the plugin thread delegate after this point.
+ plugin_task_runner_->DetachAndRunShutdownLoop();
+
// Stopping the context shuts down all chromoting threads.
context_.Stop();
-
- // Ensure that nothing touches the plugin thread delegate after this point.
- plugin_task_runner_->Detach();
}
bool ChromotingInstance::Init(uint32_t argc,