Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: components/arc/arc_session.cc

Issue 2869163002: Refactor dbus SessionManagerInterface.StartArcInterface (Closed)
Patch Set: update names Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/arc/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return; 356 return;
357 } 357 }
358 358
359 VLOG(2) << "Socket is created. Starting ARC instance..."; 359 VLOG(2) << "Socket is created. Starting ARC instance...";
360 state_ = State::STARTING_INSTANCE; 360 state_ = State::STARTING_INSTANCE;
361 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); 361 user_manager::UserManager* user_manager = user_manager::UserManager::Get();
362 DCHECK(user_manager->GetPrimaryUser()); 362 DCHECK(user_manager->GetPrimaryUser());
363 const cryptohome::Identification cryptohome_id( 363 const cryptohome::Identification cryptohome_id(
364 user_manager->GetPrimaryUser()->GetAccountId()); 364 user_manager->GetPrimaryUser()->GetAccountId());
365 365
366 bool disable_boot_completed_broadcast = 366 bool skip_boot_completed_broadcast =
Yusuke Sato 2017/05/11 01:17:24 nit: can you add const?
xc 2017/05/15 18:01:06 Done.
367 !base::FeatureList::IsEnabled(arc::kBootCompletedBroadcastFeature); 367 !base::FeatureList::IsEnabled(arc::kBootCompletedBroadcastFeature);
368 368
369 // We only enable /vendor/priv-app when voice interaction is enabled because 369 // We only enable /vendor/priv-app when voice interaction is enabled because
370 // voice interaction service apk would be bundled in this location. 370 // voice interaction service apk would be bundled in this location.
371 bool enable_vendor_privileged = 371 bool scan_vendor_priv_app = chromeos::switches::IsVoiceInteractionEnabled();
Yusuke Sato 2017/05/11 01:17:24 same
xc 2017/05/15 18:01:06 Done.
372 chromeos::switches::IsVoiceInteractionEnabled();
373 372
374 chromeos::SessionManagerClient* session_manager_client = 373 chromeos::SessionManagerClient* session_manager_client =
375 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); 374 chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
376 session_manager_client->StartArcInstance( 375 session_manager_client->StartArcInstance(
377 cryptohome_id, disable_boot_completed_broadcast, enable_vendor_privileged, 376 cryptohome_id, skip_boot_completed_broadcast, scan_vendor_priv_app,
378 base::Bind(&ArcSessionImpl::OnInstanceStarted, weak_factory_.GetWeakPtr(), 377 base::Bind(&ArcSessionImpl::OnInstanceStarted, weak_factory_.GetWeakPtr(),
379 base::Passed(&socket_fd))); 378 base::Passed(&socket_fd)));
380 } 379 }
381 380
382 void ArcSessionImpl::OnInstanceStarted( 381 void ArcSessionImpl::OnInstanceStarted(
383 mojo::edk::ScopedPlatformHandle socket_fd, 382 mojo::edk::ScopedPlatformHandle socket_fd,
384 StartArcInstanceResult result) { 383 StartArcInstanceResult result) {
385 DCHECK(thread_checker_.CalledOnValidThread()); 384 DCHECK(thread_checker_.CalledOnValidThread());
386 if (state_ == State::STOPPED) { 385 if (state_ == State::STOPPED) {
387 // This is the case that error is notified via DBus before the 386 // This is the case that error is notified via DBus before the
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 649
651 // static 650 // static
652 std::unique_ptr<ArcSession> ArcSession::Create( 651 std::unique_ptr<ArcSession> ArcSession::Create(
653 ArcBridgeService* arc_bridge_service, 652 ArcBridgeService* arc_bridge_service,
654 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { 653 const scoped_refptr<base::TaskRunner>& blocking_task_runner) {
655 return base::MakeUnique<ArcSessionImpl>(arc_bridge_service, 654 return base::MakeUnique<ArcSessionImpl>(arc_bridge_service,
656 blocking_task_runner); 655 blocking_task_runner);
657 } 656 }
658 657
659 } // namespace arc 658 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698