| 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/app/session/blimp_client_session.h" | 5 #include "blimp/client/app/session/blimp_client_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
| 16 #include "base/task_runner_util.h" | 16 #include "base/task_runner_util.h" |
| 17 #include "base/threading/sequenced_task_runner_handle.h" | 17 #include "base/threading/sequenced_task_runner_handle.h" |
| 18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "blimp/client/core/contents/ime_feature.h" | 20 #include "blimp/client/core/contents/ime_feature.h" |
| 21 #include "blimp/client/core/contents/navigation_feature.h" | 21 #include "blimp/client/core/contents/navigation_feature.h" |
| 22 #include "blimp/client/core/contents/tab_control_feature.h" | 22 #include "blimp/client/core/contents/tab_control_feature.h" |
| 23 #include "blimp/client/core/geolocation/geolocation_feature.h" | 23 #include "blimp/client/core/geolocation/geolocation_feature.h" |
| 24 #include "blimp/client/core/render_widget/render_widget_feature.h" | 24 #include "blimp/client/core/render_widget/render_widget_feature.h" |
| 25 #include "blimp/client/core/session/client_network_components.h" | 25 #include "blimp/client/core/session/client_network_components.h" |
| 26 #include "blimp/client/core/session/cross_thread_network_event_observer.h" | 26 #include "blimp/client/core/session/cross_thread_network_event_observer.h" |
| 27 #include "blimp/client/core/settings/settings_feature.h" | |
| 28 #include "blimp/client/core/switches/blimp_client_switches.h" | 27 #include "blimp/client/core/switches/blimp_client_switches.h" |
| 29 #include "blimp/common/blob_cache/in_memory_blob_cache.h" | 28 #include "blimp/common/blob_cache/in_memory_blob_cache.h" |
| 30 #include "blimp/net/blimp_message_thread_pipe.h" | 29 #include "blimp/net/blimp_message_thread_pipe.h" |
| 31 #include "blimp/net/blimp_stats.h" | 30 #include "blimp/net/blimp_stats.h" |
| 32 #include "blimp/net/blob_channel/blob_channel_receiver.h" | 31 #include "blimp/net/blob_channel/blob_channel_receiver.h" |
| 33 #include "blimp/net/blob_channel/helium_blob_receiver_delegate.h" | 32 #include "blimp/net/blob_channel/helium_blob_receiver_delegate.h" |
| 34 #include "blimp/net/thread_pipe_manager.h" | 33 #include "blimp/net/thread_pipe_manager.h" |
| 35 #include "device/geolocation/geolocation_delegate.h" | 34 #include "device/geolocation/geolocation_delegate.h" |
| 36 #include "device/geolocation/location_arbitrator.h" | 35 #include "device/geolocation/location_arbitrator.h" |
| 37 #include "url/gurl.h" | 36 #include "url/gurl.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 | 47 |
| 49 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) | 48 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
| 50 : io_thread_("BlimpIOThread"), | 49 : io_thread_("BlimpIOThread"), |
| 51 geolocation_feature_(base::MakeUnique<GeolocationFeature>( | 50 geolocation_feature_(base::MakeUnique<GeolocationFeature>( |
| 52 base::MakeUnique<device::LocationArbitrator>( | 51 base::MakeUnique<device::LocationArbitrator>( |
| 53 base::MakeUnique<device::GeolocationDelegate>()))), | 52 base::MakeUnique<device::GeolocationDelegate>()))), |
| 54 tab_control_feature_(new TabControlFeature), | 53 tab_control_feature_(new TabControlFeature), |
| 55 navigation_feature_(new NavigationFeature), | 54 navigation_feature_(new NavigationFeature), |
| 56 ime_feature_(new ImeFeature), | 55 ime_feature_(new ImeFeature), |
| 57 render_widget_feature_(new RenderWidgetFeature), | 56 render_widget_feature_(new RenderWidgetFeature), |
| 58 settings_feature_(new SettingsFeature(nullptr)), | |
| 59 weak_factory_(this) { | 57 weak_factory_(this) { |
| 60 base::Thread::Options options; | 58 base::Thread::Options options; |
| 61 options.message_loop_type = base::MessageLoop::TYPE_IO; | 59 options.message_loop_type = base::MessageLoop::TYPE_IO; |
| 62 io_thread_.StartWithOptions(options); | 60 io_thread_.StartWithOptions(options); |
| 63 net_components_.reset(new ClientNetworkComponents( | 61 net_components_.reset(new ClientNetworkComponents( |
| 64 base::MakeUnique<CrossThreadNetworkEventObserver>( | 62 base::MakeUnique<CrossThreadNetworkEventObserver>( |
| 65 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); | 63 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); |
| 66 | 64 |
| 67 assignment_source_.reset(new AssignmentSource( | 65 assignment_source_.reset(new AssignmentSource( |
| 68 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); | 66 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 tab_control_feature_.get())); | 128 tab_control_feature_.get())); |
| 131 navigation_feature_->set_outgoing_message_processor( | 129 navigation_feature_->set_outgoing_message_processor( |
| 132 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, | 130 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, |
| 133 navigation_feature_.get())); | 131 navigation_feature_.get())); |
| 134 render_widget_feature_->set_outgoing_input_message_processor( | 132 render_widget_feature_->set_outgoing_input_message_processor( |
| 135 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, | 133 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, |
| 136 render_widget_feature_.get())); | 134 render_widget_feature_.get())); |
| 137 render_widget_feature_->set_outgoing_compositor_message_processor( | 135 render_widget_feature_->set_outgoing_compositor_message_processor( |
| 138 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, | 136 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, |
| 139 render_widget_feature_.get())); | 137 render_widget_feature_.get())); |
| 140 settings_feature_->set_outgoing_message_processor( | |
| 141 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings, | |
| 142 settings_feature_.get())); | |
| 143 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, | 138 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, |
| 144 blob_delegate_); | 139 blob_delegate_); |
| 145 | 140 |
| 146 // Client will not send send any RenderWidget messages, so don't save the | 141 // Client will not send send any RenderWidget messages, so don't save the |
| 147 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 142 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. |
| 148 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, | 143 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, |
| 149 render_widget_feature_.get()); | 144 render_widget_feature_.get()); |
| 150 | 145 |
| 151 ime_feature_->set_outgoing_message_processor( | 146 ime_feature_->set_outgoing_message_processor( |
| 152 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, | 147 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 175 } | 170 } |
| 176 | 171 |
| 177 ImeFeature* BlimpClientSession::GetImeFeature() const { | 172 ImeFeature* BlimpClientSession::GetImeFeature() const { |
| 178 return ime_feature_.get(); | 173 return ime_feature_.get(); |
| 179 } | 174 } |
| 180 | 175 |
| 181 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 176 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { |
| 182 return render_widget_feature_.get(); | 177 return render_widget_feature_.get(); |
| 183 } | 178 } |
| 184 | 179 |
| 185 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { | |
| 186 return settings_feature_.get(); | |
| 187 } | |
| 188 | |
| 189 } // namespace client | 180 } // namespace client |
| 190 } // namespace blimp | 181 } // namespace blimp |
| OLD | NEW |