diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-19 23:33:01 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-19 23:33:01 +0000 |
commit | d5f422cb7adb04c935c6407a150716d15919c012 (patch) | |
tree | 3523107e61308692e4ed3554d628c29504d8b7cf /remoting/host/plugin/host_script_object.cc | |
parent | 17aacb435afb175d30bf77010b5bdd4243ad5531 (diff) | |
download | chromium_src-d5f422cb7adb04c935c6407a150716d15919c012.zip chromium_src-d5f422cb7adb04c935c6407a150716d15919c012.tar.gz chromium_src-d5f422cb7adb04c935c6407a150716d15919c012.tar.bz2 |
Move PluginThreadTaskRunner to HostNPPlugin.
This provides the correct separation of plugin thread and script object lifetimes, simplifying the script object implementation.
BUG=156257
Review URL: https://chromiumcodereview.appspot.com/11189071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/plugin/host_script_object.cc')
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index b1c71cf..7b82603 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -659,15 +659,10 @@ void HostNPScriptObject::It2MeImpl::OnReceivedSupportID( HostNPScriptObject::HostNPScriptObject( NPP plugin, NPObject* parent, - PluginThreadTaskRunner::Delegate* plugin_thread_delegate) + scoped_refptr<AutoThreadTaskRunner> plugin_task_runner) : plugin_(plugin), parent_(parent), - plugin_task_runner_( - new PluginThreadTaskRunner(plugin_thread_delegate)), - auto_plugin_task_runner_( - new AutoThreadTaskRunner(plugin_task_runner_, - base::Bind(&PluginThreadTaskRunner::Quit, - plugin_task_runner_))), + plugin_task_runner_(plugin_task_runner), am_currently_logging_(false), state_(kDisconnected), daemon_controller_(DaemonController::Create()), @@ -690,13 +685,6 @@ HostNPScriptObject::~HostNPScriptObject() { it2me_impl_ = NULL; } - // Release the AutoThreadTaskRunner so the plugin thread can quit. - auto_plugin_task_runner_ = NULL; - - // Stop the message loop and run the remaining tasks. The loop will exit - // once the wrapping AutoThreadTaskRunner is destroyed. - plugin_task_runner_->DetachAndRunShutdownLoop(); - // Stop the worker thread. worker_thread_.Stop(); } @@ -968,7 +956,7 @@ bool HostNPScriptObject::Connect(const NPVariant* args, // Create threads for the Chromoting host & desktop environment to use. scoped_ptr<ChromotingHostContext> host_context( - new ChromotingHostContext(auto_plugin_task_runner_)); + new ChromotingHostContext(plugin_task_runner_)); if (!host_context->Start()) { SetException("connect: failed to start threads"); return false; @@ -976,7 +964,7 @@ bool HostNPScriptObject::Connect(const NPVariant* args, // Create the It2Me host implementation and start connecting. it2me_impl_ = new It2MeImpl( - host_context.Pass(), auto_plugin_task_runner_, weak_ptr_, ui_strings_); + host_context.Pass(), plugin_task_runner_, weak_ptr_, ui_strings_); it2me_impl_->Connect(uid, auth_token, auth_service); return true; |