Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/core/blimp_client_context_impl.h" | 5 #include "blimp/client/core/blimp_client_context_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/threading/sequenced_task_runner_handle.h" | 11 #include "base/threading/sequenced_task_runner_handle.h" |
| 12 #include "blimp/client/core/blimp_client_switches.h" | 12 #include "blimp/client/core/blimp_client_switches.h" |
| 13 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" | 13 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" |
| 14 #include "blimp/client/core/compositor/blob_manager.h" | |
| 14 #include "blimp/client/core/contents/blimp_contents_impl.h" | 15 #include "blimp/client/core/contents/blimp_contents_impl.h" |
| 15 #include "blimp/client/core/contents/blimp_contents_manager.h" | 16 #include "blimp/client/core/contents/blimp_contents_manager.h" |
| 16 #include "blimp/client/core/contents/ime_feature.h" | 17 #include "blimp/client/core/contents/ime_feature.h" |
| 17 #include "blimp/client/core/contents/navigation_feature.h" | 18 #include "blimp/client/core/contents/navigation_feature.h" |
| 18 #include "blimp/client/core/contents/tab_control_feature.h" | 19 #include "blimp/client/core/contents/tab_control_feature.h" |
| 19 #include "blimp/client/core/render_widget/render_widget_feature.h" | 20 #include "blimp/client/core/render_widget/render_widget_feature.h" |
| 20 #include "blimp/client/core/session/cross_thread_network_event_observer.h" | 21 #include "blimp/client/core/session/cross_thread_network_event_observer.h" |
| 21 #include "blimp/client/core/settings/settings_feature.h" | 22 #include "blimp/client/core/settings/settings_feature.h" |
| 22 #include "blimp/client/public/blimp_client_context_delegate.h" | 23 #include "blimp/client/public/blimp_client_context_delegate.h" |
| 23 #include "blimp/client/public/compositor/compositor_dependencies.h" | 24 #include "blimp/client/public/compositor/compositor_dependencies.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 BlimpClientContextImpl::BlimpClientContextImpl( | 59 BlimpClientContextImpl::BlimpClientContextImpl( |
| 59 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, | 60 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
| 60 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, | 61 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
| 61 std::unique_ptr<CompositorDependencies> compositor_dependencies) | 62 std::unique_ptr<CompositorDependencies> compositor_dependencies) |
| 62 : BlimpClientContext(), | 63 : BlimpClientContext(), |
| 63 io_thread_task_runner_(io_thread_task_runner), | 64 io_thread_task_runner_(io_thread_task_runner), |
| 64 file_thread_task_runner_(file_thread_task_runner), | 65 file_thread_task_runner_(file_thread_task_runner), |
| 65 blimp_compositor_dependencies_( | 66 blimp_compositor_dependencies_( |
| 66 base::MakeUnique<BlimpCompositorDependencies>( | 67 base::MakeUnique<BlimpCompositorDependencies>( |
| 67 std::move(compositor_dependencies))), | 68 std::move(compositor_dependencies))), |
| 69 blob_manager_(new BlobManager(this)), | |
| 68 ime_feature_(new ImeFeature), | 70 ime_feature_(new ImeFeature), |
| 69 navigation_feature_(new NavigationFeature), | 71 navigation_feature_(new NavigationFeature), |
| 70 render_widget_feature_(new RenderWidgetFeature), | 72 render_widget_feature_(new RenderWidgetFeature), |
| 71 settings_feature_(new SettingsFeature), | 73 settings_feature_(new SettingsFeature), |
| 72 tab_control_feature_(new TabControlFeature), | 74 tab_control_feature_(new TabControlFeature), |
| 73 blimp_contents_manager_( | 75 blimp_contents_manager_( |
| 74 new BlimpContentsManager(blimp_compositor_dependencies_.get(), | 76 new BlimpContentsManager(blimp_compositor_dependencies_.get(), |
| 75 ime_feature_.get(), | 77 ime_feature_.get(), |
| 76 navigation_feature_.get(), | 78 navigation_feature_.get(), |
| 77 render_widget_feature_.get(), | 79 render_widget_feature_.get(), |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 } | 169 } |
| 168 | 170 |
| 169 io_thread_task_runner_->PostTask( | 171 io_thread_task_runner_->PostTask( |
| 170 FROM_HERE, | 172 FROM_HERE, |
| 171 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, | 173 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, |
| 172 base::Unretained(net_components_.get()), assignment)); | 174 base::Unretained(net_components_.get()), assignment)); |
| 173 } | 175 } |
| 174 | 176 |
| 175 void BlimpClientContextImpl::RegisterFeatures() { | 177 void BlimpClientContextImpl::RegisterFeatures() { |
| 176 // Register features' message senders and receivers. | 178 // Register features' message senders and receivers. |
| 179 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, | |
| 180 blob_manager_.get()); | |
| 177 ime_feature_->set_outgoing_message_processor( | 181 ime_feature_->set_outgoing_message_processor( |
| 178 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, | 182 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, |
| 179 ime_feature_.get())); | 183 ime_feature_.get())); |
| 180 navigation_feature_->set_outgoing_message_processor( | 184 navigation_feature_->set_outgoing_message_processor( |
| 181 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, | 185 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, |
| 182 navigation_feature_.get())); | 186 navigation_feature_.get())); |
| 183 render_widget_feature_->set_outgoing_input_message_processor( | 187 render_widget_feature_->set_outgoing_input_message_processor( |
| 184 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, | 188 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, |
| 185 render_widget_feature_.get())); | 189 render_widget_feature_.get())); |
| 186 render_widget_feature_->set_outgoing_compositor_message_processor( | 190 render_widget_feature_->set_outgoing_compositor_message_processor( |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 201 switches::kDownloadWholeDocument)) | 205 switches::kDownloadWholeDocument)) |
| 202 settings_feature_->SetRecordWholeDocument(true); | 206 settings_feature_->SetRecordWholeDocument(true); |
| 203 } | 207 } |
| 204 | 208 |
| 205 void BlimpClientContextImpl::CreateIdentitySource() { | 209 void BlimpClientContextImpl::CreateIdentitySource() { |
| 206 identity_source_ = base::MakeUnique<IdentitySource>( | 210 identity_source_ = base::MakeUnique<IdentitySource>( |
| 207 delegate_, base::Bind(&BlimpClientContextImpl::ConnectToAssignmentSource, | 211 delegate_, base::Bind(&BlimpClientContextImpl::ConnectToAssignmentSource, |
| 208 base::Unretained(this))); | 212 base::Unretained(this))); |
| 209 } | 213 } |
| 210 | 214 |
| 215 void BlimpClientContextImpl::OnImageDecodeError() { | |
| 216 io_thread_task_runner_->PostTask( | |
|
David Trainor- moved to gerrit
2016/09/02 00:56:47
Can you add a comment that we're currently just dr
xingliu
2016/09/02 02:13:40
Done.
| |
| 217 FROM_HERE, | |
| 218 base::Bind( | |
| 219 &BrowserConnectionHandler::DropCurrentConnection, | |
| 220 base::Unretained(net_components_->GetBrowserConnectionHandler()))); | |
| 221 } | |
| 222 | |
| 211 } // namespace client | 223 } // namespace client |
| 212 } // namespace blimp | 224 } // namespace blimp |
| OLD | NEW |