| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_WRITE_ON_CACHE_FILE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_WRITE_ON_CACHE_FILE_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "chrome/browser/chromeos/drive/file_errors.h" |
| 10 |
| 11 namespace base { |
| 12 class FilePath; |
| 13 } |
| 14 |
| 15 namespace drive { |
| 16 |
| 17 class FileSystemInterface; |
| 18 |
| 19 // Callback type for WriteOnCacheFile. |
| 20 typedef base::Callback<void (FileError, const base::FilePath& path)> |
| 21 WriteOnCacheFileCallback; |
| 22 |
| 23 // Creates (if needed) a file at |path|, brings it to the local cache, |
| 24 // and invokes |callback| on blocking thread pool with the cache file path. |
| 25 // The |callback| can write to the file at the path by normal local file I/O |
| 26 // operations. After it returns, the written content is synced to the server. |
| 27 // |
| 28 // Must be called from UI thread. |
| 29 void WriteOnCacheFile(FileSystemInterface* file_system, |
| 30 const base::FilePath& path, |
| 31 const WriteOnCacheFileCallback& callback); |
| 32 |
| 33 } // namespace drive |
| 34 |
| 35 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_WRITE_ON_CACHE_FILE_H_ |
| OLD | NEW |