OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file provides the core implementation of fileapi methods. | 5 // This file provides the core implementation of fileapi methods. |
6 // The functions should be called on UI thread. | 6 // The functions should be called on UI thread. |
7 // Note that most method invocation of fileapi is done on IO thread. The gap is | 7 // Note that most method invocation of fileapi is done on IO thread. The gap is |
8 // filled by FileSystemProxy. | 8 // filled by FileSystemProxy. |
9 // Also, the order of arguments for the functions which take FileSystemInterface | 9 // Also, the order of arguments for the functions which take FileSystemInterface |
10 // at the last is intentional. The instance of FileSystemInterface should be | 10 // at the last is intentional. The instance of FileSystemInterface should be |
11 // accessible only on UI thread, but arguments are passed on IO thread. | 11 // accessible only on UI thread, but arguments are passed on IO thread. |
12 // So, here is an intended use case: | 12 // So, here is an intended use case: |
13 // 1) Bind arguments on IO thread. Then a callback instance whose type is | 13 // 1) Bind arguments on IO thread. Then a callback instance whose type is |
14 // Callback<void(FileSysstemInterface*)> is created. | 14 // Callback<void(FileSysstemInterface*)> is created. |
15 // 2) Post the task to the UI thread. | 15 // 2) Post the task to the UI thread. |
16 // 3) On UI thread, check if the instance of FileSystemInterface is alive or | 16 // 3) On UI thread, check if the instance of FileSystemInterface is alive or |
17 // not. If yes, Run the callback with it. | 17 // not. If yes, Run the callback with it. |
18 | 18 |
19 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ | 19 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ |
20 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ | 20 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ |
21 | 21 |
22 #include <vector> | 22 #include <vector> |
23 | 23 |
24 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
25 #include "base/callback_forward.h" | 25 #include "base/callback_forward.h" |
26 #include "base/memory/weak_ptr.h" | 26 #include "base/memory/weak_ptr.h" |
27 #include "chrome/browser/chromeos/drive/file_errors.h" | 27 #include "chrome/browser/chromeos/drive/file_errors.h" |
28 #include "storage/common/blob/scoped_file.h" | 28 #include "storage/browser/blob/scoped_file.h" |
29 | 29 |
30 namespace base { | 30 namespace base { |
31 class FilePath; | 31 class FilePath; |
32 } // namespace base | 32 } // namespace base |
33 | 33 |
34 namespace storage { | 34 namespace storage { |
35 struct DirectoryEntry; | 35 struct DirectoryEntry; |
36 class FileSystemURL; | 36 class FileSystemURL; |
37 } // namespace storage | 37 } // namespace storage |
38 | 38 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 void TouchFile(const base::FilePath& file_path, | 172 void TouchFile(const base::FilePath& file_path, |
173 const base::Time& last_access_time, | 173 const base::Time& last_access_time, |
174 const base::Time& last_modified_time, | 174 const base::Time& last_modified_time, |
175 const StatusCallback& callback, | 175 const StatusCallback& callback, |
176 FileSystemInterface* file_system); | 176 FileSystemInterface* file_system); |
177 | 177 |
178 } // namespace fileapi_internal | 178 } // namespace fileapi_internal |
179 } // namespace drive | 179 } // namespace drive |
180 | 180 |
181 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ | 181 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ |
OLD | NEW |