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

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

Issue 19596003: Remove CloseFile from FileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/file_write_helper.h
diff --git a/chrome/browser/chromeos/drive/file_write_helper.h b/chrome/browser/chromeos/drive/file_write_helper.h
index 6b60a6935404558482cfef4fc749f3fa9a88eb29..8a440efaa4b28a77364c92f0d47e4b8ef2ee0a6d 100644
--- a/chrome/browser/chromeos/drive/file_write_helper.h
+++ b/chrome/browser/chromeos/drive/file_write_helper.h
@@ -5,9 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_HELPER_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_HELPER_H_
+#include "base/callback_forward.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/drive/file_errors.h"
-#include "chrome/browser/chromeos/drive/file_system_interface.h"
namespace base {
class FilePath;
@@ -15,10 +15,17 @@ class FilePath;
namespace drive {
+class FileSystemInterface;
+
// This class provides higher level operations for writing to Drive files over
// FileSystemInterface.
class FileWriteHelper {
public:
+ // Callback for PrepareWritableFileAndRun.
+ typedef base::Callback<void(FileError error,
+ const base::FilePath& file_path)>
+ OpenFileCallback;
+
explicit FileWriteHelper(FileSystemInterface* file_system);
~FileWriteHelper();
@@ -34,13 +41,13 @@ class FileWriteHelper {
private:
// Part of PrepareWritableFilePathAndRun(). It tries CreateFile for the case
// file does not exist yet, does OpenFile to download and mark the file as
- // dirty, runs |callback|, and finally calls CloseFile.
+ // dirty, runs |callback|, and finally closes the file.
void PrepareWritableFileAndRunAfterOpenFile(
const base::FilePath& file_path,
const OpenFileCallback& callback,
FileError result,
- const base::FilePath& local_cache_path);
- void PrepareWritableFileAndRunAfterCallback(const base::FilePath& file_path);
+ const base::FilePath& local_cache_path,
+ const base::Closure& close_callback);
FileSystemInterface* file_system_; // Owned by DriveIntegrationService.
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_unittest.cc ('k') | chrome/browser/chromeos/drive/file_write_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698