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

Unified Diff: chrome/browser/chromeos/drive/write_on_cache_file.h

Issue 23050014: Convert drive::FileWriteHelper to a single function for simplification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/browser/chromeos/drive/write_on_cache_file.h
diff --git a/chrome/browser/chromeos/drive/write_on_cache_file.h b/chrome/browser/chromeos/drive/write_on_cache_file.h
new file mode 100644
index 0000000000000000000000000000000000000000..639e7c63b7c6d66035ad6a8d7058a38b3148581c
--- /dev/null
+++ b/chrome/browser/chromeos/drive/write_on_cache_file.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_WRITE_ON_CACHE_FILE_H_
+#define CHROME_BROWSER_CHROMEOS_DRIVE_WRITE_ON_CACHE_FILE_H_
+
+#include "base/callback_forward.h"
+#include "chrome/browser/chromeos/drive/file_errors.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace drive {
+
+class FileSystemInterface;
+
+// Callback type for WriteOnCacheFile.
+typedef base::Callback<void (FileError, const base::FilePath& path)>
+ WriteOnCacheFileCallback;
+
+// Creates (if needed) a file at |path|, brings it to the local cache,
+// and invokes |callback| on blocking thread pool with the cache file path.
+// The |callback| can write to the file at the path by normal local file I/O
+// operations. After it returns, the written content is synced to the server.
+//
+// Must be called from UI thread.
+void WriteOnCacheFile(FileSystemInterface* file_system,
+ const base::FilePath& path,
+ const WriteOnCacheFileCallback& callback);
+
+} // namespace drive
+
+#endif // CHROME_BROWSER_CHROMEOS_DRIVE_WRITE_ON_CACHE_FILE_H_
« no previous file with comments | « chrome/browser/chromeos/drive/file_write_helper_unittest.cc ('k') | chrome/browser/chromeos/drive/write_on_cache_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698