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

Side by Side Diff: chrome/browser/chromeos/login/users/supervised_user_manager_impl.cc

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: 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
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/users/supervised_user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 510 }
511 511
512 void SupervisedUserManagerImpl::LoadSupervisedUserToken( 512 void SupervisedUserManagerImpl::LoadSupervisedUserToken(
513 Profile* profile, 513 Profile* profile,
514 const LoadTokenCallback& callback) { 514 const LoadTokenCallback& callback) {
515 // TODO(antrim): use profile->GetPath() once we sure it is safe. 515 // TODO(antrim): use profile->GetPath() once we sure it is safe.
516 base::FilePath profile_dir = ProfileHelper::GetProfilePathByUserIdHash( 516 base::FilePath profile_dir = ProfileHelper::GetProfilePathByUserIdHash(
517 ProfileHelper::Get()->GetUserByProfile(profile)->username_hash()); 517 ProfileHelper::Get()->GetUserByProfile(profile)->username_hash());
518 PostTaskAndReplyWithResult( 518 PostTaskAndReplyWithResult(
519 base::CreateTaskRunnerWithTraits( 519 base::CreateTaskRunnerWithTraits(
520 base::TaskTraits() 520 {base::MayBlock(), base::TaskPriority::BACKGROUND,
521 .MayBlock() 521 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN})
522 .WithPriority(base::TaskPriority::BACKGROUND)
523 .WithShutdownBehavior(
524 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN))
525 .get(), 522 .get(),
526 FROM_HERE, base::Bind(&LoadSyncToken, profile_dir), callback); 523 FROM_HERE, base::Bind(&LoadSyncToken, profile_dir), callback);
527 } 524 }
528 525
529 void SupervisedUserManagerImpl::ConfigureSyncWithToken( 526 void SupervisedUserManagerImpl::ConfigureSyncWithToken(
530 Profile* profile, 527 Profile* profile,
531 const std::string& token) { 528 const std::string& token) {
532 if (!token.empty()) 529 if (!token.empty())
533 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); 530 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token);
534 } 531 }
535 532
536 } // namespace chromeos 533 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698