| 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/engine/session/blimp_engine_session.h" | 5 #include "blimp/engine/session/blimp_engine_session.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
| 15 #include "blimp/common/blob_cache/in_memory_blob_cache.h" | 16 #include "blimp/common/blob_cache/in_memory_blob_cache.h" |
| 16 #include "blimp/common/create_blimp_message.h" | 17 #include "blimp/common/create_blimp_message.h" |
| 17 #include "blimp/common/proto/tab_control.pb.h" | 18 #include "blimp/common/proto/tab_control.pb.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 286 |
| 286 // Initialize must only be posted after the RegisterFeature calls have | 287 // Initialize must only be posted after the RegisterFeature calls have |
| 287 // completed. | 288 // completed. |
| 288 content::BrowserThread::PostTask( | 289 content::BrowserThread::PostTask( |
| 289 content::BrowserThread::IO, FROM_HERE, | 290 content::BrowserThread::IO, FROM_HERE, |
| 290 base::Bind(&EngineNetworkComponents::Initialize, | 291 base::Bind(&EngineNetworkComponents::Initialize, |
| 291 base::Unretained(net_components_.get()), | 292 base::Unretained(net_components_.get()), |
| 292 engine_config_->client_token())); | 293 engine_config_->client_token())); |
| 293 } | 294 } |
| 294 | 295 |
| 296 EngineGeolocationFeature* BlimpEngineSession::GetGeolocationFeature() { |
| 297 return &geolocation_feature_; |
| 298 } |
| 299 |
| 295 void BlimpEngineSession::GetEnginePortForTesting( | 300 void BlimpEngineSession::GetEnginePortForTesting( |
| 296 const GetPortCallback& callback) { | 301 const GetPortCallback& callback) { |
| 297 content::BrowserThread::PostTaskAndReplyWithResult( | 302 content::BrowserThread::PostTaskAndReplyWithResult( |
| 298 content::BrowserThread::IO, FROM_HERE, | 303 content::BrowserThread::IO, FROM_HERE, |
| 299 base::Bind(&EngineNetworkComponents::GetPortForTesting, | 304 base::Bind(&EngineNetworkComponents::GetPortForTesting, |
| 300 base::Unretained(net_components_.get())), | 305 base::Unretained(net_components_.get())), |
| 301 callback); | 306 callback); |
| 302 } | 307 } |
| 303 | 308 |
| 304 void BlimpEngineSession::RegisterFeatures() { | 309 void BlimpEngineSession::RegisterFeatures() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 317 &render_widget_feature_)); | 322 &render_widget_feature_)); |
| 318 render_widget_feature_.set_input_message_sender( | 323 render_widget_feature_.set_input_message_sender( |
| 319 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, | 324 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, |
| 320 &render_widget_feature_)); | 325 &render_widget_feature_)); |
| 321 render_widget_feature_.set_compositor_message_sender( | 326 render_widget_feature_.set_compositor_message_sender( |
| 322 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, | 327 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, |
| 323 &render_widget_feature_)); | 328 &render_widget_feature_)); |
| 324 render_widget_feature_.set_ime_message_sender( | 329 render_widget_feature_.set_ime_message_sender( |
| 325 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, | 330 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, |
| 326 &render_widget_feature_)); | 331 &render_widget_feature_)); |
| 332 geolocation_feature_.set_outgoing_message_processor( |
| 333 thread_pipe_manager_->RegisterFeature(BlimpMessage::kGeolocation, |
| 334 &geolocation_feature_)); |
| 327 blob_delegate_->set_outgoing_message_processor( | 335 blob_delegate_->set_outgoing_message_processor( |
| 328 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, | 336 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, |
| 329 blob_delegate_)); | 337 blob_delegate_)); |
| 330 | 338 |
| 331 // The Settings feature does not need an outgoing message processor, since we | 339 // The Settings feature does not need an outgoing message processor, since we |
| 332 // don't send any messages to the client right now. | 340 // don't send any messages to the client right now. |
| 333 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings, | 341 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings, |
| 334 &settings_feature_); | 342 &settings_feature_); |
| 335 } | 343 } |
| 336 | 344 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 parent->AddChild(content); | 571 parent->AddChild(content); |
| 564 content->Show(); | 572 content->Show(); |
| 565 | 573 |
| 566 tab_ = base::WrapUnique(new Tab(std::move(new_contents), target_tab_id, | 574 tab_ = base::WrapUnique(new Tab(std::move(new_contents), target_tab_id, |
| 567 &render_widget_feature_, | 575 &render_widget_feature_, |
| 568 navigation_message_sender_.get())); | 576 navigation_message_sender_.get())); |
| 569 } | 577 } |
| 570 | 578 |
| 571 } // namespace engine | 579 } // namespace engine |
| 572 } // namespace blimp | 580 } // namespace blimp |
| OLD | NEW |