| 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 760842abc72bb5cd32e63d9b1f4782aa071cb4d0..8e8d596ebf01e3381ee2b0820952e2ef811e8555 100644
|
| --- a/blimp/client/session/blimp_client_session.cc
|
| +++ b/blimp/client/session/blimp_client_session.cc
|
| @@ -73,7 +73,8 @@ class ClientNetworkComponents : public ConnectionHandler,
|
| public:
|
| // Can be created on any thread.
|
| explicit ClientNetworkComponents(
|
| - std::unique_ptr<NetworkEventObserver> observer);
|
| + std::unique_ptr<NetworkEventObserver> observer,
|
| + BlimpConnectionDetails* blimp_connection_details);
|
| ~ClientNetworkComponents() override;
|
|
|
| // Sets up network components.
|
| @@ -95,14 +96,17 @@ class ClientNetworkComponents : public ConnectionHandler,
|
| std::unique_ptr<BrowserConnectionHandler> connection_handler_;
|
| std::unique_ptr<ClientConnectionManager> connection_manager_;
|
| std::unique_ptr<NetworkEventObserver> network_observer_;
|
| + BlimpConnectionDetails* connection_details_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ClientNetworkComponents);
|
| };
|
|
|
| ClientNetworkComponents::ClientNetworkComponents(
|
| - std::unique_ptr<NetworkEventObserver> network_observer)
|
| + std::unique_ptr<NetworkEventObserver> network_observer,
|
| + BlimpConnectionDetails* details)
|
| : connection_handler_(new BrowserConnectionHandler),
|
| - network_observer_(std::move(network_observer)) {}
|
| + network_observer_(std::move(network_observer)),
|
| + connection_details_(details) {}
|
|
|
| ClientNetworkComponents::~ClientNetworkComponents() {}
|
|
|
| @@ -150,6 +154,7 @@ void ClientNetworkComponents::HandleConnection(
|
| VLOG(1) << "Connection established.";
|
| connection->AddConnectionErrorObserver(this);
|
| network_observer_->OnConnected();
|
| + connection->SetBlimpConnectionDetails(connection_details_);
|
| connection_handler_->HandleConnection(std::move(connection));
|
| }
|
|
|
| @@ -161,18 +166,22 @@ void ClientNetworkComponents::OnConnectionError(int result) {
|
| BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint)
|
| : io_thread_("BlimpIOThread"),
|
| tab_control_feature_(new TabControlFeature),
|
| - navigation_feature_(new NavigationFeature),
|
| ime_feature_(new ImeFeature),
|
| render_widget_feature_(new RenderWidgetFeature),
|
| settings_feature_(new SettingsFeature),
|
| weak_factory_(this) {
|
| - net_components_.reset(new ClientNetworkComponents(
|
| - base::WrapUnique(new CrossThreadNetworkEventObserver(
|
| - weak_factory_.GetWeakPtr(),
|
| - base::SequencedTaskRunnerHandle::Get()))));
|
| base::Thread::Options options;
|
| options.message_loop_type = base::MessageLoop::TYPE_IO;
|
| io_thread_.StartWithOptions(options);
|
| + blimp_connection_details_.reset(new BlimpConnectionDetails(
|
| + weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get(),
|
| + io_thread_.task_runner()));
|
| + navigation_feature_ =
|
| + base::WrapUnique(new NavigationFeature(blimp_connection_details_.get()));
|
| + net_components_.reset(new ClientNetworkComponents(
|
| + base::WrapUnique(new CrossThreadNetworkEventObserver(
|
| + weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get())),
|
| + blimp_connection_details_.get()));
|
|
|
| assignment_source_.reset(new AssignmentSource(
|
| assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner()));
|
| @@ -188,6 +197,8 @@ BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint)
|
|
|
| BlimpClientSession::~BlimpClientSession() {
|
| io_thread_.task_runner()->DeleteSoon(FROM_HERE, net_components_.release());
|
| + io_thread_.task_runner()->DeleteSoon(FROM_HERE,
|
| + blimp_connection_details_.release());
|
| }
|
|
|
| void BlimpClientSession::Connect(const std::string& client_auth_token) {
|
| @@ -251,6 +262,12 @@ void BlimpClientSession::RegisterFeatures() {
|
| ime_feature_.get()));
|
| }
|
|
|
| +void BlimpClientSession::EnableDebugInfo(bool enable) {
|
| + blimp_connection_details_->EnableDebugInfo(enable);
|
| +}
|
| +
|
| +void BlimpClientSession::UpdateDebugInfo(int received, int sent, int commits) {}
|
| +
|
| void BlimpClientSession::OnConnected() {}
|
|
|
| void BlimpClientSession::OnDisconnected(int result) {}
|
| @@ -275,5 +292,9 @@ SettingsFeature* BlimpClientSession::GetSettingsFeature() const {
|
| return settings_feature_.get();
|
| }
|
|
|
| +BlimpConnectionDetails* BlimpClientSession::GetBlimpConnectionDetails() const {
|
| + return blimp_connection_details_.get();
|
| +}
|
| +
|
| } // namespace client
|
| } // namespace blimp
|
|
|