| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
| 14 #include "base/threading/sequenced_task_runner_handle.h" | 14 #include "base/threading/sequenced_task_runner_handle.h" |
| 15 #include "blimp/client/core/blimp_client_switches.h" | 15 #include "blimp/client/core/blimp_client_switches.h" |
| 16 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" | 16 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" |
| 17 #include "blimp/client/core/compositor/blob_channel_feature.h" | 17 #include "blimp/client/core/compositor/blob_channel_feature.h" |
| 18 #include "blimp/client/core/contents/blimp_contents_impl.h" | 18 #include "blimp/client/core/contents/blimp_contents_impl.h" |
| 19 #include "blimp/client/core/contents/blimp_contents_manager.h" | 19 #include "blimp/client/core/contents/blimp_contents_manager.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/feedback/blimp_feedback_data.h" |
| 23 #include "blimp/client/core/geolocation/geolocation_feature.h" | 24 #include "blimp/client/core/geolocation/geolocation_feature.h" |
| 24 #include "blimp/client/core/render_widget/render_widget_feature.h" | 25 #include "blimp/client/core/render_widget/render_widget_feature.h" |
| 25 #include "blimp/client/core/session/cross_thread_network_event_observer.h" | 26 #include "blimp/client/core/session/cross_thread_network_event_observer.h" |
| 26 #include "blimp/client/core/settings/settings_feature.h" | 27 #include "blimp/client/core/settings/settings_feature.h" |
| 27 #include "blimp/client/public/blimp_client_context_delegate.h" | 28 #include "blimp/client/public/blimp_client_context_delegate.h" |
| 28 #include "blimp/client/public/compositor/compositor_dependencies.h" | 29 #include "blimp/client/public/compositor/compositor_dependencies.h" |
| 29 #include "device/geolocation/geolocation_delegate.h" | 30 #include "device/geolocation/geolocation_delegate.h" |
| 30 #include "device/geolocation/location_arbitrator.h" | 31 #include "device/geolocation/location_arbitrator.h" |
| 31 #include "ui/gfx/native_widget_types.h" | 32 #include "ui/gfx/native_widget_types.h" |
| 32 | 33 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 141 } |
| 141 | 142 |
| 142 void BlimpClientContextImpl::ConnectWithAssignment( | 143 void BlimpClientContextImpl::ConnectWithAssignment( |
| 143 const Assignment& assignment) { | 144 const Assignment& assignment) { |
| 144 io_thread_task_runner_->PostTask( | 145 io_thread_task_runner_->PostTask( |
| 145 FROM_HERE, | 146 FROM_HERE, |
| 146 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, | 147 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, |
| 147 base::Unretained(net_components_.get()), assignment)); | 148 base::Unretained(net_components_.get()), assignment)); |
| 148 } | 149 } |
| 149 | 150 |
| 151 std::unordered_map<std::string, std::string> |
| 152 BlimpClientContextImpl::CreateFeedbackData() { |
| 153 return CreateBlimpFeedbackData(); |
| 154 } |
| 155 |
| 150 void BlimpClientContextImpl::OnAuthTokenReceived( | 156 void BlimpClientContextImpl::OnAuthTokenReceived( |
| 151 const std::string& client_auth_token) { | 157 const std::string& client_auth_token) { |
| 152 if (!assignment_source_) { | 158 if (!assignment_source_) { |
| 153 assignment_source_.reset(new AssignmentSource( | 159 assignment_source_.reset(new AssignmentSource( |
| 154 GetAssignerURL(), io_thread_task_runner_, file_thread_task_runner_)); | 160 GetAssignerURL(), io_thread_task_runner_, file_thread_task_runner_)); |
| 155 } | 161 } |
| 156 | 162 |
| 157 VLOG(1) << "Trying to get assignment."; | 163 VLOG(1) << "Trying to get assignment."; |
| 158 assignment_source_->GetAssignment( | 164 assignment_source_->GetAssignment( |
| 159 client_auth_token, | 165 client_auth_token, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 base::Unretained(this))); | 249 base::Unretained(this))); |
| 244 } | 250 } |
| 245 | 251 |
| 246 void BlimpClientContextImpl::OnImageDecodeError() { | 252 void BlimpClientContextImpl::OnImageDecodeError() { |
| 247 // Currently we just drop the connection on image decoding error. | 253 // Currently we just drop the connection on image decoding error. |
| 248 DropConnection(); | 254 DropConnection(); |
| 249 } | 255 } |
| 250 | 256 |
| 251 } // namespace client | 257 } // namespace client |
| 252 } // namespace blimp | 258 } // namespace blimp |
| OLD | NEW |