Chromium Code Reviews| 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" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 | 48 |
| 49 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) | 49 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
| 50 : io_thread_("BlimpIOThread"), | 50 : io_thread_("BlimpIOThread"), |
| 51 geolocation_feature_(base::MakeUnique<GeolocationFeature>( | 51 geolocation_feature_(base::MakeUnique<GeolocationFeature>( |
| 52 base::MakeUnique<device::LocationArbitrator>( | 52 base::MakeUnique<device::LocationArbitrator>( |
| 53 base::MakeUnique<device::GeolocationDelegate>()))), | 53 base::MakeUnique<device::GeolocationDelegate>()))), |
| 54 tab_control_feature_(new TabControlFeature), | 54 tab_control_feature_(new TabControlFeature), |
| 55 navigation_feature_(new NavigationFeature), | 55 navigation_feature_(new NavigationFeature), |
| 56 ime_feature_(new ImeFeature), | 56 ime_feature_(new ImeFeature), |
| 57 render_widget_feature_(new RenderWidgetFeature), | 57 render_widget_feature_(new RenderWidgetFeature), |
| 58 settings_feature_(new SettingsFeature), | 58 settings_feature_(new SettingsFeature(nullptr)), |
| 59 weak_factory_(this) { | 59 weak_factory_(this) { |
| 60 base::Thread::Options options; | 60 base::Thread::Options options; |
| 61 options.message_loop_type = base::MessageLoop::TYPE_IO; | 61 options.message_loop_type = base::MessageLoop::TYPE_IO; |
| 62 io_thread_.StartWithOptions(options); | 62 io_thread_.StartWithOptions(options); |
| 63 net_components_.reset(new ClientNetworkComponents( | 63 net_components_.reset(new ClientNetworkComponents( |
| 64 base::MakeUnique<CrossThreadNetworkEventObserver>( | 64 base::MakeUnique<CrossThreadNetworkEventObserver>( |
| 65 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); | 65 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); |
| 66 | 66 |
| 67 assignment_source_.reset(new AssignmentSource( | 67 assignment_source_.reset(new AssignmentSource( |
| 68 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); | 68 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 147 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. |
| 148 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, | 148 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, |
| 149 render_widget_feature_.get()); | 149 render_widget_feature_.get()); |
| 150 | 150 |
| 151 ime_feature_->set_outgoing_message_processor( | 151 ime_feature_->set_outgoing_message_processor( |
| 152 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, | 152 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, |
| 153 ime_feature_.get())); | 153 ime_feature_.get())); |
| 154 | 154 |
| 155 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 155 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 156 switches::kDownloadWholeDocument)) | 156 switches::kDownloadWholeDocument)) |
| 157 settings_feature_->SetRecordWholeDocument(true); | 157 settings_feature_->OnRecordWholeDocumentChanged(true); |
|
David Trainor- moved to gerrit
2016/10/05 23:46:21
Since we don't really need this method, I'm actual
Menglin
2016/10/06 22:36:38
Done.
| |
| 158 } | 158 } |
| 159 | 159 |
| 160 void BlimpClientSession::DropConnection() { | 160 void BlimpClientSession::DropConnection() { |
| 161 io_thread_.task_runner()->PostTask( | 161 io_thread_.task_runner()->PostTask( |
| 162 FROM_HERE, base::Bind(&DropConnectionOnIOThread, net_components_.get())); | 162 FROM_HERE, base::Bind(&DropConnectionOnIOThread, net_components_.get())); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void BlimpClientSession::OnConnected() {} | 165 void BlimpClientSession::OnConnected() {} |
| 166 | 166 |
| 167 void BlimpClientSession::OnDisconnected(int result) {} | 167 void BlimpClientSession::OnDisconnected(int result) {} |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 185 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 185 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { |
| 186 return render_widget_feature_.get(); | 186 return render_widget_feature_.get(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { | 189 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { |
| 190 return settings_feature_.get(); | 190 return settings_feature_.get(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace client | 193 } // namespace client |
| 194 } // namespace blimp | 194 } // namespace blimp |
| OLD | NEW |