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 "components/arc/arc_session.h" | 5 #include "components/arc/arc_session.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <grp.h> | 8 #include <grp.h> |
9 #include <poll.h> | 9 #include <poll.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 return; | 362 return; |
363 } | 363 } |
364 | 364 |
365 VLOG(2) << "Socket is created. Starting ARC instance..."; | 365 VLOG(2) << "Socket is created. Starting ARC instance..."; |
366 state_ = State::STARTING_INSTANCE; | 366 state_ = State::STARTING_INSTANCE; |
367 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 367 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
368 DCHECK(user_manager->GetPrimaryUser()); | 368 DCHECK(user_manager->GetPrimaryUser()); |
369 const cryptohome::Identification cryptohome_id( | 369 const cryptohome::Identification cryptohome_id( |
370 user_manager->GetPrimaryUser()->GetAccountId()); | 370 user_manager->GetPrimaryUser()->GetAccountId()); |
371 | 371 |
372 bool disable_boot_completed_broadcast = | 372 const bool skip_boot_completed_broadcast = |
373 !base::FeatureList::IsEnabled(arc::kBootCompletedBroadcastFeature); | 373 !base::FeatureList::IsEnabled(arc::kBootCompletedBroadcastFeature); |
374 | 374 |
375 // We only enable /vendor/priv-app when voice interaction is enabled because | 375 // We only enable /vendor/priv-app when voice interaction is enabled because |
376 // voice interaction service apk would be bundled in this location. | 376 // voice interaction service apk would be bundled in this location. |
377 bool enable_vendor_privileged = | 377 const bool scan_vendor_priv_app = |
378 chromeos::switches::IsVoiceInteractionEnabled(); | 378 chromeos::switches::IsVoiceInteractionEnabled(); |
379 | 379 |
380 chromeos::SessionManagerClient* session_manager_client = | 380 chromeos::SessionManagerClient* session_manager_client = |
381 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); | 381 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); |
382 session_manager_client->StartArcInstance( | 382 session_manager_client->StartArcInstance( |
383 cryptohome_id, disable_boot_completed_broadcast, enable_vendor_privileged, | 383 cryptohome_id, skip_boot_completed_broadcast, scan_vendor_priv_app, |
384 base::Bind(&ArcSessionImpl::OnInstanceStarted, weak_factory_.GetWeakPtr(), | 384 base::Bind(&ArcSessionImpl::OnInstanceStarted, weak_factory_.GetWeakPtr(), |
385 base::Passed(&socket_fd))); | 385 base::Passed(&socket_fd))); |
386 } | 386 } |
387 | 387 |
388 void ArcSessionImpl::OnInstanceStarted( | 388 void ArcSessionImpl::OnInstanceStarted( |
389 mojo::edk::ScopedPlatformHandle socket_fd, | 389 mojo::edk::ScopedPlatformHandle socket_fd, |
390 StartArcInstanceResult result, | 390 StartArcInstanceResult result, |
391 const std::string& container_instance_id) { | 391 const std::string& container_instance_id) { |
392 DCHECK(thread_checker_.CalledOnValidThread()); | 392 DCHECK(thread_checker_.CalledOnValidThread()); |
393 DCHECK_EQ(state_, State::STARTING_INSTANCE); | 393 DCHECK_EQ(state_, State::STARTING_INSTANCE); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 657 |
658 // static | 658 // static |
659 std::unique_ptr<ArcSession> ArcSession::Create( | 659 std::unique_ptr<ArcSession> ArcSession::Create( |
660 ArcBridgeService* arc_bridge_service, | 660 ArcBridgeService* arc_bridge_service, |
661 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { | 661 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { |
662 return base::MakeUnique<ArcSessionImpl>(arc_bridge_service, | 662 return base::MakeUnique<ArcSessionImpl>(arc_bridge_service, |
663 blocking_task_runner); | 663 blocking_task_runner); |
664 } | 664 } |
665 | 665 |
666 } // namespace arc | 666 } // namespace arc |
OLD | NEW |