OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "webkit/browser/fileapi/async_file_util.h" | 9 #include "webkit/browser/fileapi/async_file_util.h" |
10 | 10 |
11 namespace fileapi { | 11 namespace fileapi { |
12 | 12 |
13 class FileSystemFileUtil; | 13 class FileSystemFileUtil; |
14 | 14 |
15 // An adapter class for FileSystemFileUtil classes to provide asynchronous | 15 // An adapter class for FileSystemFileUtil classes to provide asynchronous |
16 // interface. | 16 // interface. |
17 // | 17 // |
18 // A filesystem can do either: | 18 // A filesystem can do either: |
19 // - implement a synchronous version of FileUtil by extending | 19 // - implement a synchronous version of FileUtil by extending |
20 // FileSystemFileUtil and atach it to this adapter, or | 20 // FileSystemFileUtil and atach it to this adapter, or |
21 // - directly implement AsyncFileUtil. | 21 // - directly implement AsyncFileUtil. |
22 // | 22 // |
23 // This instance (as thus this->sync_file_util_) is guaranteed to be alive | 23 // This instance (as thus this->sync_file_util_) is guaranteed to be alive |
24 // as far as FileSystemOperationContext given to each operation is kept alive. | 24 // as far as FileSystemOperationContext given to each operation is kept alive. |
25 class WEBKIT_STORAGE_EXPORT_PRIVATE AsyncFileUtilAdapter | 25 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE AsyncFileUtilAdapter |
26 : public AsyncFileUtil { | 26 : public AsyncFileUtil { |
27 public: | 27 public: |
28 // Creates a new AsyncFileUtil for |sync_file_util|. This takes the | 28 // Creates a new AsyncFileUtil for |sync_file_util|. This takes the |
29 // ownership of |sync_file_util|. (This doesn't take scoped_ptr<> just | 29 // ownership of |sync_file_util|. (This doesn't take scoped_ptr<> just |
30 // to save extra make_scoped_ptr; in all use cases a new fresh FileUtil is | 30 // to save extra make_scoped_ptr; in all use cases a new fresh FileUtil is |
31 // created only for this adapter.) | 31 // created only for this adapter.) |
32 explicit AsyncFileUtilAdapter(FileSystemFileUtil* sync_file_util); | 32 explicit AsyncFileUtilAdapter(FileSystemFileUtil* sync_file_util); |
33 | 33 |
34 virtual ~AsyncFileUtilAdapter(); | 34 virtual ~AsyncFileUtilAdapter(); |
35 | 35 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 private: | 103 private: |
104 scoped_ptr<FileSystemFileUtil> sync_file_util_; | 104 scoped_ptr<FileSystemFileUtil> sync_file_util_; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtilAdapter); | 106 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtilAdapter); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace fileapi | 109 } // namespace fileapi |
110 | 110 |
111 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ | 111 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ |
OLD | NEW |