Cleanup: new common GetProfileSwitcherTextForItem for use on both Win and Mac
[chromium-blink-merge.git] / chrome / browser / profiles / startup_task_runner_service.h
blobd8e6b225a80b58c75e7061657ed6ed3000ade6df
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_STARTUP_TASK_RUNNER_SERVICE_H_
6 #define CHROME_BROWSER_PROFILES_STARTUP_TASK_RUNNER_SERVICE_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/non_thread_safe.h"
11 #include "components/keyed_service/core/keyed_service.h"
13 class Profile;
15 namespace base {
16 class DeferredSequencedTaskRunner;
17 } // namespace base
19 // This service manages the startup task runners.
20 class StartupTaskRunnerService : public base::NonThreadSafe,
21 public KeyedService {
22 public:
23 explicit StartupTaskRunnerService(Profile* profile);
24 ~StartupTaskRunnerService() override;
26 // Returns sequenced task runner where all bookmarks I/O operations are
27 // performed.
28 // This method should only be called from the UI thread.
29 // Note: Using a separate task runner per profile service gives a better
30 // management of the sequence in which the task are started in order to avoid
31 // congestion during start-up (e.g the caller may decide to start loading the
32 // bookmarks only after the history finished).
33 scoped_refptr<base::DeferredSequencedTaskRunner> GetBookmarkTaskRunner();
35 // Starts the task runners that are deferred during start-up.
36 void StartDeferredTaskRunners();
38 private:
39 Profile* profile_;
40 scoped_refptr<base::DeferredSequencedTaskRunner> bookmark_task_runner_;
42 DISALLOW_COPY_AND_ASSIGN(StartupTaskRunnerService);
45 #endif // CHROME_BROWSER_PROFILES_STARTUP_TASK_RUNNER_SERVICE_H_