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

Unified Diff: chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h

Issue 243703005: [fsp] [recommit #2] Add an initial AsyncFileUtil. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/file_system_provider/fileapi/provider_async_file_util.h
diff --git a/chrome/browser/chromeos/drive/fileapi/async_file_util.h b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h
similarity index 64%
copy from chrome/browser/chromeos/drive/fileapi/async_file_util.h
copy to chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h
index 607758b0ffb69864028add5a7b64cffd984e0ddb..a60df564089d5181ebc19b36f0b6db0e78567d57 100644
--- a/chrome/browser/chromeos/drive/fileapi/async_file_util.h
+++ b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h
@@ -2,24 +2,34 @@
// 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_FILEAPI_ASYNC_FILE_UTIL_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_
+#ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_FILE_UTIL_H_
+#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_FILE_UTIL_H_
#include "base/basictypes.h"
#include "base/callback.h"
#include "webkit/browser/fileapi/async_file_util.h"
-namespace drive {
+namespace chromeos {
+namespace file_system_provider {
class FileSystemInterface;
namespace internal {
-// The implementation of fileapi::AsyncFileUtil for Drive File System.
-class AsyncFileUtil : public fileapi::AsyncFileUtil {
+// The implementation of fileapi::AsyncFileUtil for provided file systems. It is
+// created one per Chrome process. It is responsible for routing calls to the
+// correct profile, and then to the correct profided file system.
+//
+// This class should be called AsyncFileUtil, without the Provided prefix. This
+// is impossible, though because of GYP limitations. There must not be two files
+// with the same name in a Chromium tree.
+// See: https://code.google.com/p/gyp/issues/detail?id=384
+//
+// All of the methods should be called on the IO thread.
+class ProviderAsyncFileUtil : public fileapi::AsyncFileUtil {
public:
- AsyncFileUtil();
- virtual ~AsyncFileUtil();
+ ProviderAsyncFileUtil();
+ virtual ~ProviderAsyncFileUtil();
// fileapi::AsyncFileUtil overrides.
virtual void CreateOrOpen(
@@ -45,17 +55,15 @@ class AsyncFileUtil : public fileapi::AsyncFileUtil {
scoped_ptr<fileapi::FileSystemOperationContext> context,
const fileapi::FileSystemURL& url,
const ReadDirectoryCallback& callback) OVERRIDE;
- virtual void Touch(
- scoped_ptr<fileapi::FileSystemOperationContext> context,
- const fileapi::FileSystemURL& url,
- const base::Time& last_access_time,
- const base::Time& last_modified_time,
- const StatusCallback& callback) OVERRIDE;
- virtual void Truncate(
- scoped_ptr<fileapi::FileSystemOperationContext> context,
- const fileapi::FileSystemURL& url,
- int64 length,
- const StatusCallback& callback) OVERRIDE;
+ virtual void Touch(scoped_ptr<fileapi::FileSystemOperationContext> context,
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const StatusCallback& callback) OVERRIDE;
+ virtual void Truncate(scoped_ptr<fileapi::FileSystemOperationContext> context,
+ const fileapi::FileSystemURL& url,
+ int64 length,
+ const StatusCallback& callback) OVERRIDE;
virtual void CopyFileLocal(
scoped_ptr<fileapi::FileSystemOperationContext> context,
const fileapi::FileSystemURL& src_url,
@@ -92,10 +100,11 @@ class AsyncFileUtil : public fileapi::AsyncFileUtil {
const CreateSnapshotFileCallback& callback) OVERRIDE;
private:
- DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil);
+ DISALLOW_COPY_AND_ASSIGN(ProviderAsyncFileUtil);
};
} // namespace internal
-} // namespace drive
+} // namespace file_system_provider
+} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_
+#endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_FILE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698