Chromium Code Reviews| Index: blimp/client/session/blimp_client_session.cc |
| diff --git a/blimp/client/session/blimp_client_session.cc b/blimp/client/session/blimp_client_session.cc |
| index 854c6270725b4ca3233651fe7fc63884a0087c10..8dcfd91828bffe3d550ee003c119d019b126cfaa 100644 |
| --- a/blimp/client/session/blimp_client_session.cc |
| +++ b/blimp/client/session/blimp_client_session.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/logging.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/sequenced_task_runner.h" |
| +#include "base/task_runner_util.h" |
| #include "base/threading/sequenced_task_runner_handle.h" |
| #include "base/threading/thread.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| @@ -37,6 +38,13 @@ |
| namespace blimp { |
| namespace client { |
| +namespace { |
| + |
| +void DropConnectionOnIOThread(ClientNetworkComponents* net_components) { |
| + net_components->GetBrowserConnectionHandler()->DropCurrentConnection(); |
| +} |
| + |
| +} // namespace |
| BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
| : io_thread_("BlimpIOThread"), |
| @@ -149,16 +157,17 @@ void BlimpClientSession::RegisterFeatures() { |
| settings_feature_->SetRecordWholeDocument(true); |
| } |
| +void BlimpClientSession::DropConnection() { |
| + io_thread_.task_runner()->PostTask( |
| + FROM_HERE, base::Bind(&DropConnectionOnIOThread, net_components_.get())); |
|
Wez
2016/09/17 01:56:31
How come we are able to Bind(..., net_components_.
Kevin M
2016/09/19 17:00:23
It's a function pointer, not a bound method pointe
Wez
2016/09/19 17:04:28
Interesting; I thought Bind would still balk at a
|
| +} |
| + |
| void BlimpClientSession::OnConnected() {} |
| void BlimpClientSession::OnDisconnected(int result) {} |
| void BlimpClientSession::OnImageDecodeError() { |
| - io_thread_.task_runner()->PostTask( |
| - FROM_HERE, |
| - base::Bind( |
| - &BrowserConnectionHandler::DropCurrentConnection, |
| - base::Unretained(net_components_->GetBrowserConnectionHandler()))); |
| + DropConnection(); |
| } |
| TabControlFeature* BlimpClientSession::GetTabControlFeature() const { |