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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2542283002: Use TaskScheduler instead of WorkerPool in user_session_manager.cc. (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 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/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/base_paths.h" 13 #include "base/base_paths.h"
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/location.h" 16 #include "base/location.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/memory/ptr_util.h" 18 #include "base/memory/ptr_util.h"
19 #include "base/metrics/histogram_macros.h" 19 #include "base/metrics/histogram_macros.h"
20 #include "base/path_service.h" 20 #include "base/path_service.h"
21 #include "base/single_thread_task_runner.h" 21 #include "base/single_thread_task_runner.h"
22 #include "base/strings/string16.h" 22 #include "base/strings/string16.h"
23 #include "base/sys_info.h" 23 #include "base/sys_info.h"
24 #include "base/task_runner_util.h" 24 #include "base/task_scheduler/post_task.h"
25 #include "base/threading/thread_task_runner_handle.h" 25 #include "base/threading/thread_task_runner_handle.h"
26 #include "base/threading/worker_pool.h"
27 #include "chrome/browser/about_flags.h" 26 #include "chrome/browser/about_flags.h"
28 #include "chrome/browser/app_mode/app_mode_utils.h" 27 #include "chrome/browser/app_mode/app_mode_utils.h"
29 #include "chrome/browser/browser_process.h" 28 #include "chrome/browser/browser_process.h"
30 #include "chrome/browser/browser_process_platform_part_chromeos.h" 29 #include "chrome/browser/browser_process_platform_part_chromeos.h"
31 #include "chrome/browser/browser_shutdown.h" 30 #include "chrome/browser/browser_shutdown.h"
32 #include "chrome/browser/chrome_notification_types.h" 31 #include "chrome/browser/chrome_notification_types.h"
33 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 32 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
34 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" 33 #include "chrome/browser/chromeos/arc/arc_service_launcher.h"
35 #include "chrome/browser/chromeos/base/locale_util.h" 34 #include "chrome/browser/chromeos/base/locale_util.h"
36 #include "chrome/browser/chromeos/boot_times_recorder.h" 35 #include "chrome/browser/chromeos/boot_times_recorder.h"
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 555 }
557 556
558 void UserSessionManager::InitRlz(Profile* profile) { 557 void UserSessionManager::InitRlz(Profile* profile) {
559 #if defined(ENABLE_RLZ) 558 #if defined(ENABLE_RLZ)
560 if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { 559 if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) {
561 // Read brand code asynchronously from an OEM data and repost ourselves. 560 // Read brand code asynchronously from an OEM data and repost ourselves.
562 google_brand::chromeos::InitBrand( 561 google_brand::chromeos::InitBrand(
563 base::Bind(&UserSessionManager::InitRlz, AsWeakPtr(), profile)); 562 base::Bind(&UserSessionManager::InitRlz, AsWeakPtr(), profile));
564 return; 563 return;
565 } 564 }
566 base::PostTaskAndReplyWithResult( 565 base::PostTaskWithTraitsAndReplyWithResult(
567 base::WorkerPool::GetTaskRunner(false).get(), 566 FROM_HERE, base::TaskTraits()
568 FROM_HERE, 567 .WithShutdownBehavior(
568 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
569 .WithPriority(base::TaskPriority::BACKGROUND)
570 .WithFileIO(),
569 base::Bind(&base::PathExists, GetRlzDisabledFlagPath()), 571 base::Bind(&base::PathExists, GetRlzDisabledFlagPath()),
570 base::Bind(&UserSessionManager::InitRlzImpl, AsWeakPtr(), profile)); 572 base::Bind(&UserSessionManager::InitRlzImpl, AsWeakPtr(), profile));
571 #endif 573 #endif
572 } 574 }
573 575
574 void UserSessionManager::SetFirstLoginPrefs( 576 void UserSessionManager::SetFirstLoginPrefs(
575 Profile* profile, 577 Profile* profile,
576 const std::string& public_session_locale, 578 const std::string& public_session_locale,
577 const std::string& public_session_input_method) { 579 const std::string& public_session_input_method) {
578 VLOG(1) << "Setting first login prefs"; 580 VLOG(1) << "Setting first login prefs";
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 ->browser_policy_connector_chromeos() 1847 ->browser_policy_connector_chromeos()
1846 ->IsEnterpriseManaged()) { 1848 ->IsEnterpriseManaged()) {
1847 return false; 1849 return false;
1848 } 1850 }
1849 1851
1850 // Do not show end of life notification if this is a guest session 1852 // Do not show end of life notification if this is a guest session
1851 return !profile->IsGuestSession(); 1853 return !profile->IsGuestSession();
1852 } 1854 }
1853 1855
1854 } // namespace chromeos 1856 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698