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 6dbedcffcb8394b4ba2ebac082568d39d69d7c22..40c3713f1784adcf5684ecb669786c8b1f5d4aca 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); |
|
Kevin M
2016/05/10 23:54:24
This is racy. |blimp_connection_details| can be de
shaktisahu
2016/05/16 05:41:38
Okay. I have redesigned now. |blimp_connection_det
|
| ~ClientNetworkComponents() override; |
| // Sets up network components. |
| @@ -96,13 +97,17 @@ class ClientNetworkComponents : public ConnectionHandler, |
| 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 +155,7 @@ void ClientNetworkComponents::HandleConnection( |
| VLOG(1) << "Connection established."; |
| connection->AddConnectionErrorObserver(this); |
| network_observer_->OnConnected(); |
| + connection->SetBlimpConnectionDetails(connection_details_); |
| connection_handler_->HandleConnection(std::move(connection)); |
| } |
| @@ -160,16 +166,19 @@ void ClientNetworkComponents::OnConnectionError(int result) { |
| BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
| : io_thread_("BlimpIOThread"), |
| + blimp_connection_details_(new BlimpConnectionDetails(this)), |
| tab_control_feature_(new TabControlFeature), |
| - navigation_feature_(new NavigationFeature), |
| + navigation_feature_( |
| + new NavigationFeature(blimp_connection_details_.get())), |
| 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())))); |
| + weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get())), |
| + blimp_connection_details_.get())); |
| + |
| base::Thread::Options options; |
| options.message_loop_type = base::MessageLoop::TYPE_IO; |
| io_thread_.StartWithOptions(options); |
| @@ -251,6 +260,10 @@ void BlimpClientSession::RegisterFeatures() { |
| ime_feature_.get())); |
| } |
| +void BlimpClientSession::OnPacketReceived(int bytes) {} |
|
Kevin M
2016/05/10 23:54:24
nit: the name says OnPacketReceived, but the param
shaktisahu
2016/05/16 05:41:38
Method dropped. Now I have only one method called
|
| + |
| +void BlimpClientSession::OnPacketSent(int bytes) {} |
| + |
| void BlimpClientSession::OnConnected() {} |
| void BlimpClientSession::OnDisconnected(int result) {} |