OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/files/file_util_proxy.h" | 9 #include "base/files/file_util_proxy.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystemType.h
" |
14 #include "webkit/fileapi/file_system_context.h" | 15 #include "webkit/fileapi/file_system_context.h" |
15 #include "webkit/fileapi/file_system_operation.h" | 16 #include "webkit/fileapi/file_system_operation.h" |
16 #include "webkit/fileapi/file_system_types.h" | 17 #include "webkit/fileapi/file_system_types.h" |
17 | 18 |
18 namespace WebKit { | 19 namespace WebKit { |
19 class WebFileSystemCallbacks; | 20 class WebFileSystemCallbacks; |
20 class WebFrame; | 21 class WebFrame; |
21 class WebURL; | 22 class WebURL; |
22 } | 23 } |
23 | 24 |
24 namespace fileapi { | 25 namespace fileapi { |
25 class FileSystemContext; | 26 class FileSystemContext; |
26 class FileSystemURL; | 27 class FileSystemURL; |
27 } | 28 } |
28 | 29 |
29 namespace webkit_blob { | 30 namespace webkit_blob { |
30 class BlobStorageController; | 31 class BlobStorageController; |
31 } | 32 } |
32 | 33 |
33 class SimpleFileSystem | 34 class SimpleFileSystem |
34 : public WebKit::WebFileSystem, | 35 : public WebKit::WebFileSystem, |
35 public base::SupportsWeakPtr<SimpleFileSystem> { | 36 public base::SupportsWeakPtr<SimpleFileSystem> { |
36 public: | 37 public: |
37 SimpleFileSystem(); | 38 SimpleFileSystem(); |
38 virtual ~SimpleFileSystem(); | 39 virtual ~SimpleFileSystem(); |
39 | 40 |
40 void OpenFileSystem(WebKit::WebFrame* frame, | 41 void OpenFileSystem(WebKit::WebFrame* frame, |
| 42 #ifdef WEBKIT_USE_NEW_WEBFILESYSTEMTYPE |
| 43 WebKit::WebFileSystemType type, |
| 44 #else |
41 WebKit::WebFileSystem::Type type, | 45 WebKit::WebFileSystem::Type type, |
| 46 #endif |
42 long long size, | 47 long long size, |
43 bool create, | 48 bool create, |
44 WebKit::WebFileSystemCallbacks* callbacks); | 49 WebKit::WebFileSystemCallbacks* callbacks); |
45 void DeleteFileSystem(WebKit::WebFrame* frame, | 50 void DeleteFileSystem(WebKit::WebFrame* frame, |
| 51 #ifdef WEBKIT_USE_NEW_WEBFILESYSTEMTYPE |
| 52 WebKit::WebFileSystemType type, |
| 53 #else |
46 WebKit::WebFileSystem::Type type, | 54 WebKit::WebFileSystem::Type type, |
| 55 #endif |
47 WebKit::WebFileSystemCallbacks* callbacks); | 56 WebKit::WebFileSystemCallbacks* callbacks); |
48 | 57 |
49 fileapi::FileSystemContext* file_system_context() { | 58 fileapi::FileSystemContext* file_system_context() { |
50 return file_system_context_.get(); | 59 return file_system_context_.get(); |
51 } | 60 } |
52 | 61 |
53 // WebKit::WebFileSystem implementation. | 62 // WebKit::WebFileSystem implementation. |
54 virtual void move( | 63 virtual void move( |
55 const WebKit::WebURL& src_path, | 64 const WebKit::WebURL& src_path, |
56 const WebKit::WebURL& dest_path, | 65 const WebKit::WebURL& dest_path, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 165 |
157 // A temporary directory for FileSystem API. | 166 // A temporary directory for FileSystem API. |
158 base::ScopedTempDir file_system_dir_; | 167 base::ScopedTempDir file_system_dir_; |
159 | 168 |
160 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 169 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
161 | 170 |
162 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); | 171 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); |
163 }; | 172 }; |
164 | 173 |
165 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 174 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
OLD | NEW |