OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // 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/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" |
13 #include "webkit/fileapi/file_system_operation.h" | 13 #include "webkit/fileapi/file_system_operation.h" |
14 | 14 |
15 class SimpleFileSystem : public WebKit::WebFileSystem { | 15 class SimpleFileSystem : public WebKit::WebFileSystem { |
16 public: | 16 public: |
17 SimpleFileSystem() {} | 17 SimpleFileSystem() {} |
18 virtual ~SimpleFileSystem(); | 18 virtual ~SimpleFileSystem(); |
19 | 19 |
20 void RemoveCompletedOperation(int request_id); | 20 void RemoveCompletedOperation(int request_id); |
21 | 21 |
22 // WebKit::WebFileSystem methods. | 22 // WebKit::WebFileSystem methods. |
23 virtual void move(const WebKit::WebString& src_path, | 23 virtual void move(const WebKit::WebString& src_path, |
24 const WebKit::WebString& dest_path, | 24 const WebKit::WebString& dest_path, |
25 WebKit::WebFileSystemCallbacks* callbacks); | 25 WebKit::WebFileSystemCallbacks* callbacks); |
26 virtual void copy(const WebKit::WebString& src_path, | 26 virtual void copy(const WebKit::WebString& src_path, |
27 const WebKit::WebString& dest_path, | 27 const WebKit::WebString& dest_path, |
28 WebKit::WebFileSystemCallbacks* callbacks); | 28 WebKit::WebFileSystemCallbacks* callbacks); |
29 virtual void remove(const WebKit::WebString& path, | 29 virtual void remove(const WebKit::WebString& path, |
| 30 bool recursive, |
30 WebKit::WebFileSystemCallbacks* callbacks); | 31 WebKit::WebFileSystemCallbacks* callbacks); |
31 virtual void readMetadata(const WebKit::WebString& path, | 32 virtual void readMetadata(const WebKit::WebString& path, |
32 WebKit::WebFileSystemCallbacks* callbacks); | 33 WebKit::WebFileSystemCallbacks* callbacks); |
33 virtual void createFile(const WebKit::WebString& path, | 34 virtual void createFile(const WebKit::WebString& path, |
34 bool exclusive, | 35 bool exclusive, |
35 WebKit::WebFileSystemCallbacks* callbacks); | 36 WebKit::WebFileSystemCallbacks* callbacks); |
36 virtual void createDirectory(const WebKit::WebString& path, | 37 virtual void createDirectory(const WebKit::WebString& path, |
37 bool exclusive, | 38 bool exclusive, |
38 WebKit::WebFileSystemCallbacks* callbacks); | 39 WebKit::WebFileSystemCallbacks* callbacks); |
39 virtual void fileExists(const WebKit::WebString& path, | 40 virtual void fileExists(const WebKit::WebString& path, |
40 WebKit::WebFileSystemCallbacks* callbacks); | 41 WebKit::WebFileSystemCallbacks* callbacks); |
41 virtual void directoryExists(const WebKit::WebString& path, | 42 virtual void directoryExists(const WebKit::WebString& path, |
42 WebKit::WebFileSystemCallbacks* callbacks); | 43 WebKit::WebFileSystemCallbacks* callbacks); |
43 virtual void readDirectory(const WebKit::WebString& path, | 44 virtual void readDirectory(const WebKit::WebString& path, |
44 WebKit::WebFileSystemCallbacks* callbacks); | 45 WebKit::WebFileSystemCallbacks* callbacks); |
45 | 46 |
46 private: | 47 private: |
47 // Helpers. | 48 // Helpers. |
48 fileapi::FileSystemOperation* GetNewOperation( | 49 fileapi::FileSystemOperation* GetNewOperation( |
49 WebKit::WebFileSystemCallbacks* callbacks); | 50 WebKit::WebFileSystemCallbacks* callbacks); |
50 | 51 |
51 // Keeps ongoing file system operations. | 52 // Keeps ongoing file system operations. |
52 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; | 53 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; |
53 OperationsMap operations_; | 54 OperationsMap operations_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); | 56 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); |
56 }; | 57 }; |
57 | 58 |
58 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 59 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
OLD | NEW |