| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util_proxy.h" | 8 #include "base/file_util_proxy.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void OpenFileSystem(WebKit::WebFrame* frame, | 34 void OpenFileSystem(WebKit::WebFrame* frame, |
| 35 WebKit::WebFileSystem::Type type, | 35 WebKit::WebFileSystem::Type type, |
| 36 long long size, | 36 long long size, |
| 37 bool create, | 37 bool create, |
| 38 WebKit::WebFileSystemCallbacks* callbacks); | 38 WebKit::WebFileSystemCallbacks* callbacks); |
| 39 | 39 |
| 40 fileapi::FileSystemContext* file_system_context() { | 40 fileapi::FileSystemContext* file_system_context() { |
| 41 return file_system_context_.get(); | 41 return file_system_context_.get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // New WebKit::WebFileSystem overrides. | 44 // WebKit::WebFileSystem implementation. |
| 45 virtual void move( | 45 virtual void move( |
| 46 const WebKit::WebURL& src_path, | 46 const WebKit::WebURL& src_path, |
| 47 const WebKit::WebURL& dest_path, | 47 const WebKit::WebURL& dest_path, |
| 48 WebKit::WebFileSystemCallbacks*); | 48 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 49 | |
| 50 virtual void copy( | 49 virtual void copy( |
| 51 const WebKit::WebURL& src_path, | 50 const WebKit::WebURL& src_path, |
| 52 const WebKit::WebURL& dest_path, | 51 const WebKit::WebURL& dest_path, |
| 53 WebKit::WebFileSystemCallbacks*); | 52 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 54 | |
| 55 virtual void remove( | 53 virtual void remove( |
| 56 const WebKit::WebURL& path, | 54 const WebKit::WebURL& path, |
| 57 WebKit::WebFileSystemCallbacks*); | 55 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 58 | |
| 59 virtual void removeRecursively( | 56 virtual void removeRecursively( |
| 60 const WebKit::WebURL& path, | 57 const WebKit::WebURL& path, |
| 61 WebKit::WebFileSystemCallbacks*); | 58 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 62 | |
| 63 virtual void readMetadata( | 59 virtual void readMetadata( |
| 64 const WebKit::WebURL& path, | 60 const WebKit::WebURL& path, |
| 65 WebKit::WebFileSystemCallbacks*); | 61 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 66 | |
| 67 virtual void createFile( | 62 virtual void createFile( |
| 68 const WebKit::WebURL& path, | 63 const WebKit::WebURL& path, |
| 69 bool exclusive, | 64 bool exclusive, |
| 70 WebKit::WebFileSystemCallbacks*); | 65 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 71 | |
| 72 virtual void createDirectory( | 66 virtual void createDirectory( |
| 73 const WebKit::WebURL& path, | 67 const WebKit::WebURL& path, |
| 74 bool exclusive, | 68 bool exclusive, |
| 75 WebKit::WebFileSystemCallbacks*); | 69 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 76 | |
| 77 virtual void fileExists( | 70 virtual void fileExists( |
| 78 const WebKit::WebURL& path, | 71 const WebKit::WebURL& path, |
| 79 WebKit::WebFileSystemCallbacks*); | 72 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 80 | |
| 81 virtual void directoryExists( | 73 virtual void directoryExists( |
| 82 const WebKit::WebURL& path, | 74 const WebKit::WebURL& path, |
| 83 WebKit::WebFileSystemCallbacks*); | 75 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 84 | |
| 85 virtual void readDirectory( | 76 virtual void readDirectory( |
| 86 const WebKit::WebURL& path, | 77 const WebKit::WebURL& path, |
| 87 WebKit::WebFileSystemCallbacks*); | 78 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| 88 | |
| 89 virtual WebKit::WebFileWriter* createFileWriter( | 79 virtual WebKit::WebFileWriter* createFileWriter( |
| 90 const WebKit::WebURL& path, WebKit::WebFileWriterClient*); | 80 const WebKit::WebURL& path, WebKit::WebFileWriterClient*) OVERRIDE; |
| 91 | |
| 92 // Old WebKit::WebFileSystem overrides, soon to go away. | |
| 93 virtual void move(const WebKit::WebString& src_path, | |
| 94 const WebKit::WebString& dest_path, | |
| 95 WebKit::WebFileSystemCallbacks* callbacks); | |
| 96 virtual void copy(const WebKit::WebString& src_path, | |
| 97 const WebKit::WebString& dest_path, | |
| 98 WebKit::WebFileSystemCallbacks* callbacks); | |
| 99 virtual void remove(const WebKit::WebString& path, | |
| 100 WebKit::WebFileSystemCallbacks* callbacks); | |
| 101 virtual void removeRecursively(const WebKit::WebString& path, | |
| 102 WebKit::WebFileSystemCallbacks* callbacks); | |
| 103 virtual void readMetadata(const WebKit::WebString& path, | |
| 104 WebKit::WebFileSystemCallbacks* callbacks); | |
| 105 virtual void createFile(const WebKit::WebString& path, | |
| 106 bool exclusive, | |
| 107 WebKit::WebFileSystemCallbacks* callbacks); | |
| 108 virtual void createDirectory(const WebKit::WebString& path, | |
| 109 bool exclusive, | |
| 110 WebKit::WebFileSystemCallbacks* callbacks); | |
| 111 virtual void fileExists(const WebKit::WebString& path, | |
| 112 WebKit::WebFileSystemCallbacks* callbacks); | |
| 113 virtual void directoryExists(const WebKit::WebString& path, | |
| 114 WebKit::WebFileSystemCallbacks* callbacks); | |
| 115 virtual void readDirectory(const WebKit::WebString& path, | |
| 116 WebKit::WebFileSystemCallbacks* callbacks); | |
| 117 virtual WebKit::WebFileWriter* createFileWriter( | |
| 118 const WebKit::WebString& path, WebKit::WebFileWriterClient* client); | |
| 119 | 81 |
| 120 private: | 82 private: |
| 121 // Helpers. | 83 // Helpers. |
| 122 fileapi::FileSystemOperation* GetNewOperation( | 84 fileapi::FileSystemOperation* GetNewOperation( |
| 123 WebKit::WebFileSystemCallbacks* callbacks); | 85 WebKit::WebFileSystemCallbacks* callbacks); |
| 124 | 86 |
| 125 // A temporary directory for FileSystem API. | 87 // A temporary directory for FileSystem API. |
| 126 ScopedTempDir file_system_dir_; | 88 ScopedTempDir file_system_dir_; |
| 127 | 89 |
| 128 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 90 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 129 | 91 |
| 130 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); | 92 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); |
| 131 }; | 93 }; |
| 132 | 94 |
| 133 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 95 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
| OLD | NEW |