| 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 7c5e12475486ff91d6aa991a64119c5a80706b85..dd12e5bb4f9c636cd4b116ff0d18fb986f33ee4e 100644
|
| --- a/blimp/client/session/blimp_client_session.cc
|
| +++ b/blimp/client/session/blimp_client_session.cc
|
| @@ -18,9 +18,12 @@
|
| #include "blimp/client/feature/render_widget_feature.h"
|
| #include "blimp/client/feature/settings_feature.h"
|
| #include "blimp/client/feature/tab_control_feature.h"
|
| +#include "blimp/common/blob_cache/in_memory_blob_cache.h"
|
| #include "blimp/net/blimp_connection.h"
|
| #include "blimp/net/blimp_message_processor.h"
|
| #include "blimp/net/blimp_message_thread_pipe.h"
|
| +#include "blimp/net/blob_channel/blob_channel_receiver.h"
|
| +#include "blimp/net/blob_channel/helium_blob_receiver_delegate.h"
|
| #include "blimp/net/browser_connection_handler.h"
|
| #include "blimp/net/client_connection_manager.h"
|
| #include "blimp/net/common.h"
|
| @@ -86,6 +89,8 @@ class ClientNetworkComponents : public ConnectionHandler,
|
|
|
| BrowserConnectionHandler* GetBrowserConnectionHandler();
|
|
|
| + void DropCurrentConnection();
|
| +
|
| private:
|
| // ConnectionHandler implementation.
|
| void HandleConnection(std::unique_ptr<BlimpConnection> connection) override;
|
| @@ -152,6 +157,10 @@ ClientNetworkComponents::GetBrowserConnectionHandler() {
|
| return connection_handler_.get();
|
| }
|
|
|
| +void ClientNetworkComponents::DropCurrentConnection() {
|
| + connection_handler_->DropCurrentConnection();
|
| +}
|
| +
|
| void ClientNetworkComponents::HandleConnection(
|
| std::unique_ptr<BlimpConnection> connection) {
|
| VLOG(1) << "Connection established.";
|
| @@ -189,8 +198,17 @@ BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint)
|
| assignment_source_.reset(new AssignmentSource(
|
| assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner()));
|
|
|
| + std::unique_ptr<HeliumBlobReceiverDelegate> blob_delegate(
|
| + new HeliumBlobReceiverDelegate);
|
| + blob_delegate_ = blob_delegate.get();
|
| + blob_receiver_ = BlobChannelReceiver::Create(
|
| + base::WrapUnique(new InMemoryBlobCache), std::move(blob_delegate));
|
| +
|
| RegisterFeatures();
|
|
|
| + blob_image_processor_.set_blob_receiver(blob_receiver_.get());
|
| + blob_image_processor_.set_error_delegate(this);
|
| +
|
| // Initialize must only be posted after the RegisterFeature calls have
|
| // completed.
|
| io_thread_.task_runner()->PostTask(
|
| @@ -251,6 +269,8 @@ void BlimpClientSession::RegisterFeatures() {
|
| settings_feature_->set_outgoing_message_processor(
|
| thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings,
|
| settings_feature_.get()));
|
| + thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel,
|
| + blob_delegate_);
|
|
|
| // Client will not send send any RenderWidget messages, so don't save the
|
| // outgoing BlimpMessageProcessor in the RenderWidgetFeature.
|
| @@ -270,6 +290,12 @@ void BlimpClientSession::OnConnected() {}
|
|
|
| void BlimpClientSession::OnDisconnected(int result) {}
|
|
|
| +void BlimpClientSession::OnImageDecodeError() {
|
| + io_thread_.task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&ClientNetworkComponents::DropCurrentConnection,
|
| + base::Unretained(net_components_.get())));
|
| +}
|
| +
|
| TabControlFeature* BlimpClientSession::GetTabControlFeature() const {
|
| return tab_control_feature_.get();
|
| }
|
|
|