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

Unified Diff: chrome/common/important_file_writer.cc

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/common/important_file_writer.h ('k') | chrome/common/important_file_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/important_file_writer.cc
===================================================================
--- chrome/common/important_file_writer.cc (revision 30650)
+++ chrome/common/important_file_writer.cc (working copy)
@@ -16,6 +16,7 @@
#include "base/task.h"
#include "base/thread.h"
#include "base/time.h"
+#include "chrome/browser/chrome_thread.h"
using base::TimeDelta;
@@ -82,10 +83,8 @@
} // namespace
-ImportantFileWriter::ImportantFileWriter(const FilePath& path,
- const base::Thread* backend_thread)
+ImportantFileWriter::ImportantFileWriter(const FilePath& path)
: path_(path),
- backend_thread_(backend_thread),
serializer_(NULL),
commit_interval_(TimeDelta::FromMilliseconds(kDefaultCommitIntervalMs)) {
DCHECK(CalledOnValidThread());
@@ -109,13 +108,8 @@
if (HasPendingWrite())
timer_.Stop();
- Task* task = new WriteToDiskTask(path_, data);
- if (backend_thread_) {
- backend_thread_->message_loop()->PostTask(FROM_HERE, task);
- } else {
- task->Run();
- delete task;
- }
+ ChromeThread::PostTask(
+ ChromeThread::FILE, FROM_HERE, new WriteToDiskTask(path_, data));
}
void ImportantFileWriter::ScheduleWrite(DataSerializer* serializer) {
Property changes on: chrome\common\important_file_writer.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/common/important_file_writer.h ('k') | chrome/common/important_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698