| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "blimp/client/session/blimp_client_session.h" | 5 #include "blimp/client/session/blimp_client_session.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 void ClientNetworkComponents::HandleConnection( | 155 void ClientNetworkComponents::HandleConnection( |
| 156 std::unique_ptr<BlimpConnection> connection) { | 156 std::unique_ptr<BlimpConnection> connection) { |
| 157 VLOG(1) << "Connection established."; | 157 VLOG(1) << "Connection established."; |
| 158 connection->AddConnectionErrorObserver(this); | 158 connection->AddConnectionErrorObserver(this); |
| 159 network_observer_->OnConnected(); | 159 network_observer_->OnConnected(); |
| 160 connection_handler_->HandleConnection(std::move(connection)); | 160 connection_handler_->HandleConnection(std::move(connection)); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ClientNetworkComponents::OnConnectionError(int result) { | 163 void ClientNetworkComponents::OnConnectionError(int result) { |
| 164 VLOG(1) << "Connection error: " << net::ErrorToString(result); | 164 if (result >= 0) { |
| 165 VLOG(1) << "Disconnected with reason: " << result; |
| 166 } else { |
| 167 VLOG(1) << "Connection error: " << net::ErrorToString(result); |
| 168 } |
| 165 network_observer_->OnDisconnected(result); | 169 network_observer_->OnDisconnected(result); |
| 166 } | 170 } |
| 167 | 171 |
| 168 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) | 172 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
| 169 : io_thread_("BlimpIOThread"), | 173 : io_thread_("BlimpIOThread"), |
| 170 tab_control_feature_(new TabControlFeature), | 174 tab_control_feature_(new TabControlFeature), |
| 171 navigation_feature_(new NavigationFeature), | 175 navigation_feature_(new NavigationFeature), |
| 172 ime_feature_(new ImeFeature), | 176 ime_feature_(new ImeFeature), |
| 173 render_widget_feature_(new RenderWidgetFeature), | 177 render_widget_feature_(new RenderWidgetFeature), |
| 174 settings_feature_(new SettingsFeature), | 178 settings_feature_(new SettingsFeature), |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 return settings_feature_.get(); | 290 return settings_feature_.get(); |
| 287 } | 291 } |
| 288 | 292 |
| 289 BlimpConnectionStatistics* BlimpClientSession::GetBlimpConnectionStatistics() | 293 BlimpConnectionStatistics* BlimpClientSession::GetBlimpConnectionStatistics() |
| 290 const { | 294 const { |
| 291 return blimp_connection_statistics_; | 295 return blimp_connection_statistics_; |
| 292 } | 296 } |
| 293 | 297 |
| 294 } // namespace client | 298 } // namespace client |
| 295 } // namespace blimp | 299 } // namespace blimp |
| OLD | NEW |