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 <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/threading/sequenced_task_runner_handle.h" | 16 #include "base/threading/sequenced_task_runner_handle.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "blimp/client/core/blimp_client_switches.h" | 19 #include "blimp/client/core/blimp_client_switches.h" |
20 #include "blimp/client/core/contents/navigation_feature.h" | 20 #include "blimp/client/core/contents/navigation_feature.h" |
21 #include "blimp/client/core/contents/tab_control_feature.h" | 21 #include "blimp/client/core/contents/tab_control_feature.h" |
22 #include "blimp/client/core/geolocation/blimp_location_provider.h" | |
23 #include "blimp/client/core/geolocation/geolocation_feature.h" | |
22 #include "blimp/client/core/session/client_network_components.h" | 24 #include "blimp/client/core/session/client_network_components.h" |
23 #include "blimp/client/core/session/cross_thread_network_event_observer.h" | 25 #include "blimp/client/core/session/cross_thread_network_event_observer.h" |
24 #include "blimp/client/feature/ime_feature.h" | 26 #include "blimp/client/feature/ime_feature.h" |
25 #include "blimp/client/feature/render_widget_feature.h" | 27 #include "blimp/client/feature/render_widget_feature.h" |
26 #include "blimp/client/feature/settings_feature.h" | 28 #include "blimp/client/feature/settings_feature.h" |
27 #include "blimp/common/blob_cache/in_memory_blob_cache.h" | 29 #include "blimp/common/blob_cache/in_memory_blob_cache.h" |
28 #include "blimp/net/blimp_message_thread_pipe.h" | 30 #include "blimp/net/blimp_message_thread_pipe.h" |
29 #include "blimp/net/blimp_stats.h" | 31 #include "blimp/net/blimp_stats.h" |
30 #include "blimp/net/blob_channel/blob_channel_receiver.h" | 32 #include "blimp/net/blob_channel/blob_channel_receiver.h" |
31 #include "blimp/net/blob_channel/helium_blob_receiver_delegate.h" | 33 #include "blimp/net/blob_channel/helium_blob_receiver_delegate.h" |
32 #include "blimp/net/thread_pipe_manager.h" | 34 #include "blimp/net/thread_pipe_manager.h" |
33 #include "url/gurl.h" | 35 #include "url/gurl.h" |
34 | 36 |
35 namespace blimp { | 37 namespace blimp { |
36 namespace client { | 38 namespace client { |
37 | 39 |
38 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) | 40 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
39 : io_thread_("BlimpIOThread"), | 41 : io_thread_("BlimpIOThread"), |
42 geolocation_feature_( | |
Kevin M
2016/08/19 17:51:37
This is also contained in the ClientContext? O_o
CJ
2016/08/19 20:44:01
Acknowledged.
| |
43 new GeolocationFeature(base::MakeUnique<BlimpLocationProvider>())), | |
40 tab_control_feature_(new TabControlFeature), | 44 tab_control_feature_(new TabControlFeature), |
41 navigation_feature_(new NavigationFeature), | 45 navigation_feature_(new NavigationFeature), |
42 ime_feature_(new ImeFeature), | 46 ime_feature_(new ImeFeature), |
43 render_widget_feature_(new RenderWidgetFeature), | 47 render_widget_feature_(new RenderWidgetFeature), |
44 settings_feature_(new SettingsFeature), | 48 settings_feature_(new SettingsFeature), |
45 weak_factory_(this) { | 49 weak_factory_(this) { |
46 base::Thread::Options options; | 50 base::Thread::Options options; |
47 options.message_loop_type = base::MessageLoop::TYPE_IO; | 51 options.message_loop_type = base::MessageLoop::TYPE_IO; |
48 io_thread_.StartWithOptions(options); | 52 io_thread_.StartWithOptions(options); |
49 net_components_.reset(new ClientNetworkComponents( | 53 net_components_.reset(new ClientNetworkComponents( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, | 124 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, |
121 render_widget_feature_.get())); | 125 render_widget_feature_.get())); |
122 render_widget_feature_->set_outgoing_compositor_message_processor( | 126 render_widget_feature_->set_outgoing_compositor_message_processor( |
123 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, | 127 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, |
124 render_widget_feature_.get())); | 128 render_widget_feature_.get())); |
125 settings_feature_->set_outgoing_message_processor( | 129 settings_feature_->set_outgoing_message_processor( |
126 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings, | 130 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings, |
127 settings_feature_.get())); | 131 settings_feature_.get())); |
128 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, | 132 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, |
129 blob_delegate_); | 133 blob_delegate_); |
134 geolocation_feature_->set_outgoing_message_processor( | |
135 thread_pipe_manager_->RegisterFeature(BlimpMessage::kGeolocation, | |
136 geolocation_feature_.get())); | |
130 | 137 |
131 // Client will not send send any RenderWidget messages, so don't save the | 138 // Client will not send send any RenderWidget messages, so don't save the |
132 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 139 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. |
133 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, | 140 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, |
134 render_widget_feature_.get()); | 141 render_widget_feature_.get()); |
135 | 142 |
136 ime_feature_->set_outgoing_message_processor( | 143 ime_feature_->set_outgoing_message_processor( |
137 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, | 144 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, |
138 ime_feature_.get())); | 145 ime_feature_.get())); |
139 | 146 |
(...skipping 29 matching lines...) Expand all Loading... | |
169 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 176 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { |
170 return render_widget_feature_.get(); | 177 return render_widget_feature_.get(); |
171 } | 178 } |
172 | 179 |
173 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { | 180 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { |
174 return settings_feature_.get(); | 181 return settings_feature_.get(); |
175 } | 182 } |
176 | 183 |
177 } // namespace client | 184 } // namespace client |
178 } // namespace blimp | 185 } // namespace blimp |
OLD | NEW |