| 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/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" | 
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" | 
| 12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" | 
| 13 #include "base/threading/sequenced_task_runner_handle.h" | 13 #include "base/threading/sequenced_task_runner_handle.h" | 
| 14 #include "blimp/client/app/blimp_client_switches.h" | 14 #include "blimp/client/app/blimp_client_switches.h" | 
|  | 15 #include "blimp/client/feature/ime_feature.h" | 
| 15 #include "blimp/client/feature/navigation_feature.h" | 16 #include "blimp/client/feature/navigation_feature.h" | 
| 16 #include "blimp/client/feature/render_widget_feature.h" | 17 #include "blimp/client/feature/render_widget_feature.h" | 
| 17 #include "blimp/client/feature/tab_control_feature.h" | 18 #include "blimp/client/feature/tab_control_feature.h" | 
| 18 #include "blimp/net/blimp_connection.h" | 19 #include "blimp/net/blimp_connection.h" | 
| 19 #include "blimp/net/blimp_message_processor.h" | 20 #include "blimp/net/blimp_message_processor.h" | 
| 20 #include "blimp/net/blimp_message_thread_pipe.h" | 21 #include "blimp/net/blimp_message_thread_pipe.h" | 
| 21 #include "blimp/net/browser_connection_handler.h" | 22 #include "blimp/net/browser_connection_handler.h" | 
| 22 #include "blimp/net/client_connection_manager.h" | 23 #include "blimp/net/client_connection_manager.h" | 
| 23 #include "blimp/net/common.h" | 24 #include "blimp/net/common.h" | 
| 24 #include "blimp/net/connection_handler.h" | 25 #include "blimp/net/connection_handler.h" | 
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 142 } | 143 } | 
| 143 | 144 | 
| 144 void ClientNetworkComponents::OnConnectionError(int result) { | 145 void ClientNetworkComponents::OnConnectionError(int result) { | 
| 145   network_observer_->OnDisconnected(result); | 146   network_observer_->OnDisconnected(result); | 
| 146 } | 147 } | 
| 147 | 148 | 
| 148 BlimpClientSession::BlimpClientSession() | 149 BlimpClientSession::BlimpClientSession() | 
| 149     : io_thread_("BlimpIOThread"), | 150     : io_thread_("BlimpIOThread"), | 
| 150       tab_control_feature_(new TabControlFeature), | 151       tab_control_feature_(new TabControlFeature), | 
| 151       navigation_feature_(new NavigationFeature), | 152       navigation_feature_(new NavigationFeature), | 
|  | 153       ime_feature_(new ImeFeature), | 
| 152       render_widget_feature_(new RenderWidgetFeature), | 154       render_widget_feature_(new RenderWidgetFeature), | 
| 153       weak_factory_(this) { | 155       weak_factory_(this) { | 
| 154   net_components_.reset(new ClientNetworkComponents( | 156   net_components_.reset(new ClientNetworkComponents( | 
| 155       make_scoped_ptr(new CrossThreadNetworkEventObserver( | 157       make_scoped_ptr(new CrossThreadNetworkEventObserver( | 
| 156           weak_factory_.GetWeakPtr(), | 158           weak_factory_.GetWeakPtr(), | 
| 157           base::SequencedTaskRunnerHandle::Get())))); | 159           base::SequencedTaskRunnerHandle::Get())))); | 
| 158   base::Thread::Options options; | 160   base::Thread::Options options; | 
| 159   options.message_loop_type = base::MessageLoop::TYPE_IO; | 161   options.message_loop_type = base::MessageLoop::TYPE_IO; | 
| 160   io_thread_.StartWithOptions(options); | 162   io_thread_.StartWithOptions(options); | 
| 161 | 163 | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 215       thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, | 217       thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, | 
| 216                                             render_widget_feature_.get())); | 218                                             render_widget_feature_.get())); | 
| 217   render_widget_feature_->set_outgoing_compositor_message_processor( | 219   render_widget_feature_->set_outgoing_compositor_message_processor( | 
| 218       thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, | 220       thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, | 
| 219                                             render_widget_feature_.get())); | 221                                             render_widget_feature_.get())); | 
| 220 | 222 | 
| 221   // Client will not send send any RenderWidget messages, so don't save the | 223   // Client will not send send any RenderWidget messages, so don't save the | 
| 222   // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 224   // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 
| 223   thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, | 225   thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, | 
| 224                                         render_widget_feature_.get()); | 226                                         render_widget_feature_.get()); | 
|  | 227 | 
|  | 228   ime_feature_->set_outgoing_message_processor( | 
|  | 229       thread_pipe_manager_->RegisterFeature(BlimpMessage::IME, | 
|  | 230                                             ime_feature_.get())); | 
| 225 } | 231 } | 
| 226 | 232 | 
| 227 void BlimpClientSession::OnConnected() {} | 233 void BlimpClientSession::OnConnected() {} | 
| 228 | 234 | 
| 229 void BlimpClientSession::OnDisconnected(int result) {} | 235 void BlimpClientSession::OnDisconnected(int result) {} | 
| 230 | 236 | 
| 231 TabControlFeature* BlimpClientSession::GetTabControlFeature() const { | 237 TabControlFeature* BlimpClientSession::GetTabControlFeature() const { | 
| 232   return tab_control_feature_.get(); | 238   return tab_control_feature_.get(); | 
| 233 } | 239 } | 
| 234 | 240 | 
| 235 NavigationFeature* BlimpClientSession::GetNavigationFeature() const { | 241 NavigationFeature* BlimpClientSession::GetNavigationFeature() const { | 
| 236   return navigation_feature_.get(); | 242   return navigation_feature_.get(); | 
| 237 } | 243 } | 
| 238 | 244 | 
|  | 245 ImeFeature* BlimpClientSession::GetImeFeature() const { | 
|  | 246   return ime_feature_.get(); | 
|  | 247 } | 
|  | 248 | 
| 239 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 249 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 
| 240   return render_widget_feature_.get(); | 250   return render_widget_feature_.get(); | 
| 241 } | 251 } | 
| 242 | 252 | 
| 243 }  // namespace client | 253 }  // namespace client | 
| 244 }  // namespace blimp | 254 }  // namespace blimp | 
| OLD | NEW | 
|---|