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

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
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..c1b73ab9dafe4f8a36cc078c9a0554af3923931b 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_;
@@ -111,3 +111,4 @@ class ImportantFileWriter : public base::NonThreadSafe {
};
#endif // CHROME_COMMON_IMPORTANT_FILE_WRITER_H_
+

Powered by Google App Engine
This is Rietveld 408576698