OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WORKER_H_ | 19 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ |
20 #define CHROME_BROWSER_CHROMEOS_DRIVE_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 "base/platform_file.h" | 27 #include "base/platform_file.h" |
28 #include "chrome/browser/chromeos/drive/file_errors.h" | 28 #include "chrome/browser/chromeos/drive/file_errors.h" |
29 #include "webkit/common/blob/scoped_file.h" | 29 #include "webkit/common/blob/scoped_file.h" |
30 | 30 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // |last_modified_time|. Called from FileSystemProxy::TouchFile(). | 169 // |last_modified_time|. Called from FileSystemProxy::TouchFile(). |
170 void TouchFile(const base::FilePath& file_path, | 170 void TouchFile(const base::FilePath& file_path, |
171 const base::Time& last_access_time, | 171 const base::Time& last_access_time, |
172 const base::Time& last_modified_time, | 172 const base::Time& last_modified_time, |
173 const StatusCallback& callback, | 173 const StatusCallback& callback, |
174 FileSystemInterface* file_system); | 174 FileSystemInterface* file_system); |
175 | 175 |
176 } // namespace fileapi_internal | 176 } // namespace fileapi_internal |
177 } // namespace drive | 177 } // namespace drive |
178 | 178 |
179 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WORKER_H_ | 179 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_FILEAPI_WORKER_H_ |
OLD | NEW |