OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/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); | |
21 | |
22 // WebKit::WebFileSystem methods. | 20 // WebKit::WebFileSystem methods. |
23 virtual void move(const WebKit::WebString& src_path, | 21 virtual void move(const WebKit::WebString& src_path, |
24 const WebKit::WebString& dest_path, | 22 const WebKit::WebString& dest_path, |
25 WebKit::WebFileSystemCallbacks* callbacks); | 23 WebKit::WebFileSystemCallbacks* callbacks); |
26 virtual void copy(const WebKit::WebString& src_path, | 24 virtual void copy(const WebKit::WebString& src_path, |
27 const WebKit::WebString& dest_path, | 25 const WebKit::WebString& dest_path, |
28 WebKit::WebFileSystemCallbacks* callbacks); | 26 WebKit::WebFileSystemCallbacks* callbacks); |
29 virtual void remove(const WebKit::WebString& path, | 27 virtual void remove(const WebKit::WebString& path, |
30 WebKit::WebFileSystemCallbacks* callbacks); | 28 WebKit::WebFileSystemCallbacks* callbacks); |
31 virtual void removeRecursively(const WebKit::WebString& path, | 29 virtual void removeRecursively(const WebKit::WebString& path, |
(...skipping 13 matching lines...) Expand all Loading... |
45 virtual void readDirectory(const WebKit::WebString& path, | 43 virtual void readDirectory(const WebKit::WebString& path, |
46 WebKit::WebFileSystemCallbacks* callbacks); | 44 WebKit::WebFileSystemCallbacks* callbacks); |
47 virtual WebKit::WebFileWriter* createFileWriter( | 45 virtual WebKit::WebFileWriter* createFileWriter( |
48 const WebKit::WebString& path, WebKit::WebFileWriterClient* client); | 46 const WebKit::WebString& path, WebKit::WebFileWriterClient* client); |
49 | 47 |
50 private: | 48 private: |
51 // Helpers. | 49 // Helpers. |
52 fileapi::FileSystemOperation* GetNewOperation( | 50 fileapi::FileSystemOperation* GetNewOperation( |
53 WebKit::WebFileSystemCallbacks* callbacks); | 51 WebKit::WebFileSystemCallbacks* callbacks); |
54 | 52 |
55 // Keeps ongoing file system operations. | |
56 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; | |
57 OperationsMap operations_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); | 53 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); |
60 }; | 54 }; |
61 | 55 |
62 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 56 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
OLD | NEW |