| 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/navigation_feature.h" | 15 #include "blimp/client/feature/navigation_feature.h" | 
| 16 #include "blimp/client/feature/render_widget_feature.h" | 16 #include "blimp/client/feature/render_widget_feature.h" | 
| 17 #include "blimp/client/feature/tab_control_feature.h" | 17 #include "blimp/client/feature/tab_control_feature.h" | 
|  | 18 #include "blimp/client/feature/web_input_feature.h" | 
| 18 #include "blimp/net/blimp_message_processor.h" | 19 #include "blimp/net/blimp_message_processor.h" | 
| 19 #include "blimp/net/blimp_message_thread_pipe.h" | 20 #include "blimp/net/blimp_message_thread_pipe.h" | 
| 20 #include "blimp/net/browser_connection_handler.h" | 21 #include "blimp/net/browser_connection_handler.h" | 
| 21 #include "blimp/net/client_connection_manager.h" | 22 #include "blimp/net/client_connection_manager.h" | 
| 22 #include "blimp/net/common.h" | 23 #include "blimp/net/common.h" | 
| 23 #include "blimp/net/null_blimp_message_processor.h" | 24 #include "blimp/net/null_blimp_message_processor.h" | 
| 24 #include "blimp/net/ssl_client_transport.h" | 25 #include "blimp/net/ssl_client_transport.h" | 
| 25 #include "blimp/net/tcp_client_transport.h" | 26 #include "blimp/net/tcp_client_transport.h" | 
| 26 #include "blimp/net/thread_pipe_manager.h" | 27 #include "blimp/net/thread_pipe_manager.h" | 
| 27 #include "net/base/address_list.h" | 28 #include "net/base/address_list.h" | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 91 | 92 | 
| 92 BrowserConnectionHandler* | 93 BrowserConnectionHandler* | 
| 93 ClientNetworkComponents::GetBrowserConnectionHandler() { | 94 ClientNetworkComponents::GetBrowserConnectionHandler() { | 
| 94   return connection_handler_.get(); | 95   return connection_handler_.get(); | 
| 95 } | 96 } | 
| 96 | 97 | 
| 97 BlimpClientSession::BlimpClientSession() | 98 BlimpClientSession::BlimpClientSession() | 
| 98     : io_thread_("BlimpIOThread"), | 99     : io_thread_("BlimpIOThread"), | 
| 99       tab_control_feature_(new TabControlFeature), | 100       tab_control_feature_(new TabControlFeature), | 
| 100       navigation_feature_(new NavigationFeature), | 101       navigation_feature_(new NavigationFeature), | 
|  | 102       web_input_feature_(new WebInputFeature), | 
| 101       render_widget_feature_(new RenderWidgetFeature), | 103       render_widget_feature_(new RenderWidgetFeature), | 
| 102       net_components_(new ClientNetworkComponents), | 104       net_components_(new ClientNetworkComponents), | 
| 103       weak_factory_(this) { | 105       weak_factory_(this) { | 
| 104   base::Thread::Options options; | 106   base::Thread::Options options; | 
| 105   options.message_loop_type = base::MessageLoop::TYPE_IO; | 107   options.message_loop_type = base::MessageLoop::TYPE_IO; | 
| 106   io_thread_.StartWithOptions(options); | 108   io_thread_.StartWithOptions(options); | 
| 107 | 109 | 
| 108   assignment_source_.reset( | 110   assignment_source_.reset( | 
| 109       new AssignmentSource(io_thread_.task_runner(), io_thread_.task_runner())); | 111       new AssignmentSource(io_thread_.task_runner(), io_thread_.task_runner())); | 
| 110 | 112 | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 161       thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, | 163       thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, | 
| 162                                             render_widget_feature_.get())); | 164                                             render_widget_feature_.get())); | 
| 163   render_widget_feature_->set_outgoing_compositor_message_processor( | 165   render_widget_feature_->set_outgoing_compositor_message_processor( | 
| 164       thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, | 166       thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, | 
| 165                                             render_widget_feature_.get())); | 167                                             render_widget_feature_.get())); | 
| 166 | 168 | 
| 167   // Client will not send send any RenderWidget messages, so don't save the | 169   // Client will not send send any RenderWidget messages, so don't save the | 
| 168   // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 170   // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 
| 169   thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, | 171   thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, | 
| 170                                         render_widget_feature_.get()); | 172                                         render_widget_feature_.get()); | 
|  | 173 | 
|  | 174   web_input_feature_->set_outgoing_message_processor( | 
|  | 175       thread_pipe_manager_->RegisterFeature(BlimpMessage::IME, | 
|  | 176                                             web_input_feature_.get())); | 
| 171 } | 177 } | 
| 172 | 178 | 
| 173 TabControlFeature* BlimpClientSession::GetTabControlFeature() const { | 179 TabControlFeature* BlimpClientSession::GetTabControlFeature() const { | 
| 174   return tab_control_feature_.get(); | 180   return tab_control_feature_.get(); | 
| 175 } | 181 } | 
| 176 | 182 | 
| 177 NavigationFeature* BlimpClientSession::GetNavigationFeature() const { | 183 NavigationFeature* BlimpClientSession::GetNavigationFeature() const { | 
| 178   return navigation_feature_.get(); | 184   return navigation_feature_.get(); | 
| 179 } | 185 } | 
| 180 | 186 | 
|  | 187 WebInputFeature* BlimpClientSession::GetWebInputFeature() const { | 
|  | 188   return web_input_feature_.get(); | 
|  | 189 } | 
|  | 190 | 
| 181 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 191 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 
| 182   return render_widget_feature_.get(); | 192   return render_widget_feature_.get(); | 
| 183 } | 193 } | 
| 184 | 194 | 
| 185 }  // namespace client | 195 }  // namespace client | 
| 186 }  // namespace blimp | 196 }  // namespace blimp | 
| OLD | NEW | 
|---|