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

Side by Side Diff: chrome/browser/chromeos/login/supervised/supervised_user_creation_controller_new.cc

Issue 1104643003: Supervised users: Post blocking pool tasks with CONTINUE_SHUTDOWN behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@issue388560
Patch Set: Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/login/supervised/supervised_user_creation_cont roller_new.h" 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_cont roller_new.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 const std::string& token) { 340 const std::string& token) {
341 DCHECK(creation_context_); 341 DCHECK(creation_context_);
342 DCHECK_EQ(CRYPTOHOME_CREATED, stage_); 342 DCHECK_EQ(CRYPTOHOME_CREATED, stage_);
343 343
344 stage_ = DASHBOARD_CREATED; 344 stage_ = DASHBOARD_CREATED;
345 345
346 if (error.state() == GoogleServiceAuthError::NONE) { 346 if (error.state() == GoogleServiceAuthError::NONE) {
347 creation_context_->token = token; 347 creation_context_->token = token;
348 348
349 PostTaskAndReplyWithResult( 349 PostTaskAndReplyWithResult(
350 content::BrowserThread::GetBlockingPool(), 350 content::BrowserThread::GetBlockingPool()
351 ->GetTaskRunnerWithShutdownBehavior(
352 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)
353 .get(),
351 FROM_HERE, 354 FROM_HERE,
352 base::Bind(&StoreSupervisedUserFiles, 355 base::Bind(&StoreSupervisedUserFiles, creation_context_->token,
353 creation_context_->token,
354 ProfileHelper::GetProfilePathByUserIdHash( 356 ProfileHelper::GetProfilePathByUserIdHash(
355 creation_context_->mount_hash)), 357 creation_context_->mount_hash)),
356 base::Bind( 358 base::Bind(
357 &SupervisedUserCreationControllerNew::OnSupervisedUserFilesStored, 359 &SupervisedUserCreationControllerNew::OnSupervisedUserFilesStored,
358 weak_factory_.GetWeakPtr())); 360 weak_factory_.GetWeakPtr()));
359 } else { 361 } else {
360 stage_ = STAGE_ERROR; 362 stage_ = STAGE_ERROR;
361 LOG(ERROR) << "Supervised user creation failed. Error code " 363 LOG(ERROR) << "Supervised user creation failed. Error code "
362 << error.state(); 364 << error.state();
363 if (consumer_) 365 if (consumer_)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 creation_context_->registration_utility.reset(); 413 creation_context_->registration_utility.reset();
412 chrome::AttemptUserExit(); 414 chrome::AttemptUserExit();
413 } 415 }
414 416
415 std::string SupervisedUserCreationControllerNew::GetSupervisedUserId() { 417 std::string SupervisedUserCreationControllerNew::GetSupervisedUserId() {
416 DCHECK(creation_context_); 418 DCHECK(creation_context_);
417 return creation_context_->local_user_id; 419 return creation_context_->local_user_id;
418 } 420 }
419 421
420 } // namespace chromeos 422 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698