| 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_
|
|
|