| Index: chrome/common/important_file_writer.cc
|
| diff --git a/chrome/common/important_file_writer.cc b/chrome/common/important_file_writer.cc
|
| index 6a76dfbb362b83776d0c8f37e0d2bc5176e039df..89952e5f5668533d7e50466b9e86bf004491afc3 100644
|
| --- a/chrome/common/important_file_writer.cc
|
| +++ b/chrome/common/important_file_writer.cc
|
| @@ -12,7 +12,7 @@
|
| #include "base/file_path.h"
|
| #include "base/file_util.h"
|
| #include "base/logging.h"
|
| -#include "base/message_loop_proxy.h"
|
| +#include "base/task_runner.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/string_number_conversions.h"
|
| #include "base/threading/thread.h"
|
| @@ -84,19 +84,21 @@ void WriteToDiskTask(const FilePath& path, const std::string& data) {
|
| file_util::Delete(tmp_file_path, false);
|
| return;
|
| }
|
| +
|
| + LogFailure(path, FAILED_CREATING, "Recorded file!!!");
|
| }
|
|
|
| } // namespace
|
|
|
| ImportantFileWriter::ImportantFileWriter(
|
| - const FilePath& path, base::MessageLoopProxy* file_message_loop_proxy)
|
| + const FilePath& path, base::TaskRunner* task_runner)
|
| : path_(path),
|
| - file_message_loop_proxy_(file_message_loop_proxy),
|
| + task_runner_(task_runner),
|
| serializer_(NULL),
|
| commit_interval_(TimeDelta::FromMilliseconds(
|
| kDefaultCommitIntervalMs)) {
|
| DCHECK(CalledOnValidThread());
|
| - DCHECK(file_message_loop_proxy_.get());
|
| + DCHECK(task_runner_.get());
|
| }
|
|
|
| ImportantFileWriter::~ImportantFileWriter() {
|
| @@ -121,7 +123,7 @@ void ImportantFileWriter::WriteNow(const std::string& data) {
|
| if (HasPendingWrite())
|
| timer_.Stop();
|
|
|
| - if (!file_message_loop_proxy_->PostTask(
|
| + if (!task_runner_->PostTask(
|
| FROM_HERE, base::Bind(&WriteToDiskTask, path_, data))) {
|
| // Posting the task to background message loop is not expected
|
| // to fail, but if it does, avoid losing data and just hit the disk
|
|
|