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

Unified Diff: base/files/important_file_writer.cc

Issue 11227026: Move ImportantFileWriter to base/. It now has two consumers, base/prefs and chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Win build Created 8 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 | « base/files/important_file_writer.h ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/important_file_writer.cc
diff --git a/chrome/common/important_file_writer.cc b/base/files/important_file_writer.cc
similarity index 95%
rename from chrome/common/important_file_writer.cc
rename to base/files/important_file_writer.cc
index 6a76dfbb362b83776d0c8f37e0d2bc5176e039df..42a0120f605f15f3515b77818e0590535b46dbf3 100644
--- a/chrome/common/important_file_writer.cc
+++ b/base/files/important_file_writer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/important_file_writer.h"
+#include "base/files/important_file_writer.h"
#include <stdio.h>
@@ -18,8 +18,6 @@
#include "base/threading/thread.h"
#include "base/time.h"
-using base::TimeDelta;
-
namespace {
const int kDefaultCommitIntervalMs = 10000;
@@ -88,8 +86,10 @@ void WriteToDiskTask(const FilePath& path, const std::string& data) {
} // namespace
+namespace base {
brettw 2012/10/24 03:30:54 I usually put this around the whole thing (includi
Jói 2012/10/24 10:19:17 I did that as well, in patch set 4, doing it diffe
+
ImportantFileWriter::ImportantFileWriter(
- const FilePath& path, base::MessageLoopProxy* file_message_loop_proxy)
+ const FilePath& path, MessageLoopProxy* file_message_loop_proxy)
: path_(path),
file_message_loop_proxy_(file_message_loop_proxy),
serializer_(NULL),
@@ -122,7 +122,7 @@ void ImportantFileWriter::WriteNow(const std::string& data) {
timer_.Stop();
if (!file_message_loop_proxy_->PostTask(
- FROM_HERE, base::Bind(&WriteToDiskTask, path_, data))) {
+ FROM_HERE, 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
// on the current thread.
@@ -155,3 +155,5 @@ void ImportantFileWriter::DoScheduledWrite() {
}
serializer_ = NULL;
}
+
+} // namespace base
« no previous file with comments | « base/files/important_file_writer.h ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698