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

Unified Diff: chrome/common/important_file_writer.h

Issue 10344007: Use worker pool for IO in JsonPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/prefs/pref_service.cc ('k') | chrome/common/important_file_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/important_file_writer.h
diff --git a/chrome/common/important_file_writer.h b/chrome/common/important_file_writer.h
index 6209faf36dd854476e2d00cf64ec9fe2497cd588..5beea7dabf74662f3e2bbb3e84b82fcde6ebe4f9 100644
--- a/chrome/common/important_file_writer.h
+++ b/chrome/common/important_file_writer.h
@@ -16,9 +16,9 @@
#include "base/timer.h"
namespace base {
-class MessageLoopProxy;
+class SequencedTaskRunner;
class Thread;
-}
+} // namespace base
// Helper to ensure that a file won't be corrupted by the write (for example on
// application crash). Consider a naive way to save an important file F:
@@ -56,7 +56,7 @@ class ImportantFileWriter : public base::NonThreadSafe {
// file I/O can be done.
// All non-const methods, ctor and dtor must be called on the same thread.
ImportantFileWriter(const FilePath& path,
- base::MessageLoopProxy* file_message_loop_proxy);
+ base::SequencedTaskRunner* blocking_task_runner);
// You have to ensure that there are no pending writes at the moment
// of destruction.
@@ -95,8 +95,8 @@ class ImportantFileWriter : public base::NonThreadSafe {
// Path being written to.
const FilePath path_;
- // MessageLoopProxy for the thread on which file I/O can be done.
- scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy_;
+ // SequencedTaskRunner for blocking I/O operations.
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
// Timer used to schedule commit after ScheduleWrite.
base::OneShotTimer<ImportantFileWriter> timer_;
« no previous file with comments | « chrome/browser/prefs/pref_service.cc ('k') | chrome/common/important_file_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698