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

Unified Diff: chrome/browser/profiles/startup_task_runner_service.h

Issue 12952005: Delay bookmarks load while the profile is loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ObjectDestructionOrder unit test. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/startup_task_runner_service.h
diff --git a/chrome/browser/profiles/startup_task_runner_service.h b/chrome/browser/profiles/startup_task_runner_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..034f32fc1a487edde95f2b25b442d3b70ec68bde
--- /dev/null
+++ b/chrome/browser/profiles/startup_task_runner_service.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PROFILES_STARTUP_TASK_RUNNER_SERVICE_H_
+#define CHROME_BROWSER_PROFILES_STARTUP_TASK_RUNNER_SERVICE_H_
+
+#include "base/deferred_sequenced_task_runner.h"
erikwright (departed) 2013/04/15 17:56:25 forward-decl should be sufficient?
msarda 2013/04/17 09:53:55 Done.
erikwright (departed) 2013/04/17 14:41:19 Oops, not done, you can remove the #include here.
msarda 2013/04/17 15:29:10 Done for real now.
+#include "base/memory/scoped_ptr.h"
erikwright (departed) 2013/04/15 17:56:25 not required?
msarda 2013/04/17 09:53:55 Done.
+#include "base/threading/non_thread_safe.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
+
+class Profile;
+class ProfileDownloader;
erikwright (departed) 2013/04/15 17:56:25 Not required?
msarda 2013/04/17 09:53:55 Done.
+
+// This service manages the startup task runners.
+class StartupTaskRunnerService : public base::NonThreadSafe,
+ public ProfileKeyedService {
+ public:
+ explicit StartupTaskRunnerService(Profile* profile);
+ virtual ~StartupTaskRunnerService();
+
+ // Returns sequenced task runner where all bookmarks I/O operations are
+ // performed.
+ // This method should only be called from the UI thread.
+ // Note: Using a separate task runner per profile service gives a better
+ // management of the sequence in which the task are started in order to avoid
+ // congestion during start-up (e.g the caller may decide to start loading the
+ // bookmarks only after the history finished).
+ scoped_refptr<base::DeferredSequencedTaskRunner> GetBookmarkTaskRunner();
erikwright (departed) 2013/04/15 17:56:25 include ref_counted.h
msarda 2013/04/17 09:53:55 Done.
+
+ // Starts the task runners that are deferred during start-up.
+ void StartDeferredTaskRunners();
+
+ private:
+ Profile* profile_;
+ scoped_refptr<base::DeferredSequencedTaskRunner> bookmark_task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(StartupTaskRunnerService);
erikwright (departed) 2013/04/15 17:56:25 basic_types.h
msarda 2013/04/17 09:53:55 Done.
+};
+
+#endif // CHROME_BROWSER_PROFILES_STARTUP_TASK_RUNNER_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698