Chromium Code Reviews| Index: chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h |
| diff --git a/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h b/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a4f885ea74b0625d7cadf1ba5b5f15219636b7bd |
| --- /dev/null |
| +++ b/chrome/browser/media_galleries/fileapi/async_file_util_test_helper.h |
| @@ -0,0 +1,77 @@ |
| +// Copyright 2013 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_MEDIA_GALLERIES_FILEAPI_ASYNC_FILE_UTIL_TEST_HELPER_H_ |
| +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ASYNC_FILE_UTIL_TEST_HELPER_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "webkit/browser/fileapi/async_file_util.h" |
| + |
| +namespace chrome { |
| + |
| +// A helper class to perform async file operations in a synchronous way. |
| +class AsyncFileUtilTestHelper { |
| + public: |
| + explicit AsyncFileUtilTestHelper(fileapi::AsyncFileUtil* async_file_util); |
| + virtual ~AsyncFileUtilTestHelper(); |
| + |
| + // FileSystemFileUtil overrides. |
|
vandebo (ex-Chrome)
2013/05/31 23:22:17
Out of date comment.
tommycli
2013/06/01 01:40:54
Done.
|
| + virtual base::PlatformFileError CreateOrOpen( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + int file_flags, |
| + base::PlatformFile* file_handle, |
| + bool* created); |
| + virtual base::PlatformFileError EnsureFileExists( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, bool* created); |
| + virtual base::PlatformFileError CreateDirectory( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + bool exclusive, |
| + bool recursive); |
| + virtual base::PlatformFileError GetFileInfo( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + base::PlatformFileInfo* file_info, |
| + base::FilePath* platform_path); |
| + virtual base::PlatformFileError Touch( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + const base::Time& last_access_time, |
| + const base::Time& last_modified_time); |
| + virtual base::PlatformFileError Truncate( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + int64 length); |
| + virtual base::PlatformFileError CopyOrMoveFile( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& src_url, |
| + const fileapi::FileSystemURL& dest_url, |
| + bool copy); |
| + virtual base::PlatformFileError CopyInForeignFile( |
| + fileapi::FileSystemOperationContext* context, |
| + const base::FilePath& src_file_path, |
| + const fileapi::FileSystemURL& dest_url); |
| + |
| + virtual base::PlatformFileError ReadDirectorySync( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + fileapi::AsyncFileUtil::EntryList* file_list, |
| + bool* has_more); |
| + |
| + virtual scoped_refptr<webkit_blob::ShareableFileReference> |
| + CreateSnapshotFileSharable( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + base::PlatformFileError* error, |
| + base::PlatformFileInfo* file_info, |
| + base::FilePath* platform_path); |
| + private: |
| + scoped_ptr<fileapi::AsyncFileUtil> async_file_util_; |
| +}; |
| + |
| +} // namespace fileapi |
| + |
| +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ASYNC_FILE_UTIL_TEST_HELPER_H_ |